Skip to main content
GroqTools allows an Agent to interact with the Groq API for performing fast audio transcription, translation, and text-to-speech (TTS).

Prerequisites

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

Initialization

Import GroqTools 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
You can customize the underlying Groq models used for transcription, translation, and TTS during initialization:

Toolkit Params

Toolkit Functions

The GroqTools toolkit provides the following functions:

Developer Resources