GeminiLiveAgentConfig
Configuration for GeminiLiveAgent.
Defined in: src/providers/agent/gemini/types.ts:68
Configuration for GeminiLiveAgent.
Remarks
Extends BaseProviderConfig, so apiKey, proxyUrl, timeout, and debug are also available. Direct (browser) mode authenticates via the key query parameter on the WebSocket URL; in proxy mode the proxy appends the key server-side so it never reaches the browser.
Example
const agent = new GeminiLiveAgent({
proxyUrl: '/api/proxy/gemini-live',
model: 'gemini-2.0-flash-live-001',
voice: 'Puck',
systemInstruction: 'You are a concise, friendly voice assistant.',
});
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 |
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 |
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 |
functionDeclarations? | GeminiLiveFunctionDeclaration[] | undefined | Function declarations the agent can call. | - | src/providers/agent/gemini/types.ts:118 |
inputTranscription? | boolean | true | Whether to request transcription of the user’s input audio. Remarks Input transcription is what drives the SDK’s transcription.* events and conversation history. Disable only if you do not need transcripts — audio still flows either way. | - | src/providers/agent/gemini/types.ts:104 |
language? | string | undefined | BCP-47 language code for speech output (e.g. 'en-US'). | - | src/providers/agent/gemini/types.ts:89 |
model? | string | 'gemini-2.0-flash-live-001' | Live-capable model ID (e.g. 'gemini-2.0-flash-live-001', 'gemini-2.5-flash-preview-native-audio-dialog'). | - | src/providers/agent/gemini/types.ts:75 |
onFunctionCall? | (call) => Promise<{ response: Record<string, unknown>; }> | undefined | Handler invoked when the agent calls a function. Remarks The returned response object is sent back in a toolResponse message. | - | src/providers/agent/gemini/types.ts:126 |
outputTranscription? | boolean | true | Whether to request transcription of the agent’s output audio. Remarks Output transcription provides the assistant text for llm.* events and conversation history. | - | src/providers/agent/gemini/types.ts:115 |
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 |
setupOverrides? | Record<string, unknown> | undefined | Extra fields merged into the setup payload, after the fields derived from this config. Remarks Escape hatch for Live API setup options this config does not model (e.g. sessionResumption, contextWindowCompression, realtimeInputConfig). | - | src/providers/agent/gemini/types.ts:136 |
systemInstruction? | string | undefined | System instruction defining the agent’s persona and behaviour. | - | src/providers/agent/gemini/types.ts:78 |
temperature? | number | undefined | Sampling temperature for response generation. | - | src/providers/agent/gemini/types.ts:92 |
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 |
voice? | string | undefined | Prebuilt output voice name (e.g. 'Puck', 'Aoede', 'Charon'). Remarks Maps to speechConfig.voiceConfig.prebuiltVoiceConfig.voiceName. | - | src/providers/agent/gemini/types.ts:86 |