/** * Configuration for the Google Gemini Live (realtime speech-to-speech) provider. * * All fields are optional; unset values fall back to the defaults noted on each * field. Pass an instance as the `config` option to {@link GeminiRealtime}. */ export type GeminiLiveConfig = { /** * Gemini Live model id to use. * @default 'gemini-3.1-flash-live-preview' */ model?: string; /** * Prebuilt Gemini voice name for synthesized audio output (e.g. 'Puck', * 'Charon', 'Kore', 'Fenrir', 'Aoede'). * @default 'Puck' */ voice?: string; /** * Output modalities the model should produce. Typically `['AUDIO']` for * speech-to-speech or `['TEXT']` for text responses. * @default ['AUDIO'] */ responseModalities?: string[]; /** * Nucleus sampling probability mass (0..1). Higher values widen token * selection. `null` leaves it unset (model default). * @default null */ topP?: number | null; /** * Top-k sampling: restrict sampling to the k most likely tokens. `null` * leaves it unset (model default). * @default null */ topK?: number | null; /** * Maximum number of tokens to generate per response. `null` leaves it unset * (model default). * @default null */ maxOutputTokens?: number | null; /** * Presence penalty; positive values discourage reusing tokens already * present, encouraging new topics. `null` leaves it unset (model default). * @default null */ presencePenalty?: number | null; /** * Frequency penalty; positive values discourage repeating frequent tokens. * `null` leaves it unset (model default). * @default null */ frequencyPenalty?: number | null; /** * Number of candidate responses to generate. `null` leaves it unset (model * default, typically 1). * @default null */ candidateCount?: number | null; /** * BCP-47 language code hint for output (e.g. 'en-US'). `null` lets the model * auto-detect. * @default null */ languageCode?: string | null; /** * Token budget allotted to the model's internal "thinking" reasoning. `null` * leaves it unset (model default). * @default null */ thinkingBudget?: number | null; /** * Whether to include the model's thought summaries in the response. * @default false */ includeThoughts?: boolean; /** * Voice-activity-detection start sensitivity for detecting speech onset * (e.g. 'START_SENSITIVITY_LOW' / 'START_SENSITIVITY_HIGH'). `null` uses the * model default. * @default null */ vadStartSensitivity?: string | null; /** * Voice-activity-detection end sensitivity for detecting speech end (e.g. * 'END_SENSITIVITY_LOW' / 'END_SENSITIVITY_HIGH'). `null` uses the model * default. * @default null */ vadEndSensitivity?: string | null; /** * Milliseconds of audio to retain before detected speech starts. `null` uses * the model default. * @default null */ vadPrefixPaddingMs?: number | null; /** * Milliseconds of trailing silence required before speech is considered * ended. `null` uses the model default. * @default null */ vadSilenceDurationMs?: number | null; /** * Token count at which context compression is triggered to keep the session * within the context window. `null` disables/uses the model default. * @default null */ contextCompressionTriggerTokens?: number | null; /** * Handle from a previous session used to resume that session's state. `null` * starts a fresh session. * @default null */ sessionResumptionHandle?: string | null; /** * Whether to emit transcriptions of the user's input audio. * @default true */ enableInputTranscription?: boolean; /** * Whether to emit transcriptions of the model's output audio. * @default true */ enableOutputTranscription?: boolean; /** * Use Vertex AI authentication instead of a Gemini API key. When `true`, * {@link vertexProjectId} is required. * @default false */ vertexai?: boolean; /** * Google Cloud project id for Vertex AI. Required when {@link vertexai} is * `true`. * @default null */ vertexProjectId?: string | null; /** * Google Cloud region for Vertex AI requests. * @default 'us-central1' */ vertexLocation?: string; /** * Vertex AI service-account credentials, as a JSON string or parsed object. * If unset, falls back to {@link vertexServiceAccountPath}, then the * `GOOGLE_APPLICATION_CREDENTIALS` environment variable. * @default null */ vertexServiceAccountJson?: string | Record | null; /** * Filesystem path to a Vertex AI service-account JSON key file. Used only * when {@link vertexServiceAccountJson} is not provided. * @default null */ vertexServiceAccountPath?: string | null; }; interface ResolvedConfig { model: string; voice: string; responseModalities: string[]; topP: number | null; topK: number | null; maxOutputTokens: number | null; presencePenalty: number | null; frequencyPenalty: number | null; candidateCount: number | null; languageCode: string | null; thinkingBudget: number | null; includeThoughts: boolean; vadStartSensitivity: string | null; vadEndSensitivity: string | null; vadPrefixPaddingMs: number | null; vadSilenceDurationMs: number | null; contextCompressionTriggerTokens: number | null; sessionResumptionHandle: string | null; enableInputTranscription: boolean; enableOutputTranscription: boolean; vertexai: boolean; vertexProjectId: string | null; vertexLocation: string; vertexServiceAccountJson: string | Record | null; vertexServiceAccountPath: string | null; } declare class GeminiRealtimeImpl { static readonly displayName = "GeminiRealtime"; _providerName: string; _isRealtimeModel: boolean; apiKey?: string; config: ResolvedConfig; model: string; voice: string; params: Record; constructor(opts?: { apiKey?: string; config?: GeminiLiveConfig | null; [key: string]: any; }); close(): Promise; cleanup(): Promise; getRuntimeConfig(): Record; } /** A configured Google Gemini realtime provider instance. */ export type GeminiRealtime = GeminiRealtimeImpl; /** * Google Gemini realtime (speech-to-speech / live) provider. * * @param opts.apiKey - Gemini API key. Defaults to the `GOOGLE_API_KEY` * environment variable. Ignored when using Vertex AI auth. * @param opts.config - Model, voice, sampling, VAD, transcription and Vertex * AI settings; see {@link GeminiLiveConfig}. * @param opts - Additional/forward-compatible options are accepted and passed * through. */ export declare const GeminiRealtime: (opts?: { apiKey?: string; config?: GeminiLiveConfig | null; [key: string]: any; }) => GeminiRealtime; export {};