Deepgram
Updated
Integrate Deepgram ASR into Conversational AI Engine.
Deepgram provides fast, accurate automatic speech recognition with advanced AI models optimized for real-time streaming and conversational applications across multiple languages.
Sample configuration
The following example shows how to configure Deepgram ASR when starting a conversational AI agent.
from agora_agent import Agent, DeepgramSTT
# client is your configured Agora client
agent = (
Agent(client)
.with_stt(DeepgramSTT(
api_key='your-deepgram-key', # omit to use Agora-managed mode
model='nova-3',
language='en',
))
.with_llm(...) # configure your LLM vendor
.with_tts(...) # configure your TTS vendor
)import { Agent, DeepgramSTT } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(new DeepgramSTT({
apiKey: 'your-deepgram-key', // omit to use Agora-managed mode
model: 'nova-3',
language: 'en',
}))
.withLlm(/* configure your LLM vendor */)
.withTts(/* configure your TTS vendor */);import (
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(
vendors.NewDeepgramSTT(vendors.DeepgramSTTOptions{
APIKey: "your-deepgram-key", // omit to use Agora-managed mode
Model: "nova-3",
Language: "en",
}),
).WithLlm(/* configure your LLM vendor */).
WithTts(/* configure your TTS vendor */)-
Managed mode
To use Deepgram ASR with Agora-managed credentials, set
credential_modeto"managed"in theasrblock. When using managed mode,params.api_keyis not required. You can still use theasrfield to configure additional settings such aslanguageandkeyterm. For more information, see Use managed mode."asr": { "credential_mode": "managed", "vendor": "deepgram", "params": { "url": "wss://api.deepgram.com/v1/listen", "model": "nova-3", "language": "en", "keyterm": "agora%20convo" } } -
BYOK
"asr": { "vendor": "deepgram", "params": { "url": "wss://api.deepgram.com/v1/listen", "api_key": "<deepgram_key>", "model": "nova-3", "language": "en", "keyterm": "term1%20term2" } }
Key parameters
| Parameter | Description |
|---|---|
urlstring | The WebSocket URL for Deepgram's streaming API. |
api_keystring | The API key used for authentication. Required when using your own API key (BYOK). Get your API key from the Deepgram Console. |
modelstring | The speech recognition model to use. For managed mode, use |
languagestring | The language code for speech recognition (For example, |
keytermstring | Boost specialized terms and brands. Only compatible with the |
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 Deepgram API documentation.
The following parameters are not passed through and instead use default values set by Agora:
callback, callback_method, channels, encoding, multichannel, sample_rate
