From 79ffadaee110dc906ae5ebddbaa9372f20d186da Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Fri, 11 Apr 2025 21:24:53 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20patch=20key=20error=20(unclear=20if=20we?= =?UTF-8?q?=20should=20fatally=20error=20here,=20or=20jus=E2=80=A6=20(#169?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- letta/llm_api/google_ai_client.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/letta/llm_api/google_ai_client.py b/letta/llm_api/google_ai_client.py index c927ed3f..5f1b95d0 100644 --- a/letta/llm_api/google_ai_client.py +++ b/letta/llm_api/google_ai_client.py @@ -318,17 +318,16 @@ class GoogleAIClient(LLMClientBase): for t in tools ] - # Correct casing + add inner thoughts if needed + # Add inner thoughts if needed for func in function_list: - func["parameters"]["type"] = "OBJECT" - for param_name, param_fields in func["parameters"]["properties"].items(): - param_fields["type"] = param_fields["type"].upper() + # Note: Google AI API used to have weird casing requirements, but not any more + # Add inner thoughts if self.llm_config.put_inner_thoughts_in_kwargs: from letta.local_llm.constants import INNER_THOUGHTS_KWARG, INNER_THOUGHTS_KWARG_DESCRIPTION func["parameters"]["properties"][INNER_THOUGHTS_KWARG] = { - "type": "STRING", + "type": "string", "description": INNER_THOUGHTS_KWARG_DESCRIPTION, } func["parameters"]["required"].append(INNER_THOUGHTS_KWARG)