Merge pull request #84 from cpacker/fix-pop

change pop, since agent.messages is locked
This commit is contained in:
Charles Packer
2023-10-21 16:59:15 -07:00
committed by GitHub

View File

@@ -269,7 +269,8 @@ async def main():
command = user_input.strip().split()
amount = int(command[1]) if len(command) > 1 and command[1].isdigit() else 2
print(f"Popping last {amount} messages from stack")
memgpt_agent.messages = memgpt_agent.messages[:-amount]
for _ in range(min(amount, len(memgpt_agent.messages))):
memgpt_agent.messages.pop()
continue
# No skip options