From aeace9b9be1005b85fa9147412f8045dc3447c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 9 Oct 2025 16:02:52 -0700 Subject: [PATCH] google: move gemini_live inside google service --- CHANGELOG.md | 23 +++++++++++-------- .../foundational/26-gemini-multimodal-live.py | 2 +- ...6a-gemini-multimodal-live-transcription.py | 2 +- ...gemini-multimodal-live-function-calling.py | 2 +- .../26c-gemini-multimodal-live-video.py | 2 +- .../26d-gemini-multimodal-live-text.py | 2 +- .../26e-gemini-multimodal-google-search.py | 2 +- .../26f-gemini-multimodal-live-files-api.py | 2 +- ...emini-multimodal-live-groundingMetadata.py | 2 +- .../26h-gemini-multimodal-live-vertex.py | 4 ++-- ...26i-gemini-multimodal-live-graceful-end.py | 4 +--- examples/foundational/46-video-processing.py | 2 +- .../gemini_multimodal_live/file_api.py | 2 +- .../services/gemini_multimodal_live/gemini.py | 12 ++++++---- .../{ => google}/gemini_live/__init__.py | 0 .../{ => google}/gemini_live/file_api.py | 0 .../{ => google}/gemini_live/gemini.py | 0 .../{ => google}/gemini_live/vertex.py | 2 +- 18 files changed, 35 insertions(+), 30 deletions(-) rename src/pipecat/services/{ => google}/gemini_live/__init__.py (100%) rename src/pipecat/services/{ => google}/gemini_live/file_api.py (100%) rename src/pipecat/services/{ => google}/gemini_live/gemini.py (100%) rename src/pipecat/services/{ => google}/gemini_live/vertex.py (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6999bd37c..10c749dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Added `GeminiVertexMultimodalLiveLLMService`, for accessing Gemini Live via - Google Vertex AI. +- Added `GeminiLiveVertexLLMService`, for accessing Gemini Live via Google + Vertex AI. -- Added some new configuration options to `GeminiMultimodalLiveLLMService`: +- Added some new configuration options to `GeminiLiveLLMService`: - `thinking` - `enable_affective_dialog` @@ -37,16 +37,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Updated `GeminiMultimodalLiveLLMService` to use the `google-genai` library - rather than use WebSockets directly. +- Updated `GeminiLiveLLMService` to use the `google-genai` library rather than + use WebSockets directly. + +### Deprecated + +- `GeminiMultimodalLiveLLMService` is now deprecated, use + `GeminiLiveLLMService`. ### Fixed -- `GeminiMultimodalLiveLLMService` will now end gracefully (i.e. after the bot - has finished) upon receiving an `EndFrame`. +- `GeminiLiveLLMService` will now end gracefully (i.e. after the bot has + finished) upon receiving an `EndFrame`. -- `GeminiMultimodalLiveLLMService` will try to seamlessly reconnect when it - loses its connection. +- `GeminiLiveLLMService` will try to seamlessly reconnect when it loses its + connection. ## [0.0.89] - 2025-10-07 diff --git a/examples/foundational/26-gemini-multimodal-live.py b/examples/foundational/26-gemini-multimodal-live.py index f063c247f..fc7ad9d35 100644 --- a/examples/foundational/26-gemini-multimodal-live.py +++ b/examples/foundational/26-gemini-multimodal-live.py @@ -17,7 +17,7 @@ from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live.gemini import GeminiLiveLLMService +from pipecat.services.google.gemini_live.gemini import GeminiLiveLLMService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams diff --git a/examples/foundational/26a-gemini-multimodal-live-transcription.py b/examples/foundational/26a-gemini-multimodal-live-transcription.py index 3c0eb19ce..cf8660edf 100644 --- a/examples/foundational/26a-gemini-multimodal-live-transcription.py +++ b/examples/foundational/26a-gemini-multimodal-live-transcription.py @@ -20,7 +20,7 @@ from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.transcript_processor import TranscriptProcessor from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live.gemini import GeminiLiveLLMService +from pipecat.services.google.gemini_live.gemini import GeminiLiveLLMService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams diff --git a/examples/foundational/26b-gemini-multimodal-live-function-calling.py b/examples/foundational/26b-gemini-multimodal-live-function-calling.py index a86822a20..a08f5a352 100644 --- a/examples/foundational/26b-gemini-multimodal-live-function-calling.py +++ b/examples/foundational/26b-gemini-multimodal-live-function-calling.py @@ -22,7 +22,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live.gemini import GeminiLiveLLMService +from pipecat.services.google.gemini_live.gemini import GeminiLiveLLMService from pipecat.services.llm_service import FunctionCallParams from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams diff --git a/examples/foundational/26c-gemini-multimodal-live-video.py b/examples/foundational/26c-gemini-multimodal-live-video.py index 7eac0bc0b..1ac4eb923 100644 --- a/examples/foundational/26c-gemini-multimodal-live-video.py +++ b/examples/foundational/26c-gemini-multimodal-live-video.py @@ -24,7 +24,7 @@ from pipecat.runner.utils import ( maybe_capture_participant_camera, maybe_capture_participant_screen, ) -from pipecat.services.gemini_live.gemini import GeminiLiveLLMService +from pipecat.services.google.gemini_live.gemini import GeminiLiveLLMService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams diff --git a/examples/foundational/26d-gemini-multimodal-live-text.py b/examples/foundational/26d-gemini-multimodal-live-text.py index 625ca17d0..68fd79c54 100644 --- a/examples/foundational/26d-gemini-multimodal-live-text.py +++ b/examples/foundational/26d-gemini-multimodal-live-text.py @@ -20,7 +20,7 @@ from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport from pipecat.services.cartesia.tts import CartesiaTTSService -from pipecat.services.gemini_live.gemini import ( +from pipecat.services.google.gemini_live.gemini import ( GeminiLiveLLMService, GeminiModalities, InputParams, diff --git a/examples/foundational/26e-gemini-multimodal-google-search.py b/examples/foundational/26e-gemini-multimodal-google-search.py index 1bcf02db9..87c754b75 100644 --- a/examples/foundational/26e-gemini-multimodal-google-search.py +++ b/examples/foundational/26e-gemini-multimodal-google-search.py @@ -19,7 +19,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live.gemini import GeminiLiveLLMService +from pipecat.services.google.gemini_live.gemini import GeminiLiveLLMService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams diff --git a/examples/foundational/26f-gemini-multimodal-live-files-api.py b/examples/foundational/26f-gemini-multimodal-live-files-api.py index 7ce4a483d..51dad712d 100644 --- a/examples/foundational/26f-gemini-multimodal-live-files-api.py +++ b/examples/foundational/26f-gemini-multimodal-live-files-api.py @@ -19,7 +19,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live.gemini import ( +from pipecat.services.google.gemini_live.gemini import ( GeminiLiveLLMService, ) from pipecat.transports.base_transport import BaseTransport, TransportParams diff --git a/examples/foundational/26g-gemini-multimodal-live-groundingMetadata.py b/examples/foundational/26g-gemini-multimodal-live-groundingMetadata.py index 9b8b25315..2b424eb18 100644 --- a/examples/foundational/26g-gemini-multimodal-live-groundingMetadata.py +++ b/examples/foundational/26g-gemini-multimodal-live-groundingMetadata.py @@ -14,8 +14,8 @@ from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live.gemini import GeminiLiveLLMService from pipecat.services.google.frames import LLMSearchResponseFrame +from pipecat.services.google.gemini_live.gemini import GeminiLiveLLMService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams diff --git a/examples/foundational/26h-gemini-multimodal-live-vertex.py b/examples/foundational/26h-gemini-multimodal-live-vertex.py index 4210dc0e2..f8dfc8c52 100644 --- a/examples/foundational/26h-gemini-multimodal-live-vertex.py +++ b/examples/foundational/26h-gemini-multimodal-live-vertex.py @@ -17,8 +17,8 @@ from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live.gemini import GeminiLiveLLMService -from pipecat.services.gemini_live.vertex import GeminiLiveVertexLLMService +from pipecat.services.google.gemini_live.gemini import GeminiLiveLLMService +from pipecat.services.google.gemini_live.vertex import GeminiLiveVertexLLMService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams diff --git a/examples/foundational/26i-gemini-multimodal-live-graceful-end.py b/examples/foundational/26i-gemini-multimodal-live-graceful-end.py index 9451d0ef0..3527e89e3 100644 --- a/examples/foundational/26i-gemini-multimodal-live-graceful-end.py +++ b/examples/foundational/26i-gemini-multimodal-live-graceful-end.py @@ -4,8 +4,6 @@ # SPDX-License-Identifier: BSD 2-Clause License # - -import asyncio import os from datetime import datetime @@ -24,7 +22,7 @@ from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.frame_processor import FrameDirection from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live.gemini import GeminiLiveLLMService +from pipecat.services.google.gemini_live.gemini import GeminiLiveLLMService from pipecat.services.llm_service import FunctionCallParams from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams diff --git a/examples/foundational/46-video-processing.py b/examples/foundational/46-video-processing.py index 7f7363538..0152f3211 100644 --- a/examples/foundational/46-video-processing.py +++ b/examples/foundational/46-video-processing.py @@ -20,7 +20,7 @@ from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frameworks.rtvi import RTVIObserver, RTVIProcessor from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.gemini_live import GeminiLiveLLMService +from pipecat.services.google.gemini_live import GeminiLiveLLMService from pipecat.transports.base_transport import TransportParams from pipecat.transports.daily.transport import DailyParams, DailyTransport diff --git a/src/pipecat/services/gemini_multimodal_live/file_api.py b/src/pipecat/services/gemini_multimodal_live/file_api.py index 53f8442fc..ed4d6c522 100644 --- a/src/pipecat/services/gemini_multimodal_live/file_api.py +++ b/src/pipecat/services/gemini_multimodal_live/file_api.py @@ -20,7 +20,7 @@ import warnings from loguru import logger try: - from pipecat.services.gemini_live.file_api import GeminiFileAPI as _GeminiFileAPI + from pipecat.services.google.gemini_live.file_api import GeminiFileAPI as _GeminiFileAPI except ModuleNotFoundError as e: logger.error(f"Exception: {e}") logger.error("In order to use Google AI, you need to `pip install pipecat-ai[google]`.") diff --git a/src/pipecat/services/gemini_multimodal_live/gemini.py b/src/pipecat/services/gemini_multimodal_live/gemini.py index 4ac51e02e..a3547551a 100644 --- a/src/pipecat/services/gemini_multimodal_live/gemini.py +++ b/src/pipecat/services/gemini_multimodal_live/gemini.py @@ -18,10 +18,10 @@ voice transcription, streaming responses, and tool usage. import warnings -from pipecat.services.gemini_live.gemini import ( +from pipecat.services.google.gemini_live.gemini import ( ContextWindowCompressionParams as _ContextWindowCompressionParams, ) -from pipecat.services.gemini_live.gemini import ( +from pipecat.services.google.gemini_live.gemini import ( GeminiLiveAssistantContextAggregator, GeminiLiveContext, GeminiLiveContextAggregatorPair, @@ -29,9 +29,11 @@ from pipecat.services.gemini_live.gemini import ( GeminiLiveUserContextAggregator, GeminiModalities, ) -from pipecat.services.gemini_live.gemini import GeminiMediaResolution as _GeminiMediaResolution -from pipecat.services.gemini_live.gemini import GeminiVADParams as _GeminiVADParams -from pipecat.services.gemini_live.gemini import InputParams as _InputParams +from pipecat.services.google.gemini_live.gemini import ( + GeminiMediaResolution as _GeminiMediaResolution, +) +from pipecat.services.google.gemini_live.gemini import GeminiVADParams as _GeminiVADParams +from pipecat.services.google.gemini_live.gemini import InputParams as _InputParams with warnings.catch_warnings(): warnings.simplefilter("always") diff --git a/src/pipecat/services/gemini_live/__init__.py b/src/pipecat/services/google/gemini_live/__init__.py similarity index 100% rename from src/pipecat/services/gemini_live/__init__.py rename to src/pipecat/services/google/gemini_live/__init__.py diff --git a/src/pipecat/services/gemini_live/file_api.py b/src/pipecat/services/google/gemini_live/file_api.py similarity index 100% rename from src/pipecat/services/gemini_live/file_api.py rename to src/pipecat/services/google/gemini_live/file_api.py diff --git a/src/pipecat/services/gemini_live/gemini.py b/src/pipecat/services/google/gemini_live/gemini.py similarity index 100% rename from src/pipecat/services/gemini_live/gemini.py rename to src/pipecat/services/google/gemini_live/gemini.py diff --git a/src/pipecat/services/gemini_live/vertex.py b/src/pipecat/services/google/gemini_live/vertex.py similarity index 99% rename from src/pipecat/services/gemini_live/vertex.py rename to src/pipecat/services/google/gemini_live/vertex.py index c03f589b8..29ff63a0b 100644 --- a/src/pipecat/services/gemini_live/vertex.py +++ b/src/pipecat/services/google/gemini_live/vertex.py @@ -18,7 +18,7 @@ from typing import List, Optional, Union from loguru import logger from pipecat.adapters.schemas.tools_schema import ToolsSchema -from pipecat.services.gemini_live.gemini import ( +from pipecat.services.google.gemini_live.gemini import ( GeminiLiveLLMService, HttpOptions, InputParams,