Message#

Choose message roles and distinguish model input from stored history. See the guide.

class zett_agent.messages.Message(*, attributes=<factory>, persist=True, include_in_messages=True)[源代码]#

Common base for user, internal agent, assistant, system, and tool roles.

attributes carries application-owned information attached to one message. Provider adapters ignore it unless they explicitly document another mapping. persist controls whether Raw Log subscribers should store the message. include_in_messages controls whether persisted history is restored into AgentState.messages and therefore sent on later model requests.

备注

Request-level metadata and tags live on AgentRunContext and are persisted beside Raw Log records. They are intentionally different from per-message attributes.

参见

RawMessageRecord is the persisted message envelope.

参数:
  • attributes (dict[str, Any])

  • persist (bool)

  • include_in_messages (bool)

attributes: dict[str, Any]#

Application-owned per-message information. Provider adapters do not send these values to model APIs unless an adapter explicitly defines a mapping.

persist: bool#

Whether the runtime's persistence subscribers should store this message.

include_in_messages: bool#

Whether restored history should include this message in model context.