From 94ca0d0bf36081dc00d3ce73165ca1525fce8d89 Mon Sep 17 00:00:00 2001 From: cpacker Date: Thu, 26 Oct 2023 15:23:31 -0700 Subject: [PATCH] fix runtime error --- memgpt/autogen/memgpt_agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memgpt/autogen/memgpt_agent.py b/memgpt/autogen/memgpt_agent.py index 91adf5d8..78502c1e 100644 --- a/memgpt/autogen/memgpt_agent.py +++ b/memgpt/autogen/memgpt_agent.py @@ -144,8 +144,10 @@ class MemGPTAgent(ConversableAgent): # Extend the MemGPT message list with multiple 'user' messages, then push the last one with agent.step() self.agent.messages.extend(new_messages[:-1]) user_message = new_messages[-1] - else: + elif len(new_messages) == 1: user_message = new_messages[0] + else: + return True, None # Package the user message user_message = system.package_user_message(user_message)