GroqTools
allows an Agent to interact with the Groq API for performing fast audio transcription, translation, and text-to-speech (TTS).
Prerequisites
Before usingGroqTools
, ensure you have the groq
library installed and your Groq API key configured.
-
Install the library:
-
Set your API key: Obtain your API key from the Groq Console and set it as an environment variable.
Initialization
ImportGroqTools
and add it to your Agent’s tool list.
Usage Examples
1. Transcribing Audio
This example demonstrates how to transcribe an audio file hosted at a URL.transcription_agent.py
2. Translating Audio and Generating Speech
This example shows how to translate an audio file (e.g., French) to English and then generate a new audio file from the translated text.translation_agent.py
Toolkit Functions
TheGroqTools
toolkit provides the following functions:
Function | Description |
---|---|
transcribe_audio | Transcribes audio from a local file path or a public URL using Groq Whisper. |
translate_audio | Translates audio from a local file path or public URL to English using Groq. |
generate_speech | Generates speech from text using Groq TTS. |
Developer Resources
- View Tools
- View Transcription Example
- View Translation Example