Groq TTS
The Groq TTS provider enables your agent to use Groq's high-quality text-to-speech models for generating natural-sounding voice output.
Installation​
Install the Groq-enabled VideoSDK Agents package:
pip install "videosdk-plugins-groq"
Importing​
from videosdk.plugins.groq import GroqTTS
Authentication​
The Groq plugin requires an Groq API key.
Set GROQ_API_KEY
in your .env
file.
Example Usage​
from videosdk.plugins.groq import GroqTTS
from videosdk.agents import CascadingPipeline
# Initialize the Groq AI TTS model
tts = GroqTTS(
model="playai-tts",
voice="Fritz-PlayAI",
)
# Add tts to cascading pipeline
pipeline = CascadingPipeline(tts=tts)
When using .env file for credentials, don't pass them as arguments to model instances or context objects. The SDK automatically reads environment variables, so omit api_key
and other credential parameters from your code.
Configuration Options​
model
(str): The TTS model to use. Default: "playai-tts"voice
(str): The voice to use. Default: "Fritz-PlayAI"speed
(float): Speed of speech (0.5 to 5.0). Default: 1.0api_key
(str, optional): Groq API key. If not provided, uses GROQ_API_KEY environment variable
Additional Resources​
The following resources provide more information about using Groq with VideoSDK Agents SDK.
-
Python package: The
videosdk-plugins-groq
package on PyPI. -
GitHub repo: View the source or contribute to the VideoSDK Groq TTS plugin.
-
Groq docs: Groq TTS docs.
Got a Question? Ask us on discord