File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -48,27 +48,28 @@ import ulid
4848from datetime import datetime, UTC
4949
5050# Store conversation messages for context continuity
51- # IMPORTANT: Always provide created_at timestamps for accurate message ordering
51+ # IMPORTANT: Provide created_at timestamps that reflect actual message creation times
52+ # In real usage, each message would have its own timestamp from when it was created
5253working_memory = WorkingMemory(
5354 session_id = " chat_123" ,
5455 messages = [
5556 MemoryMessage(
5657 role = " user" ,
5758 content = " I'm planning a trip to Paris next month" ,
5859 id = ulid.ULID(),
59- created_at = datetime.now( UTC ) # Provide timestamp
60+ created_at = datetime.fromisoformat( " 2024-01-15T10:30:00+00:00 " )
6061 ),
6162 MemoryMessage(
6263 role = " assistant" ,
6364 content = " That sounds exciting! What type of activities are you interested in?" ,
6465 id = ulid.ULID(),
65- created_at = datetime.now( UTC )
66+ created_at = datetime.fromisoformat( " 2024-01-15T10:30:05+00:00 " )
6667 ),
6768 MemoryMessage(
6869 role = " user" ,
6970 content = " I love museums and good food" ,
7071 id = ulid.ULID(),
71- created_at = datetime.now( UTC )
72+ created_at = datetime.fromisoformat( " 2024-01-15T10:30:30+00:00 " )
7273 )
7374 ]
7475)
You can’t perform that action at this time.
0 commit comments