OpenAI connectors

There are two OpenAI connectors:

  • Batch connector: The Batch API connector allows you to submit requests for asynchronous batch processing on OpenAI.
  • ChatGPT connector The ChatGPT connector allows you to submit prompts to ChatGPT and receive responses synchronously.

Installation

To use the OpenAI batch or ChatGPT connector, run the following command:

pip install flytekitplugins-openai

Example usage

Batch connector

For a batch connector usage example, see OpenAI Batch connector example usage.

ChatGPT connector

For a ChatGPT usage example, see ChatGPT connector example.

Local testing

Batch connector

To test the batch connector locally, create a class for the connector task that inherits from AsyncConnectorExecutorMixin. This mixin can handle asynchronous tasks and allows flytekit to mimic FlytePropeller’s behavior in calling the connector.

ChatGPT connector

To test the ChatGPT connector locally, create a class for the connector task that inherits from SyncConnectorExecutorMixin. This mixin can handle synchronous tasks and allows flytekit to mimic FlytePropeller’s behavior in calling the connector.

Union.ai cluster deployment

After you have finished testing the batch or ChatGPT connector locally, contact the Union.ai team to enable it in your cluster.