llm
Service for accessing Gemini Live via Google Vertex AI.
This module provides integration with Google’s Gemini Live model via Vertex AI, supporting both text and audio modalities with voice transcription, streaming responses, and tool usage.
- class pipecat.services.google.gemini_live.vertex.llm.GeminiLiveVertexLLMSettings(model: str | None | _NotGiven = <factory>, extra: dict[str, Any]=<factory>, system_instruction: str | None | _NotGiven = <factory>, temperature: float | None | _NotGiven = <factory>, max_tokens: int | None | _NotGiven = <factory>, top_p: float | None | _NotGiven = <factory>, top_k: int | None | _NotGiven = <factory>, frequency_penalty: float | None | _NotGiven = <factory>, presence_penalty: float | None | _NotGiven = <factory>, seed: int | None | _NotGiven = <factory>, filter_incomplete_user_turns: bool | None | _NotGiven = <factory>, user_turn_completion_config: UserTurnCompletionConfig | None | _NotGiven = <factory>, voice: str | _NotGiven = <factory>, modalities: GeminiModalities | _NotGiven = <factory>, language: Language | str | _NotGiven = <factory>, media_resolution: GeminiMediaResolution | _NotGiven = <factory>, vad: GeminiVADParams | None | _NotGiven = <factory>, context_window_compression: ContextWindowCompressionParams | dict | _NotGiven = <factory>, thinking: ThinkingConfig | dict | _NotGiven = <factory>, enable_affective_dialog: bool | _NotGiven = <factory>, proactivity: ProactivityConfig | dict | _NotGiven = <factory>)[source]
Bases:
GeminiLiveLLMSettingsSettings for GeminiLiveVertexLLMService.
- class pipecat.services.google.gemini_live.vertex.llm.GeminiLiveVertexLLMService(*, credentials: str | None = None, credentials_path: str | None = None, location: str, project_id: str, model: str | None = None, voice_id: str = 'Charon', start_audio_paused: bool = False, start_video_paused: bool = False, system_instruction: str | None = None, tools: list[dict] | ToolsSchema | None = None, params: InputParams | None = None, settings: GeminiLiveVertexLLMSettings | None = None, inference_on_context_initialization: bool = True, file_api_base_url: str = 'https://generativelanguage.googleapis.com/v1beta/files', http_options: HttpOptions | None = None, **kwargs)[source]
Bases:
GeminiLiveLLMServiceProvides access to Google’s Gemini Live model via Vertex AI.
This service enables real-time conversations with Gemini, supporting both text and audio modalities. It handles voice transcription, streaming audio responses, and tool usage.
- Settings
alias of
GeminiLiveVertexLLMSettings
- __init__(*, credentials: str | None = None, credentials_path: str | None = None, location: str, project_id: str, model: str | None = None, voice_id: str = 'Charon', start_audio_paused: bool = False, start_video_paused: bool = False, system_instruction: str | None = None, tools: list[dict] | ToolsSchema | None = None, params: InputParams | None = None, settings: GeminiLiveVertexLLMSettings | None = None, inference_on_context_initialization: bool = True, file_api_base_url: str = 'https://generativelanguage.googleapis.com/v1beta/files', http_options: HttpOptions | None = None, **kwargs)[source]
Initialize the service for accessing Gemini Live via Google Vertex AI.
- Parameters:
credentials – JSON string of service account credentials.
credentials_path – Path to the service account JSON file.
location – GCP region for Vertex AI endpoint (e.g., “us-east4”).
project_id – Google Cloud project ID.
model –
Model identifier to use.
Deprecated since version 0.0.105: Use
settings=GeminiLiveVertexLLMService.Settings(model=...)instead.voice_id –
TTS voice identifier. Defaults to “Charon”.
Deprecated since version 0.0.105: Use
settings=GeminiLiveVertexLLMService.Settings(voice=...)instead.start_audio_paused – Whether to start with audio input paused. Defaults to False.
start_video_paused – Whether to start with video input paused. Defaults to False.
system_instruction – System prompt for the model. Defaults to None.
tools – Tools/functions available to the model. Defaults to None.
params –
Configuration parameters for the model along with Vertex AI location and project ID.
Deprecated since version 0.0.105: Use
settings=GeminiLiveVertexLLMService.Settings(...)instead.settings – Gemini Live LLM settings. If provided together with deprecated top-level parameters, the
settingsvalues take precedence.inference_on_context_initialization – Whether to generate a response when context is first set. Defaults to True.
file_api_base_url – Base URL for the Gemini File API. Defaults to the official endpoint.
http_options – HTTP options for the client.
**kwargs – Additional arguments passed to parent GeminiLiveLLMService.
- property file_api
Gemini File API is not supported with Vertex AI.