Skip to main content

Usage guide

Setup, environment variables, and Python/JavaScript/Go usage examples.

GeminiRealtime

Realtime speech-to-speech integration for the Gemini Live API. Wraps the Gemini Live model so it can be used as a full speech-to-speech provider within the runtime, with support for both the Google AI and Vertex AI backends. Configuration is supplied through a GeminiLiveConfig instance and resolved into a flat parameter map for the runtime.

Constructor

api_key
str | None
Google API key. When omitted, the value of the GOOGLE_API_KEY environment variable is used.
config
GeminiLiveConfig | None
Provider configuration. When omitted, a default GeminiLiveConfig is used.

aclose

Release any resources held by the integration. This implementation performs no work and exists so the integration can be used interchangeably with providers that require teardown.

cleanup

Clean up the integration by delegating to aclose.

GeminiLiveConfig

Fields

model
str
default:"gemini-3.1-flash-live-preview"
voice
str
default:"Puck"
response_modalities
List[str]
default:"…"
top_p
Optional[float]
top_k
Optional[int]
max_output_tokens
Optional[int]
presence_penalty
Optional[float]
frequency_penalty
Optional[float]
candidate_count
Optional[int]
language_code
Optional[str]
thinking_budget
Optional[int]
include_thoughts
bool
default:"False"
vad_start_sensitivity
Optional[str]
vad_end_sensitivity
Optional[str]
vad_prefix_padding_ms
Optional[int]
vad_silence_duration_ms
Optional[int]
context_compression_trigger_tokens
Optional[int]
session_resumption_handle
Optional[str]
enable_input_transcription
bool
default:"True"
enable_output_transcription
bool
default:"True"
vertexai
bool
default:"False"
vertex_project_id
Optional[str]
vertex_location
str
default:"us-central1"
vertex_service_account_json
Optional[Union[str, Dict]]
vertex_service_account_path
Optional[str]