Deepgram
Updated
Use Deepgram for speech recognition (ASR) in a Conversational AI Platform agent.
Preview documentation
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 as the agent's ASR when you create or update an agent. For a complete example, see Create an agent and start a session.
Deepgram supports managed mode and BYOK. In managed mode, Agora provides access to Deepgram, and you don't need a Deepgram account. For BYOK, store your Deepgram API key in a secret set, and refer to it from the agent. For details, see Use managed mode and Use your own provider keys.
from agora_agent import Agent, DeepgramSTT, secret_ref
# client is your configured Agora client
agent = (
Agent(client=client)
.with_stt(
DeepgramSTT(
api_key=secret_ref("support_prod", "deepgram"), # omit to use managed mode
model="nova-3",
language="en-US",
keyterm="agora%20convo",
)
)
.with_llm(...) # configure your LLM vendor
.with_tts(...) # configure your TTS vendor
)import { Agent, DeepgramSTT, secretRef } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(
new DeepgramSTT({
apiKey: secretRef('support_prod', 'deepgram'), // omit to use managed mode
model: 'nova-3',
language: 'en-US',
keyterm: 'agora%20convo',
}),
)
.withLlm(/* configure your LLM vendor */)
.withTts(/* configure your TTS vendor */);// client is your configured Agora client
agent := agentkit.NewAgent(client).
WithStt(vendors.NewDeepgramSTT(vendors.DeepgramSTTOptions{
APIKey: agentkit.SecretRef("support_prod", "deepgram"), // omit to use managed mode
Model: "nova-3",
Language: "en-US",
Keyterm: "agora%20convo",
})).
WithLlm( /* configure your LLM vendor */ ).
WithTts( /* configure your TTS vendor */ )-
Managed mode
Set
credential.modetomanagedin theasrblock. Agora provides access to Deepgram, and you don't need a Deepgram account."asr": { "credential": { "mode": "managed" }, "vendor": "deepgram", "model": "nova-3", "language": "en-US", "params": { "keyterm": "agora%20convo" } } -
BYOK
Set
credential.modetobyokandcredential.fields.api_keyto a reference to your Deepgram API key in a secret set. In the following example, the key is stored asdeepgramin thesupport_prodset:"asr": { "credential": { "mode": "byok", "fields": { "api_key": "$secrets.support_prod.deepgram" } }, "vendor": "deepgram", "model": "nova-3", "language": "en-US", "params": { "keyterm": "term1%20term2" } }
Key parameters
The asr block takes the following fields. In the SDKs, DeepgramSTT sets them from its options, and passes any other Deepgram parameters from its additional parameters option to params.
vendorstringSet to deepgram.
credentialobjectHow the agent authenticates with Deepgram. Set mode to managed, or to byok with fields.api_key set to a $secrets.<set>.<key> reference to your Deepgram API key. Get your API key from the Deepgram Console.
modelstringThe speech recognition model to use. Required in managed mode, where it must be nova-2 or nova-3.
languagestringThe language code for speech recognition, for example en-US, es, or fr. See supported languages for language codes.
urlstringA custom WebSocket endpoint for Deepgram's streaming API, for example wss://api.deepgram.com/v1/listen. Omit it to use the default endpoint.
paramsobjectkeytermstringBoost specialized terms and brands. Only compatible with the nova-3 model.
Caution
The parameters listed on this page are validated for use with the Conversational AI Platform. Required parameters must be provided as documented. Any additional parameters in params are passed through directly to Deepgram 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
