Skip to content

Commit b7ce3ec

Browse files
authored
Merge pull request #81 from pipecat-ai/pk/update-gemini-live-imports
Update examples to use `GeminiLiveLLMService` instead of the deprecat…
2 parents a3f6313 + 9adb246 commit b7ce3ec

File tree

12 files changed

+34
-34
lines changed

12 files changed

+34
-34
lines changed

deployment/modal-example/server/src/bot_gemini.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
"""Gemini Bot Implementation.
88
9-
This module implements a chatbot using Google's Gemini Multimodal Live model.
9+
This module implements a chatbot using Google's Gemini Live model.
1010
It includes:
1111
- Real-time audio/video interaction through Daily
1212
- Animated robot avatar
@@ -38,7 +38,7 @@
3838
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
3939
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
4040
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
41-
from pipecat.services.gemini_multimodal_live.gemini import GeminiMultimodalLiveLLMService
41+
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
4242
from pipecat.transports.daily.transport import DailyParams, DailyTransport
4343

4444
load_dotenv(override=True)
@@ -108,7 +108,7 @@ async def run_bot(room_url: str, token: str):
108108
109109
Sets up and runs the bot pipeline including:
110110
- Daily video transport with specific audio parameters
111-
- Gemini Live multimodal model integration
111+
- Gemini Live model integration
112112
- Voice activity detection
113113
- Animation processing
114114
- RTVI event handling
@@ -129,8 +129,8 @@ async def run_bot(room_url: str, token: str):
129129
),
130130
)
131131

132-
# Initialize the Gemini Multimodal Live model
133-
llm = GeminiMultimodalLiveLLMService(
132+
# Initialize the Gemini Live model
133+
llm = GeminiLiveLLMService(
134134
api_key=os.getenv("GOOGLE_API_KEY"),
135135
voice_id="Puck", # Aoede, Charon, Fenrir, Kore, Puck
136136
transcribe_user_audio=True,

instant-voice/server/src/single_bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pipecat.pipeline.task import PipelineParams, PipelineTask
1818
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
1919
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
20-
from pipecat.services.gemini_multimodal_live import GeminiMultimodalLiveLLMService
20+
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
2121
from pipecat.transports.daily.transport import DailyParams, DailyTransport
2222

2323
load_dotenv(override=True)
@@ -65,7 +65,7 @@ async def main():
6565
),
6666
)
6767

68-
llm = GeminiMultimodalLiveLLMService(
68+
llm = GeminiLiveLLMService(
6969
api_key=os.getenv("GOOGLE_API_KEY"),
7070
voice_id="Puck", # Aoede, Charon, Fenrir, Kore, Puck
7171
transcribe_user_audio=True,

p2p-webrtc/docker/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from pipecat.pipeline.runner import PipelineRunner
1414
from pipecat.pipeline.task import PipelineParams, PipelineTask
1515
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
16-
from pipecat.services.gemini_multimodal_live import GeminiMultimodalLiveLLMService
16+
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
1717
from pipecat.transports.base_transport import TransportParams
1818
from pipecat.transports.smallwebrtc.transport import SmallWebRTCTransport
1919

@@ -41,7 +41,7 @@ async def run_bot(webrtc_connection):
4141
),
4242
)
4343

44-
llm = GeminiMultimodalLiveLLMService(
44+
llm = GeminiLiveLLMService(
4545
api_key=os.getenv("GOOGLE_API_KEY"),
4646
voice_id="Puck", # Aoede, Charon, Fenrir, Kore, Puck
4747
transcribe_user_audio=True,

p2p-webrtc/video-transform/server/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
1818
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
1919
from pipecat.processors.frameworks.rtvi import RTVIObserver, RTVIProcessor
20-
from pipecat.services.gemini_multimodal_live import GeminiMultimodalLiveLLMService
20+
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
2121
from pipecat.transports.base_transport import TransportParams
2222
from pipecat.transports.smallwebrtc.transport import SmallWebRTCTransport
2323

@@ -84,7 +84,7 @@ async def run_bot(webrtc_connection):
8484
webrtc_connection=webrtc_connection, params=transport_params
8585
)
8686

87-
llm = GeminiMultimodalLiveLLMService(
87+
llm = GeminiLiveLLMService(
8888
api_key=os.getenv("GOOGLE_API_KEY"),
8989
voice_id="Puck", # Aoede, Charon, Fenrir, Kore, Puck
9090
transcribe_user_audio=True,

p2p-webrtc/voice-agent/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pipecat.pipeline.runner import PipelineRunner
1515
from pipecat.pipeline.task import PipelineParams, PipelineTask
1616
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
17-
from pipecat.services.gemini_multimodal_live import GeminiMultimodalLiveLLMService
17+
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
1818
from pipecat.transports.base_transport import TransportParams
1919
from pipecat.transports.smallwebrtc.transport import SmallWebRTCTransport
2020

@@ -42,7 +42,7 @@ async def run_bot(webrtc_connection):
4242
),
4343
)
4444

45-
llm = GeminiMultimodalLiveLLMService(
45+
llm = GeminiLiveLLMService(
4646
api_key=os.getenv("GOOGLE_API_KEY"),
4747
voice_id="Puck", # Aoede, Charon, Fenrir, Kore, Puck
4848
transcribe_user_audio=True,

simple-chatbot/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This repository demonstrates a simple AI chatbot with real-time audio/video inte
1212
- Requires OpenAI API key
1313

1414
2. **Gemini Bot**
15-
- Uses Google's Gemini Multimodal Live model
15+
- Uses Google's Gemini Live model
1616
- Requires Gemini API key
1717

1818
## Six Client Options

simple-chatbot/server/bot-gemini.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
"""Gemini Bot Implementation.
88
9-
This module implements a chatbot using Google's Gemini Multimodal Live model.
9+
This module implements a chatbot using Google's Gemini Live model.
1010
It includes:
1111
- Real-time audio/video interaction through Daily
1212
- Animated robot avatar
@@ -37,7 +37,7 @@
3737
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
3838
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
3939
from pipecat.runner.types import RunnerArguments
40-
from pipecat.services.gemini_multimodal_live.gemini import GeminiMultimodalLiveLLMService
40+
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
4141
from pipecat.transports.base_transport import BaseTransport
4242
from pipecat.transports.daily.transport import DailyParams, DailyTransport
4343

@@ -101,14 +101,14 @@ async def run_bot(transport: BaseTransport):
101101
"""Main bot execution function.
102102
103103
Sets up and runs the bot pipeline including:
104-
- Gemini Live multimodal model integration
104+
- Gemini Live model integration
105105
- Voice activity detection
106106
- Animation processing
107107
- RTVI event handling
108108
"""
109109

110-
# Initialize the Gemini Multimodal Live model
111-
llm = GeminiMultimodalLiveLLMService(
110+
# Initialize the Gemini Live model
111+
llm = GeminiLiveLLMService(
112112
api_key=os.getenv("GOOGLE_API_KEY"),
113113
voice_id="Puck", # Aoede, Charon, Fenrir, Kore, Puck
114114
)

travel-companion/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pipecat Travel Companion
22

3-
Pipecat Travel Companion is a smart travel assistant powered by the `GeminiMultimodalLiveLLMService`.
3+
Pipecat Travel Companion is a smart travel assistant powered by the `GeminiLiveLLMService`.
44
It offers personalized recommendations and services like checking the weather, suggesting nearby restaurants,
55
and providing recent news based on your current location.
66

travel-companion/server/bot-gemini.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
"""Gemini Travel Companion
88
9-
This module implements a chatbot using Google's Gemini Multimodal Live model.
9+
This module implements a chatbot using Google's Gemini Live model.
1010
It includes:
1111
- Real-time audio interaction through Daily
1212
- Function calling
@@ -32,7 +32,7 @@
3232
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
3333
from pipecat.runner.types import RunnerArguments
3434
from pipecat.runner.utils import create_transport
35-
from pipecat.services.gemini_multimodal_live.gemini import GeminiMultimodalLiveLLMService
35+
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
3636
from pipecat.transports.base_transport import BaseTransport, TransportParams
3737
from pipecat.transports.daily.transport import DailyParams
3838

@@ -47,14 +47,14 @@
4747
audio_out_enabled=True,
4848
video_in_enabled=True,
4949
# set stop_secs to something roughly similar to the internal setting
50-
# of the Multimodal Live api, just to align events. This doesn't really
51-
# matter because we can only use the Multimodal Live API's phrase
50+
# of the Gemini Live api, just to align events. This doesn't really
51+
# matter because we can only use the Gemini Live API's phrase
5252
# endpointing, for now.
5353
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=0.5)),
5454
),
5555
}
5656

57-
# Search tool can only be used together with other tools when using the Multimodal Live API
57+
# Search tool can only be used together with other tools when using the Gemini Live API
5858
# Otherwise it should be used alone.
5959
# We are registering the tools here, but who are handling them is the RTVI client
6060
get_location_function = FunctionSchema(
@@ -113,14 +113,14 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
113113
"""Main bot execution function.
114114
115115
Sets up and runs the bot pipeline including:
116-
- Gemini Live multimodal model integration
116+
- Gemini Live model integration
117117
- Voice activity detection
118118
- Animation processing
119119
- RTVI event handling
120120
"""
121121

122-
# Initialize the Gemini Multimodal Live model
123-
llm = GeminiMultimodalLiveLLMService(
122+
# Initialize the Gemini Live model
123+
llm = GeminiLiveLLMService(
124124
api_key=os.getenv("GOOGLE_API_KEY"),
125125
voice_id="Puck", # Aoede, Charon, Fenrir, Kore, Puck
126126
system_instruction=system_instruction,

websocket/server/bot_fast_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
1717
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
1818
from pipecat.serializers.protobuf import ProtobufFrameSerializer
19-
from pipecat.services.gemini_multimodal_live import GeminiMultimodalLiveLLMService
19+
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
2020
from pipecat.transports.websocket.fastapi import (
2121
FastAPIWebsocketParams,
2222
FastAPIWebsocketTransport,
@@ -51,7 +51,7 @@ async def run_bot(websocket_client):
5151
),
5252
)
5353

54-
llm = GeminiMultimodalLiveLLMService(
54+
llm = GeminiLiveLLMService(
5555
api_key=os.getenv("GOOGLE_API_KEY"),
5656
voice_id="Puck", # Aoede, Charon, Fenrir, Kore, Puck
5757
transcribe_model_audio=True,

0 commit comments

Comments
 (0)