From abd9f16b90a3750545187f2a6f8f8c2498f819b0 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 7 Feb 2025 08:44:17 -0500 Subject: [PATCH] Export .rtvi, update new-chatbot example, rename and update foundational 32 --- ...grounding-metadata.py => 32-gemini-grounding-metadata.py} | 1 + examples/news-chatbot/server/news_bot.py | 5 +++-- src/pipecat/services/google/__init__.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) rename examples/foundational/{31-gemini-grounding-metadata.py => 32-gemini-grounding-metadata.py} (99%) diff --git a/examples/foundational/31-gemini-grounding-metadata.py b/examples/foundational/32-gemini-grounding-metadata.py similarity index 99% rename from examples/foundational/31-gemini-grounding-metadata.py rename to examples/foundational/32-gemini-grounding-metadata.py index f82e9029c..67694652f 100644 --- a/examples/foundational/31-gemini-grounding-metadata.py +++ b/examples/foundational/32-gemini-grounding-metadata.py @@ -89,6 +89,7 @@ async def main(): api_key=os.getenv("GOOGLE_API_KEY"), system_instruction=system_instruction, tools=tools, + model="gemini-1.5-flash-002", ) context = OpenAILLMContext( diff --git a/examples/news-chatbot/server/news_bot.py b/examples/news-chatbot/server/news_bot.py index f1c83c2fd..7aed4c3b9 100644 --- a/examples/news-chatbot/server/news_bot.py +++ b/examples/news-chatbot/server/news_bot.py @@ -23,7 +23,7 @@ from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIProcessor from pipecat.services.cartesia import CartesiaTTSService from pipecat.services.deepgram import DeepgramSTTService -from pipecat.services.google import GoogleLLMService, LLMSearchResponseFrame +from pipecat.services.google import GoogleLLMService, GoogleRTVIObserver, LLMSearchResponseFrame from pipecat.transports.services.daily import DailyParams, DailyTransport from pipecat.utils.text.markdown_text_filter import MarkdownTextFilter @@ -102,6 +102,7 @@ async def main(): llm = GoogleLLMService( api_key=os.getenv("GOOGLE_API_KEY"), + model="gemini-1.5-flash-002", system_instruction=system_instruction, tools=tools, ) @@ -141,7 +142,7 @@ async def main(): pipeline, PipelineParams( allow_interruptions=True, - observers=[rtvi.observer()], + observers=[GoogleRTVIObserver(rtvi)], ), ) diff --git a/src/pipecat/services/google/__init__.py b/src/pipecat/services/google/__init__.py index 1b81980e6..3e63a3ba9 100644 --- a/src/pipecat/services/google/__init__.py +++ b/src/pipecat/services/google/__init__.py @@ -1,2 +1,3 @@ from .frames import LLMSearchResponseFrame from .google import * +from .rtvi import *