Prerequisites
Before usingOpenAITools, ensure you have the openai library installed and your OpenAI API key configured.
-
Install dependencies:
-
Set your API key: Obtain your API key from OpenAI and set it as an environment variable.
Initialization
ImportOpenAITools and add it to your Agent’s tool list.
Usage Examples
1. Transcribing Audio
The agent transcribes an audio file:transcription_agent.py
2. Generating Images
The agent generates an image from a text prompt:image_generation_agent.py
3. Generating Speech
The agent 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
TheOpenAITools toolkit provides the following functions: