Skip to content

Commit

Permalink
Fixing GeminiMultimodalLiveLLMService function calling when using wit…
Browse files Browse the repository at this point in the history
…h pipecat-flows.
  • Loading branch information
filipi87 committed Jan 9, 2025
1 parent 39c6446 commit 58bfcc8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pipecat/services/gemini_multimodal_live/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ async def process_frame(self, frame: Frame, direction: FrameDirection):
# 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
Expand Down Expand Up @@ -417,6 +419,7 @@ async def _connect(self):
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)

Expand Down

0 comments on commit 58bfcc8

Please sign in to comment.