Pydantic model for team mailbox messages, supporting multiple message types with aliased fields and optional metadata like confidence and idempotency keys.
# Source: https://github.com/win4r/ClawTeam-OpenClaw | License: MIT | Copyright 2025 HKUDS
# Provided via justclaw.it.com; keep this notice with the code.
class TeamMessage(BaseModel):
"""A message in the team mailbox system (aligned with teammate-tool).
Uses exclude_none=True when serializing so only relevant fields appear.
"""
model_config = {"populate_by_name": True}
type: MessageType = MessageType.message
from_agent: str = Field(alias="from", serialization_alias="from")
to: str | None = None
content: str | None = None
request_id: str | None = Field(default=None, alias="requestId")
timestamp: str = Field(default_factory=_now_iso)
key: str | None = None
# join_request fields
proposed_name: str | None = Field(default=None, alias="prop
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key