From 58bfcc8370382a9d0a6e3eb3cef67859d8fc7282 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Thu, 9 Jan 2025 12:22:37 -0300 Subject: [PATCH] Fixing GeminiMultimodalLiveLLMService function calling when using with pipecat-flows. --- src/pipecat/services/gemini_multimodal_live/gemini.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pipecat/services/gemini_multimodal_live/gemini.py b/src/pipecat/services/gemini_multimodal_live/gemini.py index 1d76f191c..82959e24f 100644 --- a/src/pipecat/services/gemini_multimodal_live/gemini.py +++ b/src/pipecat/services/gemini_multimodal_live/gemini.py @@ -336,6 +336,8 @@ class GeminiMultimodalLiveLLMService(LLMService): # 2. The last message is a tool call result if not self._context: self._context = context + if frame.context.tools: + self._tools = frame.context.tools await self._create_initial_response() elif context.messages and context.messages[-1].get("role") == "tool": # Support just one tool call per context frame for now @@ -417,6 +419,7 @@ class GeminiMultimodalLiveLLMService(LLMService): parts=[events.ContentPart(text=system_instruction)] ) if self._tools: + logger.debug(f"Gemini is configuring to use tools{self._tools}") config.setup.tools = self._tools await self.send_client_event(config)