Skip to content

messages

Class info

Classes

Name Children Inherits
AgentMessage
aclientp.schema.v2.messages
An agent message upsert, in addition to or instead of streamed chunks.
    AgentMessageChunk
    aclientp.schema.v2.messages
    A chunk of the agent's response being streamed.
      AgentThought
      aclientp.schema.v2.messages
      An agent thought (reasoning) message upsert.
        AgentThoughtChunk
        aclientp.schema.v2.messages
        A chunk of the agent's internal reasoning being streamed.
          SessionMessage
          aclientp.schema.v2.messages
          An upsert of a message sent to or received from another session.
            SessionMessageChunk
            aclientp.schema.v2.messages
            A content block appended to a session message.
              UserMessage
              aclientp.schema.v2.messages
              A user message upsert, e.g. when the agent accepts or replaces a prompt.
                UserMessageChunk
                aclientp.schema.v2.messages
                A chunk of the user's message being streamed.

                  🛈 DocStrings

                  v2 message updates: streamed chunks and whole-message upserts.

                  Every chunk carries the messageId of its message. Message upserts are keyed by messageId; their content replaces the message content (omitted leaves it unchanged, None clears it), while chunks append to it.

                  AgentMessage

                  Bases: _MessageUpsert

                  An agent message upsert, in addition to or instead of streamed chunks.

                  Source code in src/aclientp/schema/v2/messages.py
                  class AgentMessage(_MessageUpsert):
                      """An agent message upsert, in addition to or instead of streamed chunks."""
                  
                      session_update: Literal["agent_message"] = Field(default="agent_message", init=False)
                  

                  AgentMessageChunk

                  Bases: _Chunk

                  A chunk of the agent's response being streamed.

                  Source code in src/aclientp/schema/v2/messages.py
                  class AgentMessageChunk(_Chunk):
                      """A chunk of the agent's response being streamed."""
                  
                      session_update: Literal["agent_message_chunk"] = Field(
                          default="agent_message_chunk", init=False
                      )
                  

                  AgentThought

                  Bases: _MessageUpsert

                  An agent thought (reasoning) message upsert.

                  Source code in src/aclientp/schema/v2/messages.py
                  class AgentThought(_MessageUpsert):
                      """An agent thought (reasoning) message upsert."""
                  
                      session_update: Literal["agent_thought"] = Field(default="agent_thought", init=False)
                  

                  AgentThoughtChunk

                  Bases: _Chunk

                  A chunk of the agent's internal reasoning being streamed.

                  Source code in src/aclientp/schema/v2/messages.py
                  class AgentThoughtChunk(_Chunk):
                      """A chunk of the agent's internal reasoning being streamed."""
                  
                      session_update: Literal["agent_thought_chunk"] = Field(
                          default="agent_thought_chunk", init=False
                      )
                  

                  SessionMessage

                  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.

                  SessionMessageChunk

                  Bases: AnnotatedObject

                  A content block appended to a session message.

                  Participants and references come from session_message upserts.

                  Source code in src/aclientp/schema/v2/messages.py
                  class SessionMessageChunk(AnnotatedObject):
                      """A content block appended to a session message.
                  
                      Participants and references come from ``session_message`` upserts.
                      """
                  
                      session_update: Literal["session_message_chunk"] = Field(
                          default="session_message_chunk", init=False
                      )
                  
                      message_id: MessageId
                      """Identifier of the message in this session's transcript."""
                  
                      content: ContentBlock
                      """The appended content block."""
                  

                  content instance-attribute

                  content: ContentBlock
                  

                  The appended content block.

                  message_id instance-attribute

                  message_id: MessageId
                  

                  Identifier of the message in this session's transcript.

                  UserMessage

                  Bases: _MessageUpsert

                  A user message upsert, e.g. when the agent accepts or replaces a prompt.

                  Source code in src/aclientp/schema/v2/messages.py
                  class UserMessage(_MessageUpsert):
                      """A user message upsert, e.g. when the agent accepts or replaces a prompt."""
                  
                      session_update: Literal["user_message"] = Field(default="user_message", init=False)
                  

                  UserMessageChunk

                  Bases: _Chunk

                  A chunk of the user's message being streamed.

                  Source code in src/aclientp/schema/v2/messages.py
                  class UserMessageChunk(_Chunk):
                      """A chunk of the user's message being streamed."""
                  
                      session_update: Literal["user_message_chunk"] = Field(default="user_message_chunk", init=False)