From ebb3d1cfd386d4adb6878516d016e193d53d51d7 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Tue, 27 May 2025 11:06:08 -0400 Subject: [PATCH] fix: Update GoogleLLMContext to_standard_messages to be compatible with google-genai --- src/pipecat/services/google/llm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pipecat/services/google/llm.py b/src/pipecat/services/google/llm.py index d13dd546d..5efbbe8c0 100644 --- a/src/pipecat/services/google/llm.py +++ b/src/pipecat/services/google/llm.py @@ -367,7 +367,7 @@ class GoogleLLMContext(OpenAILLMContext): } ) elif part.function_call: - args = type(part.function_call).to_dict(part.function_call).get("args", {}) + args = part.function_call.args if hasattr(part.function_call, "args") else {} msg["tool_calls"] = [ { "id": part.function_call.name, @@ -382,7 +382,9 @@ class GoogleLLMContext(OpenAILLMContext): elif part.function_response: msg["role"] = "tool" resp = ( - type(part.function_response).to_dict(part.function_response).get("response", {}) + part.function_response.response + if hasattr(part.function_response, "response") + else {} ) msg["tool_call_id"] = part.function_response.name msg["content"] = json.dumps(resp)