archastro.platform.types.chat

  1# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
  2# This file is auto-generated by @archastro/sdk-generator. Do not edit.
  3# Content hash: f613af40aca8
  4
  5
  6from pydantic import BaseModel, Field
  7
  8from .common import Agent, Message
  9from .teams import Team
 10from .threads import Thread
 11from .users import User
 12
 13
 14class ChatMember(BaseModel):
 15    """
 16    A participant in a chat thread, which may be either a human user or an AI agent. Exactly one of `user` or `agent` is populated depending on `type`.
 17    """
 18
 19    agent: Agent | None = Field(
 20        default=None,
 21        description='Full agent object for this member. Populated when `type` is `"agent"`; `null` for user members.',
 22    )
 23    membership_type: str | None = Field(
 24        default=None,
 25        description='Role of this member within the thread. Common values are `"owner"` and `"member"`. `null` when the membership type is not applicable.',
 26    )
 27    type: str = Field(
 28        ...,
 29        description='Kind of participant. One of `"user"` (a human user) or `"agent"` (an AI agent).',
 30    )
 31    user: User | None = Field(
 32        default=None,
 33        description='Full user object for this member. Populated when `type` is `"user"`; `null` for agent members.',
 34    )
 35
 36
 37class ChatRoomModel(BaseModel):
 38    """
 39    A point-in-time snapshot of a chat room's state, including its loaded messages, member roster, and pagination cursors. Returned when loading or refreshing a thread's message list.
 40    """
 41
 42    after_cursor: str | None = Field(
 43        default=None,
 44        description="Opaque cursor to pass when fetching messages newer than those in this snapshot. `null` when this snapshot already reflects the latest messages.",
 45    )
 46    agent: Agent | None = Field(
 47        default=None,
 48        description="The agent associated with this chat room. `null` when no agent is attached.",
 49    )
 50    before_cursor: str | None = Field(
 51        default=None,
 52        description="Opaque cursor to pass when fetching messages older than those in this snapshot. `null` when the beginning of the thread history has been reached.",
 53    )
 54    is_transient: bool = Field(
 55        ...,
 56        description="Whether this thread is ephemeral. Transient threads are not retained in long-term storage and may be deleted when the session ends.",
 57    )
 58    members: list[ChatMember] = Field(
 59        ...,
 60        description="All active members of the chat room, including both human users and agents.",
 61    )
 62    messages: list[Message] = Field(
 63        ...,
 64        description="The page of messages currently loaded for the thread, ordered chronologically. Use `before_cursor` or `after_cursor` to page through additional history.",
 65    )
 66    messages_loaded_on_last_update: int | None = Field(
 67        default=None,
 68        description="Number of messages that were added to the snapshot in the most recent incremental update. `null` on the initial load.",
 69    )
 70    team: Team | None = Field(
 71        default=None,
 72        description="The team that owns this thread. `null` for threads scoped to an individual user rather than a team.",
 73    )
 74    thread: Thread = Field(
 75        ...,
 76        description="The parent thread whose message history and membership this snapshot represents.",
 77    )
 78
 79
 80class ChatForkThreadResponse(BaseModel):
 81    """
 82    Response returned after forking a chat thread. Contains the new thread, its initial chat-room snapshot, and the owning team when applicable.
 83    """
 84
 85    chat_model: ChatRoomModel | None = Field(
 86        default=None,
 87        description="Initial chat-room render snapshot for the forked thread, including members and loaded messages. `null` for transient threads whose room model is suppressed.",
 88    )
 89    team: Team | None = Field(
 90        default=None,
 91        description="Team that owns the forked thread. Present only when the original thread was team-scoped; `null` for personal threads.",
 92    )
 93    thread: Thread = Field(
 94        ..., description="The newly-created thread produced by the fork operation."
 95    )
 96
 97
 98class ChatLoadMoreMessagesResponse(BaseModel):
 99    """
100    Response returned after loading an additional page of chat messages. Contains a refreshed chat-room snapshot with the newly-fetched messages merged in.
101    """
102
103    data: ChatRoomModel = Field(
104        ...,
105        description="Updated chat-room snapshot for the thread, incorporating the newly-loaded page of messages alongside any previously loaded messages.",
106    )
107
108
109class ChatMarkThreadReadResponse(BaseModel):
110    """
111    Response returned after marking a chat thread as read. Confirms that the read marker was successfully recorded for the authenticated user.
112    """
113
114    success: bool = Field(
115        ...,
116        description="Indicates whether the read marker was successfully applied. Always `true` on success; errors are returned as channel error replies rather than a `false` value here.",
117    )
118
119
120class ChatMessageListResponse(BaseModel):
121    """
122    Response returned when listing the messages of a joined chat thread. Contains the set of messages currently loaded for the thread.
123    """
124
125    messages: list[Message] = Field(
126        ...,
127        description="Ordered array of message objects currently loaded for the thread, from oldest to newest. Use the `load_more_messages` channel message to fetch earlier pages.",
128    )
129
130
131class ChatPostMessageResponse(BaseModel):
132    """
133    Response returned after successfully posting a message to a chat thread. Contains the persisted message object echoed back to the sender.
134    """
135
136    message: Message = Field(
137        ...,
138        description="The message that was created and stored. Contains the full message object including its assigned ID, author, content, and timestamps.",
139    )
class ChatMember(pydantic.main.BaseModel):
15class ChatMember(BaseModel):
16    """
17    A participant in a chat thread, which may be either a human user or an AI agent. Exactly one of `user` or `agent` is populated depending on `type`.
18    """
19
20    agent: Agent | None = Field(
21        default=None,
22        description='Full agent object for this member. Populated when `type` is `"agent"`; `null` for user members.',
23    )
24    membership_type: str | None = Field(
25        default=None,
26        description='Role of this member within the thread. Common values are `"owner"` and `"member"`. `null` when the membership type is not applicable.',
27    )
28    type: str = Field(
29        ...,
30        description='Kind of participant. One of `"user"` (a human user) or `"agent"` (an AI agent).',
31    )
32    user: User | None = Field(
33        default=None,
34        description='Full user object for this member. Populated when `type` is `"user"`; `null` for agent members.',
35    )

A participant in a chat thread, which may be either a human user or an AI agent. Exactly one of user or agent is populated depending on type.

Full agent object for this member. Populated when type is "agent"; null for user members.

membership_type: str | None = None

Role of this member within the thread. Common values are "owner" and "member". null when the membership type is not applicable.

type: str = PydanticUndefined

Kind of participant. One of "user" (a human user) or "agent" (an AI agent).

Full user object for this member. Populated when type is "user"; null for agent members.

class ChatRoomModel(pydantic.main.BaseModel):
38class ChatRoomModel(BaseModel):
39    """
40    A point-in-time snapshot of a chat room's state, including its loaded messages, member roster, and pagination cursors. Returned when loading or refreshing a thread's message list.
41    """
42
43    after_cursor: str | None = Field(
44        default=None,
45        description="Opaque cursor to pass when fetching messages newer than those in this snapshot. `null` when this snapshot already reflects the latest messages.",
46    )
47    agent: Agent | None = Field(
48        default=None,
49        description="The agent associated with this chat room. `null` when no agent is attached.",
50    )
51    before_cursor: str | None = Field(
52        default=None,
53        description="Opaque cursor to pass when fetching messages older than those in this snapshot. `null` when the beginning of the thread history has been reached.",
54    )
55    is_transient: bool = Field(
56        ...,
57        description="Whether this thread is ephemeral. Transient threads are not retained in long-term storage and may be deleted when the session ends.",
58    )
59    members: list[ChatMember] = Field(
60        ...,
61        description="All active members of the chat room, including both human users and agents.",
62    )
63    messages: list[Message] = Field(
64        ...,
65        description="The page of messages currently loaded for the thread, ordered chronologically. Use `before_cursor` or `after_cursor` to page through additional history.",
66    )
67    messages_loaded_on_last_update: int | None = Field(
68        default=None,
69        description="Number of messages that were added to the snapshot in the most recent incremental update. `null` on the initial load.",
70    )
71    team: Team | None = Field(
72        default=None,
73        description="The team that owns this thread. `null` for threads scoped to an individual user rather than a team.",
74    )
75    thread: Thread = Field(
76        ...,
77        description="The parent thread whose message history and membership this snapshot represents.",
78    )

A point-in-time snapshot of a chat room's state, including its loaded messages, member roster, and pagination cursors. Returned when loading or refreshing a thread's message list.

after_cursor: str | None = None

Opaque cursor to pass when fetching messages newer than those in this snapshot. null when this snapshot already reflects the latest messages.

The agent associated with this chat room. null when no agent is attached.

before_cursor: str | None = None

Opaque cursor to pass when fetching messages older than those in this snapshot. null when the beginning of the thread history has been reached.

is_transient: bool = PydanticUndefined

Whether this thread is ephemeral. Transient threads are not retained in long-term storage and may be deleted when the session ends.

members: list[ChatMember] = PydanticUndefined

All active members of the chat room, including both human users and agents.

messages: list[archastro.platform.types.common.Message] = PydanticUndefined

The page of messages currently loaded for the thread, ordered chronologically. Use before_cursor or after_cursor to page through additional history.

messages_loaded_on_last_update: int | None = None

Number of messages that were added to the snapshot in the most recent incremental update. null on the initial load.

The team that owns this thread. null for threads scoped to an individual user rather than a team.

thread: archastro.platform.types.threads.Thread = PydanticUndefined

The parent thread whose message history and membership this snapshot represents.

class ChatForkThreadResponse(pydantic.main.BaseModel):
81class ChatForkThreadResponse(BaseModel):
82    """
83    Response returned after forking a chat thread. Contains the new thread, its initial chat-room snapshot, and the owning team when applicable.
84    """
85
86    chat_model: ChatRoomModel | None = Field(
87        default=None,
88        description="Initial chat-room render snapshot for the forked thread, including members and loaded messages. `null` for transient threads whose room model is suppressed.",
89    )
90    team: Team | None = Field(
91        default=None,
92        description="Team that owns the forked thread. Present only when the original thread was team-scoped; `null` for personal threads.",
93    )
94    thread: Thread = Field(
95        ..., description="The newly-created thread produced by the fork operation."
96    )

Response returned after forking a chat thread. Contains the new thread, its initial chat-room snapshot, and the owning team when applicable.

chat_model: ChatRoomModel | None = None

Initial chat-room render snapshot for the forked thread, including members and loaded messages. null for transient threads whose room model is suppressed.

Team that owns the forked thread. Present only when the original thread was team-scoped; null for personal threads.

thread: archastro.platform.types.threads.Thread = PydanticUndefined

The newly-created thread produced by the fork operation.

class ChatLoadMoreMessagesResponse(pydantic.main.BaseModel):
 99class ChatLoadMoreMessagesResponse(BaseModel):
100    """
101    Response returned after loading an additional page of chat messages. Contains a refreshed chat-room snapshot with the newly-fetched messages merged in.
102    """
103
104    data: ChatRoomModel = Field(
105        ...,
106        description="Updated chat-room snapshot for the thread, incorporating the newly-loaded page of messages alongside any previously loaded messages.",
107    )

Response returned after loading an additional page of chat messages. Contains a refreshed chat-room snapshot with the newly-fetched messages merged in.

data: ChatRoomModel = PydanticUndefined

Updated chat-room snapshot for the thread, incorporating the newly-loaded page of messages alongside any previously loaded messages.

class ChatMarkThreadReadResponse(pydantic.main.BaseModel):
110class ChatMarkThreadReadResponse(BaseModel):
111    """
112    Response returned after marking a chat thread as read. Confirms that the read marker was successfully recorded for the authenticated user.
113    """
114
115    success: bool = Field(
116        ...,
117        description="Indicates whether the read marker was successfully applied. Always `true` on success; errors are returned as channel error replies rather than a `false` value here.",
118    )

Response returned after marking a chat thread as read. Confirms that the read marker was successfully recorded for the authenticated user.

success: bool = PydanticUndefined

Indicates whether the read marker was successfully applied. Always true on success; errors are returned as channel error replies rather than a false value here.

class ChatMessageListResponse(pydantic.main.BaseModel):
121class ChatMessageListResponse(BaseModel):
122    """
123    Response returned when listing the messages of a joined chat thread. Contains the set of messages currently loaded for the thread.
124    """
125
126    messages: list[Message] = Field(
127        ...,
128        description="Ordered array of message objects currently loaded for the thread, from oldest to newest. Use the `load_more_messages` channel message to fetch earlier pages.",
129    )

Response returned when listing the messages of a joined chat thread. Contains the set of messages currently loaded for the thread.

messages: list[archastro.platform.types.common.Message] = PydanticUndefined

Ordered array of message objects currently loaded for the thread, from oldest to newest. Use the load_more_messages channel message to fetch earlier pages.

class ChatPostMessageResponse(pydantic.main.BaseModel):
132class ChatPostMessageResponse(BaseModel):
133    """
134    Response returned after successfully posting a message to a chat thread. Contains the persisted message object echoed back to the sender.
135    """
136
137    message: Message = Field(
138        ...,
139        description="The message that was created and stored. Contains the full message object including its assigned ID, author, content, and timestamps.",
140    )

Response returned after successfully posting a message to a chat thread. Contains the persisted message object echoed back to the sender.

message: archastro.platform.types.common.Message = PydanticUndefined

The message that was created and stored. Contains the full message object including its assigned ID, author, content, and timestamps.