From 8c98952b43487ddf78ab7e44f1ab5b02881ef5d6 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Mon, 24 Mar 2025 21:57:32 -0700 Subject: [PATCH] fix: patch summarizer bug for Anthropic (#1389) --- letta/llm_api/llm_api_tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/letta/llm_api/llm_api_tools.py b/letta/llm_api/llm_api_tools.py index 90b2838d..82d0aea6 100644 --- a/letta/llm_api/llm_api_tools.py +++ b/letta/llm_api/llm_api_tools.py @@ -372,7 +372,11 @@ def create( # Force tool calling tool_call = None - if force_tool_call is not None: + if functions is None: + # Special case for summarization path + tools = None + tool_choice = None + elif force_tool_call is not None: # tool_call = {"type": "function", "function": {"name": force_tool_call}} tool_choice = {"type": "tool", "name": force_tool_call} tools = [{"type": "function", "function": f} for f in functions if f["name"] == force_tool_call]