Skip to content

Commit db0db08

Browse files
committed
Fix datetime.UTC import for Python 3.10/3.11 compatibility
Replace datetime.UTC with timezone.utc for compatibility with Python versions before 3.11. Fixes mypy type checking errors in Agent Memory Client CI.
1 parent 163023c commit db0db08

File tree

1 file changed

+2
-2
lines changed
  • agent-memory-client/agent_memory_client

1 file changed

+2
-2
lines changed

agent-memory-client/agent_memory_client/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
For full model definitions, see the main agent_memory_server package.
66
"""
77

8-
from datetime import UTC, datetime, timezone
8+
from datetime import datetime, timezone
99
from enum import Enum
1010
from typing import Any, Literal
1111

@@ -58,7 +58,7 @@ class MemoryMessage(BaseModel):
5858
description="Unique identifier for the message (auto-generated)",
5959
)
6060
created_at: datetime = Field(
61-
default_factory=lambda: datetime.now(UTC),
61+
default_factory=lambda: datetime.now(timezone.utc),
6262
description="Timestamp when the message was created",
6363
)
6464
persisted_at: datetime | None = Field(

0 commit comments

Comments
 (0)