From 487bb9f90e64ef3c770bce4d4280a261efd167c7 Mon Sep 17 00:00:00 2001 From: cpacker Date: Sun, 22 Dec 2024 18:15:11 -0800 Subject: [PATCH] fix: updated hotfix to only regress on specific letta free endpoint, otherwise use required --- letta/llm_api/llm_api_tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/letta/llm_api/llm_api_tools.py b/letta/llm_api/llm_api_tools.py index f3bf05f9ef..d2c76d55cd 100644 --- a/letta/llm_api/llm_api_tools.py +++ b/letta/llm_api/llm_api_tools.py @@ -156,7 +156,10 @@ def create( if function_call is None: # force function calling for reliability, see https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice # TODO(matt) move into LLMConfig - function_call = "auto" # TODO change to "required" once proxy supports it + if llm_config.model_endpoint == "https://inference.memgpt.ai": + function_call = "auto" # TODO change to "required" once proxy supports it + else: + function_call = "required" data = build_openai_chat_completions_request(llm_config, messages, user_id, functions, function_call, use_tool_naming, max_tokens) if stream: # Client requested token streaming