Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix runtime error

cpacker94ca0d0bf360
diff --git a/memgpt/autogen/memgpt_agent.py b/memgpt/autogen/memgpt_agent.py
index 91adf5d8b..78502c1e1 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)