A programming framework for agentic AI
Add metadata field to basemessage (#5372)
Hussein Mozannar4dac9c819e0d
diff --git a/python/packages/autogen-agentchat/src/autogen_agentchat/messages.py b/python/packages/autogen-agentchat/src/autogen_agentchat/messages.pyindex a4a962b62..89500a50e 100644--- a/python/packages/autogen-agentchat/src/autogen_agentchat/messages.py+++ b/python/packages/autogen-agentchat/src/autogen_agentchat/messages.py@@ -5,7 +5,7 @@ class and includes specific fields relevant to the type of message being sent."""from abc import ABC-from typing import List, Literal+from typing import Dict, List, Literalfrom autogen_core import FunctionCall, Imagefrom autogen_core.memory import MemoryContent@@ -23,6 +23,9 @@ class BaseMessage(BaseModel, ABC):models_usage: RequestUsage | None = None"""The model client usage incurred when producing this message."""+ metadata: Dict[str, str] = {}+ """Additional metadata about the message."""+model_config = ConfigDict(arbitrary_types_allowed=True)