Sarvam
Updated
Integrate Sarvam TTS with the Conversational AI Engine.
Sarvam provides fast, reliable text-to-speech (TTS) with support for Indian languages and customizable voices.
Sample configuration
The following examples show how to configure Sarvam TTS when starting a conversational AI agent.
from agora_agent import Agent
from agora_agent.agentkit.vendors import SarvamTTS
# client is your configured Agora client
agent = (
Agent(client)
.with_stt(...) # configure your STT vendor
.with_llm(...) # configure your LLM vendor
.with_tts(SarvamTTS(
key='your-sarvam-key',
speaker='anushka',
target_language_code='en-IN',
model='bulbul:v3',
speech_sample_rate=24000,
enable_preprocessing=True,
))
)import { Agent, SarvamTTS } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your STT vendor */)
.withLlm(/* configure your LLM vendor */)
.withTts(new SarvamTTS({
key: 'your-sarvam-key',
speaker: 'anushka',
targetLanguageCode: 'en-IN',
model: 'bulbul:v3',
speechSampleRate: 24000,
enablePreprocessing: true,
}));import (
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)
speechSampleRate := 24000
enablePreprocessing := true
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
WithLlm(/* configure your LLM vendor */).
WithTts(
vendors.NewSarvamTTS(vendors.SarvamTTSOptions{
Key: "your-sarvam-key",
Speaker: "anushka",
TargetLanguageCode: "en-IN",
Model: "bulbul:v3",
SpeechSampleRate: &speechSampleRate,
EnablePreprocessing: &enablePreprocessing,
}),
)Use the following tts configuration in your request:
"tts": {
"vendor": "sarvam",
"params": {
"api_subscription_key": "<SARVAM_API_KEY>",
"speaker": "anushka",
"target_language_code": "en-IN",
"model": "bulbul:v3",
"speech_sample_rate": 24000,
"enable_preprocessing": true
}
}Key parameters
| Parameter | Description |
|---|---|
api_subscription_keystring | The API key used for authentication. Get your API key from the Sarvam dashboard. |
speakerstring | The voice ID to use for speech generation.
|
target_language_codestring | The language code for speech synthesis. Supported values:
|
pitchnumber |
The pitch adjustment for the voice. Positive values make the voice sharper; negative values make it deeper. Applies to the |
pacenumber |
The speed of speech. |
loudnessnumber |
The volume level of the speech. Higher values increase the loudness. Applies to the |
modelstring |
The Sarvam TTS model to use. |
speech_sample_ratenumber |
The audio sample rate in Hz. Replaces |
enable_preprocessingboolean | Whether to normalize English words and numeric entities, such as dates and currency, before speech synthesis. |
Caution
The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to the underlying vendor without validation. For a full list of supported options, refer to the Sarvam documentation.
This integration is fully supported for use with Conversational AI Engine. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
