Skip to content

Commit

Permalink
Convert to iso format after creating a dict of the whole memory (#1174)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
	- Enhanced event data handling with ISO format strings for dates.
- Introduced new classes for managing workflow-related memory sources
and their creation.

- **Bug Fixes**
	- Improved serialization of event data within the Memory model.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
beastoin authored Oct 25, 2024
2 parents 5982d6e + 6187a41 commit 803601b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/models/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def get_transcript(self, include_timestamps: bool) -> str:
return TranscriptSegment.segments_as_string(self.transcript_segments, include_timestamps=include_timestamps)

def as_dict_cleaned_dates(self):
self.structured.events = [event.as_dict_cleaned_dates() for event in self.structured.events]
memory_dict = self.dict()
memory_dict['structured']['events'] = [event['start'].isoformat() for event in memory_dict['structured']['events']]
memory_dict['created_at'] = memory_dict['created_at'].isoformat()
memory_dict['started_at'] = memory_dict['started_at'].isoformat() if memory_dict['started_at'] else None
memory_dict['finished_at'] = memory_dict['finished_at'].isoformat() if memory_dict['finished_at'] else None
Expand Down

0 comments on commit 803601b

Please sign in to comment.