A programming framework for agentic AI
Fix mutable default in ListMemoryConfig (#6729)
S. M. Mohiuddin Khan Shiam2b873a483b3a
diff --git a/python/packages/autogen-core/src/autogen_core/memory/_list_memory.py b/python/packages/autogen-core/src/autogen_core/memory/_list_memory.pyindex 5ad086550..9dd1182c7 100644--- a/python/packages/autogen-core/src/autogen_core/memory/_list_memory.py+++ b/python/packages/autogen-core/src/autogen_core/memory/_list_memory.py@@ -1,6 +1,6 @@from typing import Any, List-from pydantic import BaseModel+from pydantic import BaseModel, Fieldfrom typing_extensions import Selffrom .._cancellation_token import CancellationToken@@ -15,7 +15,7 @@ class ListMemoryConfig(BaseModel):name: str | None = None"""Optional identifier for this memory instance."""- memory_contents: List[MemoryContent] = []+ memory_contents: List[MemoryContent] = Field(default_factory=list)"""List of memory contents stored in this memory instance."""