Skip to content

SessionMessage

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.base
Base class for generated models.

⋔ Inheritance diagram

graph TD
  95970861572080["session_updates.SessionMessage"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970862258240 --> 95970861572080
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

UNSTABLE: A message exchanged between sessions (e.g. parent and subagent).

Upserts by message_id: omitted fields are left unchanged, None clears them.

Source code in src/aclientp/schema/session_updates.py
class SessionMessage(AnnotatedObject):
    """**UNSTABLE**: A message exchanged between sessions (e.g. parent and subagent).

    Upserts by ``message_id``: omitted fields are left unchanged, ``None`` clears them.
    """

    session_update: Literal["session_message"] = Field(default="session_message", init=False)

    message_id: str
    """Identifier of this message within the enclosing session's transcript."""

    sender_session_id: str | None = None
    """The sending session."""

    recipient_session_id: str | None = None
    """The receiving session."""

    sender_message_id: str | None = None
    """On an incoming view, the ``message_id`` of the outgoing view in the sender's transcript."""

    recipient_message_id: str | None = None
    """On an outgoing view, the ``message_id`` of the incoming view in the recipient."""

    content: Sequence[ContentBlock] | None = None
    """Replaces all content when non-empty. ``None`` or ``[]`` clears it."""

content class-attribute instance-attribute

content: Sequence[ContentBlock] | None = None

Replaces all content when non-empty. None or [] clears it.

message_id instance-attribute

message_id: str

Identifier of this message within the enclosing session's transcript.

recipient_message_id class-attribute instance-attribute

recipient_message_id: str | None = None

On an outgoing view, the message_id of the incoming view in the recipient.

recipient_session_id class-attribute instance-attribute

recipient_session_id: str | None = None

The receiving session.

sender_message_id class-attribute instance-attribute

sender_message_id: str | None = None

On an incoming view, the message_id of the outgoing view in the sender's transcript.

sender_session_id class-attribute instance-attribute

sender_session_id: str | None = None

The sending session.

:fa-brands-github: Show source on GitHub