Skip to content

SessionMessage

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.v2.base
A v2 object with the ``_meta`` extension point.

⋔ Inheritance diagram

graph TD
  95970870281200["messages.SessionMessage"]
  95970868359040["base.AnnotatedObject"]
  95970855946400["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970868359040 --> 95970870281200
  95970855946400 --> 95970868359040
  95970851503232 --> 95970855946400
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

An upsert of a message sent to or received from another session.

Every field but message_id is a patch: omitted leaves it unchanged, None clears it, a value replaces it.

Source code in src/aclientp/schema/v2/messages.py
class SessionMessage(AnnotatedObject):
    """An upsert of a message sent to or received from another session.

    Every field but ``message_id`` is a patch: omitted leaves it unchanged, ``None``
    clears it, a value replaces it.
    """

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

    message_id: MessageId
    """Identifier of the message in this session's transcript."""

    sender_session_id: SessionId | MISSING | None = MISSING
    """The sending session."""

    recipient_session_id: SessionId | MISSING | None = MISSING
    """The receiving session."""

    sender_message_id: MessageId | MISSING | None = MISSING
    """On an incoming view: the ``messageId`` of the outgoing view in the sender's transcript."""

    recipient_message_id: MessageId | MISSING | None = MISSING
    """On an outgoing view: the ``messageId`` of the incoming view in the recipient's
    transcript."""

    content: Sequence[ContentBlock] | MISSING | None = MISSING
    """Complete replacement content."""

content class-attribute instance-attribute

content: Sequence[ContentBlock] | MISSING | None = MISSING

Complete replacement content.

message_id instance-attribute

message_id: MessageId

Identifier of the message in this session's transcript.

recipient_message_id class-attribute instance-attribute

recipient_message_id: MessageId | MISSING | None = MISSING

On an outgoing view: the messageId of the incoming view in the recipient's transcript.

recipient_session_id class-attribute instance-attribute

recipient_session_id: SessionId | MISSING | None = MISSING

The receiving session.

sender_message_id class-attribute instance-attribute

sender_message_id: MessageId | MISSING | None = MISSING

On an incoming view: the messageId of the outgoing view in the sender's transcript.

sender_session_id class-attribute instance-attribute

sender_session_id: SessionId | MISSING | None = MISSING

The sending session.

:fa-brands-github: Show source on GitHub