OpenAI Batch connector

The Batch API connector allows you to submit requests for asynchronous batch processing on OpenAI. You can provide either a JSONL file or a JSON iterator, and the connector handles the upload to OpenAI, creation of the batch, and downloading of the output and error files.

Installation

To use the OpenAI Batch connector, run the following command:

$ pip install flytekitplugins-openai

Example usage

For an example query, see OpenAI Batch connector example usage

Local testing

To test an connector locally, create a class for the connector task that inherits from SyncConnectorExecutorMixin or AsyncConnectorExecutorMixin. These mixins can handle synchronous and synchronous tasks, respectively, and allow the SDK to mimic the system’s behavior in calling the connector.

For more information, see Testing connectors locally.

Flyte deployment configuration

To enable the OpenAI Batch connector in your Flyte deployment, refer to the OpenAI Batch connector setup guide