Skip to content

Commit

Permalink
Optimize code format of record func
Browse files Browse the repository at this point in the history
  • Loading branch information
raywhoelse committed Feb 14, 2025
1 parent 0b8a132 commit 4c58f3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion camel/benchmarks/nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def run( # type: ignore[override, return]
try:
# Generate response
response = agent.step(prompt)
agent_call = response.msgs[0].content
agent_call = response.msgs[0].content.text

# Evaluate response
if agent_call:
Expand Down
8 changes: 4 additions & 4 deletions camel/memories/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ def from_dict(cls, record_dict: Dict[str, Any]) -> "MemoryRecord":
"""
message_data = record_dict["message"]
message_class = message_data.get('__class__')

# Extract common data
role_name = message_data['role_name']
role_type = message_data['role_type']
content_data = message_data['content']

# Determine content type
if 'image_list' in content_data and content_data['image_list']:
if content_data.get('image_list'):
content = Content.from_dict(content_data)
elif 'video_bytes' in content_data and content_data['video_bytes']:
elif content_data.get('video_bytes'):
content = Content.from_dict(content_data)
else:
content = Content(text=content_data)
Expand Down

0 comments on commit 4c58f3b

Please sign in to comment.