Skip to main content

A package to test openai

Project description

BlitzActions

is a framework to translate test prompts to function executions

Installation

pip install blitzactions

Usage

from os import environ
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())

from blitzactions.manager import ActionsManager

data = [
    {
        "name": "Joshua",
        "sales": 100000,
        "profit": 10000,
        "payment": 1000,
    },
    {
        "name": "Rudra",
        "sales": 300000,
        "profit": 30000,
        "payment": 3000,
    },
    {
        "name": "Vishal",
        "sales": 200000,
        "profit": 20000,
        "payment": 2000,
    }
]

manager = ActionsManager(environ.get('OPENAI_API_KEY'))

@manager.register
def generate_employee_report(employee_name: str) -> str:
    """Generates report of employee with name passed in employee_names"""
    return f'Employee name: {employee_name}\nSales: {data[0]["sales"]}\nProfit: {data[0]["profit"]}\nPayment: {data[0]["payment"]}'

@manager.register
def show_employee_data() -> str:
    """Generates a report of all employees with all details in the table"""
    return '\n'.join([f'{d["name"]} | {d["sales"]} | {d["payment"]}' for d in data])

@manager.register
def execute_payments_to_employees() -> int:
    """Processes payroll payments to all employees for this month"""
    for employee in data:
        print(f'Processing {employee["payment"]}USD payment for {employee["name"]}')


result = manager.execute(input("Enter your prooompt: "))
print(result)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. /s

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blitzactions-0.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

blitzactions-0.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file blitzactions-0.0.1.tar.gz.

File metadata

  • Download URL: blitzactions-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for blitzactions-0.0.1.tar.gz
Algorithm Hash digest
SHA256 249b89a0693193f68a9d5006f351e4b01202e9725b0eb453ad5a77c807be4a41
MD5 7ed4f1c0d8e93fc7ee9b2aaaf08f2946
BLAKE2b-256 c5a1b4b412fedc84d13f8024e28e3a332a68f786c44a787190dbb0b060727ea8

See more details on using hashes here.

File details

Details for the file blitzactions-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for blitzactions-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ecec1e7b8e55938b765ace5a7f17048dee4f02c7a879b8a9b6c6da6d1a1a209
MD5 10c1cd8ec10e3afd712c3e4ee82dfdc6
BLAKE2b-256 a5c1b2f938ec2b1894b807d2ab09aaf2b0fc408ff73f80c927d2a2eafc87367c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page