Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix runtime error in AutoGen agent #143

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion memgpt/autogen/memgpt_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ async def _a_generate_reply_for_user_message(
# 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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is None a safe early exit object to return here?

the expected type AFAIK is a message, eg

{
  "role": "assistant",
  "content": "assistant's message"
}


# Package the user message
user_message = system.package_user_message(user_message)
Expand Down