Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Master #4073

Closed
wants to merge 3 commits into from
Closed

Master #4073

Changes from all commits
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
15 changes: 10 additions & 5 deletions autogpt/memory_management/summary_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ def update_running_summary(
if event["role"].lower() == "assistant":
event["role"] = "you"

# Remove "thoughts" dictionary from "content"
content_dict = json.loads(event["content"])
if "thoughts" in content_dict:
del content_dict["thoughts"]
event["content"] = json.dumps(content_dict)
# Remove "thoughts" dictionary from "content"
if event.get("content"):
try:
content_dict = json.loads(event["content"])
except json.JSONDecodeError:
print(f"Error: Invalid JSON string in event['content']: {event['content']}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change the print to a debug log.

else:
if "thoughts" in content_dict:
del content_dict["thoughts"]
event["content"] = json.dumps(content_dict)

elif event["role"].lower() == "system":
event["role"] = "your computer"
Expand Down