Skip to main content

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

  1. Navigate to the Project Directory:
cd /path/to/openai_batch_sdk
  1. Install Dependencies:
pip install -r requirements.txt
  1. Build the Package:
python setup.py sdist bdist_wheel

Testing the Project

  1. Navigate to the Tests Directory:
cd /path/to/openai_batch_sdk/tests
  1. Run the Tests:
python -m unittest discover

Running the Project

  1. Create a Docker Image:
docker build -t openai_batch_sdk:latest /path/to/openai_batch_sdk
  1. Run the Docker Container:
docker run -d openai_batch_sdk:latest

Deploying to Kubernetes

  1. 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

openai_batch_sdk-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openai_batch_sdk-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file openai_batch_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: openai_batch_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.6

File hashes

Hashes for openai_batch_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b989e01e383a840e684787812cb383283e1e932ba7075fdd93e3a2c4efd5efc
MD5 7cadacdb2cc155e7a6aa9680fb584fb9
BLAKE2b-256 4b00418a87f50b311d3c67ae7a694047beb044bd47d5a3d95f6b7f1cd62b053a

See more details on using hashes here.

File details

Details for the file openai_batch_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_batch_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98178cf9f37fbc267894f5a2f3e5c41a520b6eeb8cc4270dc2b30b6913c14334
MD5 37b29b7bc2ff36ec72ff2ef3c5a2c22e
BLAKE2b-256 56766e1b567623c787d6050c588a8a68a0d84185729d7cfda37877c3680ca510

See more details on using hashes here.

Supported by

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