From 75245e1daab939a64f27aed2f19968f4683692d8 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Tue, 4 Nov 2025 10:26:56 -0500 Subject: [PATCH] Fix a bug in `GeminiLiveLLMService` where in some circumstances it wouldn't respond after a tool call --- CHANGELOG.md | 3 +++ src/pipecat/services/google/gemini_live/llm.py | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a9f56f0..63a3d5932 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,9 @@ reason")`. arbitrary request data from client due to camelCase typing. This fixes data passthrough for JS clients where `APIRequest` is used. +- Fixed a bug in `GeminiLiveLLMService` where in some circumstances it wouldn't + respond after a tool call. + - Fixed `GeminiLiveLLMService` session resumption after a connection timeout. - `GeminiLiveLLMService` now properly supports context-provided system diff --git a/src/pipecat/services/google/gemini_live/llm.py b/src/pipecat/services/google/gemini_live/llm.py index 56d81e12b..c7e4827df 100644 --- a/src/pipecat/services/google/gemini_live/llm.py +++ b/src/pipecat/services/google/gemini_live/llm.py @@ -13,8 +13,6 @@ voice transcription, streaming responses, and tool usage. import base64 import io -import json -import random import time import uuid import warnings @@ -1012,7 +1010,13 @@ class GeminiLiveLLMService(LLMService): if part.function_response: tool_call_id = part.function_response.id tool_name = part.function_response.name - if tool_call_id and tool_call_id not in self._completed_tool_calls: + response = part.function_response.response + if ( + tool_call_id + and tool_call_id not in self._completed_tool_calls + and response + and response.get("value") != "IN_PROGRESS" + ): # Found a newly-completed function call - send the result to the service if send_new_results: await self._tool_result(