Skip to content

MessageEntry

🛈 DocStrings

A user message, an agent message or an agent thought.

Source code in src/acptui/protocol/state.py
@dataclass(eq=False)
class MessageEntry:
    """A user message, an agent message or an agent thought."""

    role: MessageRole
    message_id: str | None
    """``None`` for a user message not yet acknowledged by the agent."""

    blocks: list[ContentBlock] = field(default_factory=list)
    sender_session_id: str | None = None
    """For ``session`` messages: the sending session."""
    recipient_session_id: str | None = None
    """For ``session`` messages: the receiving session."""

    @property
    def text(self) -> str:
        """The message text."""
        return blocks_text(self.blocks)

message_id instance-attribute

message_id: str | None

None for a user message not yet acknowledged by the agent.

recipient_session_id class-attribute instance-attribute

recipient_session_id: str | None = None

For session messages: the receiving session.

sender_session_id class-attribute instance-attribute

sender_session_id: str | None = None

For session messages: the sending session.

text property

text: str

The message text.

:fa-brands-github: Show source on GitHub