From decea1e18fd9da7e672fdbc667d0cf731d29b730 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Sun, 11 Feb 2024 18:47:55 -0800 Subject: [PATCH] fix: allow multiple tools to be called by LLM and rewrite request (#992) --- memgpt/agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/memgpt/agent.py b/memgpt/agent.py index e1caefd8..c3cff1ff 100644 --- a/memgpt/agent.py +++ b/memgpt/agent.py @@ -370,7 +370,10 @@ class Agent(object): if response_message.function_call: raise DeprecationWarning(response_message) if response_message.tool_calls is not None and len(response_message.tool_calls) > 1: - raise NotImplementedError(f">1 tool call not supported") + # raise NotImplementedError(f">1 tool call not supported") + # TODO eventually support sequential tool calling + printd(f">1 tool call not supported, using index=0 only\n{response_message.tool_calls}") + response_message.tool_calls = [response_message.tool_calls[0]] assert response_message.tool_calls is not None and len(response_message.tool_calls) > 0 # The content if then internal monologue, not chat