An SDK for OpenAI ChatGPT batch API for a single process.
Project description
OpenAI Batch SDK
This library provides a simple interface for integrating OpenAI ChatGPT batch processing into any Python development environment. It supports event-driven architecture, making it easy to handle batch job completions.
(Note: Read The License Disclaimer about code status and AI assited coding)
Installation
pip install openai_batch_sdk
Example Code for Usage
from openai_batch_sdk import start_monitoring, EventHandler, send_notification, retrieve_batch_results
# Initialize event handler
event_handler = EventHandler()
event_handler.register_event("batch_completed", send_notification)
# Start monitoring the batch job
start_monitoring("/app/path_to_your_file.jsonl", event_handler)
Development
Building the Project
- Navigate to the Project Directory:
cd /path/to/openai_batch_sdk
- Install Dependencies:
pip install -r requirements.txt
- Build the Package:
python setup.py sdist bdist_wheel
Testing the Project
- Navigate to the Tests Directory:
cd /path/to/openai_batch_sdk/tests
- Run the Tests:
python -m unittest discover
Running the Project
- Create a Docker Image:
docker build -t openai_batch_sdk:latest /path/to/openai_batch_sdk
- Run the Docker Container:
docker run -d openai_batch_sdk:latest
Deploying to Kubernetes
- Apply the Kubernetes Configuration:
kubectl apply -f /path/to/openai_batch_sdk/k8s-deployment.yaml
License
MIT License (Read The Disclaimer)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Disclaimer: This project is a draft and has not been battle-tested. Use at your own risk. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
Generated with the help of ChatGPT.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openai_batch_sdk-0.1.3.tar.gz.
File metadata
- Download URL: openai_batch_sdk-0.1.3.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17e119224cacdc1a73a0d7c151cdb761683d0c2885b78fce7fd38523f39835b2
|
|
| MD5 |
bb656556cf697f5e1038db37d19417a9
|
|
| BLAKE2b-256 |
501d2baad3673041a5b4dd6459a4da88369a4a9a6754bb4058e29562e60bd2f9
|
File details
Details for the file openai_batch_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: openai_batch_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d212efca0f2a915da71ce4c490fef8500687fd9df43f3ef816c1faa775a5dcd
|
|
| MD5 |
39ae81ea410eeac0db1256d2f9a4ed2c
|
|
| BLAKE2b-256 |
7184cc81924d87ac27a5b88a2d5401a8bf96d1499de7cf437b48116bf1d89641
|