Metadata-Version: 2.1
Name: openai-request-runner
Version: 0.0.3
Summary: Slim Runner for batched OpenAI Requests
Home-page: https://github.com/jphme/openai_request_runner
License: commercial
Author: Jan Philipp Harries
Author-email: jan@jph.me
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: ipykernel (>=6.22.0,<7.0.0)
Requires-Dist: nest-asyncio (>=1.5.6,<2.0.0)
Requires-Dist: openai (>=0.27.2,<0.28.0)
Requires-Dist: pydantic (>=1.8.2,<2.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: requests (>=2.26.0,<3.0.0)
Requires-Dist: tiktoken (>=0.3.3,<0.4.0)
Project-URL: Repository, https://github.com/jphme/openai_request_runner
Description-Content-Type: text/markdown

# OpenAI Request Runner

A Python package designed to facilitate parallel processing of OpenAI API requests. This implementation is inspired by the [OpenAI cookbook example](https://github.com/openai/openai-cookbook/blob/main/examples/api_request_parallel_processor.py) but offers advanced customization capabilities and integration with OpenAI Functions (leaning on the great [openai_function_call library](https://github.com/jxnl/openai_function_call)). 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)

```bash
pip install openai_request_runner
```

### Git

```bash
pip install git@https://github.com/jphme/openai_request_runner
```
### Using poetry

For local development and testing:

```bash
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
