Skip to content

Commit

Permalink
Update openhands/events/serialization/event.py
Browse files Browse the repository at this point in the history
Co-authored-by: Engel Nyst <[email protected]>
  • Loading branch information
xingyaoww and enyst authored Dec 29, 2024
1 parent 1066544 commit 71029ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openhands/events/serialization/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def event_to_dict(event: 'Event') -> dict:
d['timeout'] = event.timeout
elif 'observation' in d:
d['content'] = props.pop('content', '')

# props is a dict whose values can include a complex object like an instance of a BaseModel subclass
# such as CmdOutputMetadata
# we serialize it along with the rest
d['extras'] = {k: _convert_pydantic_to_dict(v) for k, v in props.items()}
# Include success field for CmdOutputObservation
if hasattr(event, 'success'):
Expand Down

0 comments on commit 71029ad

Please sign in to comment.