Skip to main content

Slim Runner for batched OpenAI Requests

Project description

OpenAI Request Runner

A Python package designed to facilitate parallel processing of OpenAI API requests. This implementation is inspired by the OpenAI cookbook example but offers advanced customization capabilities and integration with OpenAI Functions (leaning on the great openai_function_call library). It ensures efficient and organized interactions with the OpenAI models. Features

  • Parallel Processing: Handle multiple OpenAI API requests concurrently.
  • Rate Limiting: Adheres to rate limits set by the OpenAI API.
  • Advanced Customization: Allows for detailed input preprocessing and API response postprocessing.
  • OpenAI Functions: Seamlessly integrates with OpenAI Functions for added capabilities.
  • Error Handling: Efficiently manage and log errors, including rate limit errors.
  • Extendable: Easily integrate with custom schemas and other extensions.

Installation

Using pip (wip)

pip install openai_request_runner

Git

pip install git@https://github.com/jphme/openai_request_runner

Using poetry

For local development and testing:

poetry install

Usage

See examples/classify_languages.py and examples/translate.py for detailed examples of how to use the package.

The package allows for extensive customization. You can set your desired preprocessing function, postprocessing function, and other parameters to suit your specific needs.

Refer to the inline documentation and docstrings in the code for detailed information on each function and its parameters.

Contributing

Contributions are welcome! Please open an issue if you encounter any problems or would like to suggest enhancements. Pull requests are also appreciated.

License

MIT

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_request_runner-0.0.3.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

openai_request_runner-0.0.3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file openai_request_runner-0.0.3.tar.gz.

File metadata

  • Download URL: openai_request_runner-0.0.3.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1042-azure

File hashes

Hashes for openai_request_runner-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7b40091c61bf395d8b24958c79f2fef66428464cc8d73e4e9893de1c4ad96f16
MD5 bdc01f562c41913886a91cc9d867d5cf
BLAKE2b-256 3674a88ebcf39265d490f600cb18af57b19fd19a03157e5e366762924662dee9

See more details on using hashes here.

File details

Details for the file openai_request_runner-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for openai_request_runner-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a62af6ab5b580f746e0a1f1290bac1ffe1a5c349aa08e39a365968a6a3e057b9
MD5 421336113dc791d7b8f16fde9a8a99bd
BLAKE2b-256 a253af554fca29f773b3a3f07f259c75e6d7e2f5c517d58f30419e9d8d78591d

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