Whoops - fix a bug in GeminiLiveLLMService where we weren't checking if a tool call result was already handled before reporting it to the LLM

This commit is contained in:
Paul Kompfner
2025-10-29 12:44:00 -04:00
parent 615aae5b95
commit 65c17a698e

View File

@@ -984,9 +984,10 @@ class GeminiLiveLLMService(LLMService):
if message.parts: if message.parts:
for part in message.parts: for part in message.parts:
if part.function_response: if part.function_response:
# Found a newly-completed function call - send the result to the service
tool_call_id = part.function_response.id tool_call_id = part.function_response.id
tool_name = part.function_response.name tool_name = part.function_response.name
if tool_call_id and tool_call_id not in self._completed_tool_calls:
# Found a newly-completed function call - send the result to the service
if send_new_results: if send_new_results:
await self._tool_result( await self._tool_result(
tool_call_id, tool_name, part.function_response.response tool_call_id, tool_name, part.function_response.response