Skip to main content
OpenAITools allow an Agent to interact with OpenAI models for performing audio transcription, image generation, and text-to-speech.

Prerequisites

Before using OpenAITools, ensure you have the openai library installed and your OpenAI API key configured.
  1. Install dependencies:
  2. Set your API key: Obtain your API key from OpenAI and set it as an environment variable.

Initialization

Import OpenAITools and add it to your Agent’s tool list.

Usage Examples

1. Transcribing Audio

This example demonstrates an agent that transcribes an audio file.
transcription_agent.py

2. Generating Images

This example demonstrates an agent that generates an image based on a text prompt.
image_generation_agent.py

3. Generating Speech

This example demonstrates an agent that generates speech from text.
speech_synthesis_agent.py
View more examples here.

Customization

You can customize the underlying OpenAI models used for transcription, image generation, and TTS:

Toolkit Params

Toolkit Functions

The OpenAITools toolkit provides the following functions:

Developer Resources