DeepgramAgentConfig
Top-level configuration for the Deepgram Agent API provider.
Defined in: src/providers/agent/deepgram/types.ts:536
Top-level configuration for the Deepgram Agent API provider.
Remarks
This interface maps to the Settings WebSocket message defined in the Deepgram Agent V1 AsyncAPI spec. It extends BaseProviderConfig so apiKey, proxyUrl, and other base fields are also available.
Example
const config: DeepgramAgentConfig = {
apiKey: process.env.DEEPGRAM_API_KEY,
audio: {
input: { encoding: 'linear16', sample_rate: 16000 },
output: { encoding: 'linear16', sample_rate: 24000, container: 'none' },
},
listen: {
provider: { type: 'deepgram', model: 'nova-3', language: 'en' },
},
think: {
provider: { type: 'open_ai', model: 'gpt-4o-mini' },
prompt: 'You are a helpful assistant.',
functions: [
{ name: 'get_weather', description: 'Get current weather', parameters: { ... } },
],
},
speak: {
provider: { type: 'deepgram', model: 'aura-2-thalia-en' },
},
greeting: 'Hello! How can I help you today?',
};
Extends
Properties
| Property | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
apiKey? | string | () => Promise<string> | undefined | API key or authentication token for the provider. Remarks Can be a static string or an async factory function that returns a fresh token on each call. Use a factory for short-lived tokens (e.g. Deepgram JWTs) so each WebSocket connection gets a valid credential. For client-side usage, consider using a proxy server to keep API keys secure. The SDK provides Express, Next.js, and Node adapters for this purpose. | BaseProviderConfig.apiKey | src/core/types/providers.ts:71 |
audio? | AgentAudioConfig | undefined | Audio encoding/sample rate for input and output. | - | src/providers/agent/deepgram/types.ts:538 |
authType? | "token" | "bearer" | Provider-specific (typically 'token' for Deepgram, ignored for REST providers) | Authentication type for providers that support multiple auth mechanisms. Remarks Controls how the apiKey is sent to the provider: - 'token' — WebSocket subprotocol ['token', apiKey] or header Authorization: Token <key>. This is the default for Deepgram providers. - 'bearer' — WebSocket subprotocol ['bearer', token] or header Authorization: Bearer <token>. Use this for OAuth tokens or providers that expect Bearer auth. REST/SDK providers (Anthropic, OpenAI) handle auth through their SDK constructors and ignore this field. | BaseProviderConfig.authType | src/core/types/providers.ts:115 |
context? | { messages?: { content: string; role: "user" | "assistant"; }[]; } | undefined | Pre-seed conversation context. | - | src/providers/agent/deepgram/types.ts:553 |
context.messages? | { content: string; role: "user" | "assistant"; }[] | undefined | - | - | src/providers/agent/deepgram/types.ts:554 |
debug? | boolean | false | Whether to enable debug logging for this provider. Remarks When true, the provider emits detailed internal logs. This is separate from the SDK-level LoggingConfig. | BaseProviderConfig.debug | src/core/types/providers.ts:126 |
endpoint? | string | undefined | Custom endpoint URL to override the provider’s default API endpoint. Remarks Useful for self-hosted instances, proxy servers, or development environments. | BaseProviderConfig.endpoint | src/core/types/providers.ts:79 |
experimental? | boolean | undefined | Enable experimental Agent API features (e.g. AgentStartedSpeaking). | - | src/providers/agent/deepgram/types.ts:561 |
greeting? | string | undefined | Greeting message the agent speaks when the session starts. | - | src/providers/agent/deepgram/types.ts:550 |
listen? | AgentListenConfig | undefined | STT configuration (Deepgram Nova/Flux). | - | src/providers/agent/deepgram/types.ts:541 |
onFunctionCall? | (call) => Promise<{ content: string; }> | undefined | Client-side function call handler. Remarks Called when the Agent API requests execution of a client-side function. Return the result content as a string. | - | src/providers/agent/deepgram/types.ts:570 |
proxyUrl? | string | undefined | URL of a CompositeVoice proxy server endpoint for this provider. Remarks When set, requests are routed through the proxy which injects the real API key server-side. This keeps API keys out of the browser. For WebSocket providers the HTTP URL is automatically converted to ws(s)://. At least one of apiKey or proxyUrl must be set for providers that require authentication (all except NativeSTT, NativeTTS, and WebLLM). Example proxyUrl: 'http://localhost:3000/api/proxy/deepgram' | BaseProviderConfig.proxyUrl | src/core/types/providers.ts:97 |
speak? | AgentSpeakConfig | undefined | TTS configuration (provider, voice). | - | src/providers/agent/deepgram/types.ts:547 |
think? | AgentThinkConfig | undefined | LLM configuration (provider, prompt, functions). | - | src/providers/agent/deepgram/types.ts:544 |
timeout? | number | undefined | Request timeout in milliseconds. Remarks Applies to HTTP requests (REST providers) and connection establishment (WebSocket providers). Set to 0 for no timeout. | BaseProviderConfig.timeout | src/core/types/providers.ts:135 |