blitzactions-0.0.1
توضیحات
A package to test openai
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | blitzactions-0.0.1 |
| نام | blitzactions |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Rudra |
| ایمیل نویسنده | blitz04.dev@gmailc.com |
| آدرس صفحه اصلی | https://github.com/BlitzJB/blitzactions |
| آدرس اینترنتی | https://pypi.org/project/blitzactions/ |
| مجوز | - |
# BlitzActions
is a framework to translate test prompts to function executions
## Installation
```bash
pip install blitzactions
```
## Usage
```python
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
نیازمندی
| مقدار | نام |
|---|---|
| - | openai |
| - | python-dotenv |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl blitzactions-0.0.1:
pip install blitzactions-0.0.1.whl
نصب پکیج tar.gz blitzactions-0.0.1:
pip install blitzactions-0.0.1.tar.gz