archastro.platform.types.chat
1# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License. 2# This file is auto-generated by @archastro/sdk-generator. Do not edit. 3# Content hash: 43c3317ab780 4 5from typing import Any, Literal 6 7from pydantic import BaseModel, Field 8 9from .common import Agent, Message 10from .teams import Team 11from .threads import Thread 12from .users import User 13 14 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 ) 36 37 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 ) 79 80 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 ) 97 98 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 ) 108 109 110class ChatLocalToolFunction(BaseModel): 111 """ 112 A function implemented by the client connected to a personal thread. 113 """ 114 115 description: str 116 name: str 117 parameters: dict[str, Any] 118 119 120class ChatLocalToolDefinition(BaseModel): 121 """ 122 An OpenAI-compatible local function definition supplied while joining a personal thread. 123 """ 124 125 function: ChatLocalToolFunction 126 type: Literal["function"] 127 128 129class ChatMarkThreadReadResponse(BaseModel): 130 """ 131 Response returned after marking a chat thread as read. Confirms that the read marker was successfully recorded for the authenticated user. 132 """ 133 134 success: bool = Field( 135 ..., 136 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.", 137 ) 138 139 140class ChatMessageListResponse(BaseModel): 141 """ 142 Response returned when listing the messages of a joined chat thread. Contains the set of messages currently loaded for the thread. 143 """ 144 145 messages: list[Message] = Field( 146 ..., 147 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.", 148 ) 149 150 151class ChatPostMessageResponse(BaseModel): 152 """ 153 Response returned after successfully posting a message to a chat thread. Contains the persisted message object echoed back to the sender. 154 """ 155 156 message: Message = Field( 157 ..., 158 description="The message that was created and stored. Contains the full message object including its assigned ID, author, content, and timestamps.", 159 )
16class ChatMember(BaseModel): 17 """ 18 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`. 19 """ 20 21 agent: Agent | None = Field( 22 default=None, 23 description='Full agent object for this member. Populated when `type` is `"agent"`; `null` for user members.', 24 ) 25 membership_type: str | None = Field( 26 default=None, 27 description='Role of this member within the thread. Common values are `"owner"` and `"member"`. `null` when the membership type is not applicable.', 28 ) 29 type: str = Field( 30 ..., 31 description='Kind of participant. One of `"user"` (a human user) or `"agent"` (an AI agent).', 32 ) 33 user: User | None = Field( 34 default=None, 35 description='Full user object for this member. Populated when `type` is `"user"`; `null` for agent members.', 36 )
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.
Role of this member within the thread. Common values are "owner" and "member". null when the membership type is not applicable.
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.
39class ChatRoomModel(BaseModel): 40 """ 41 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. 42 """ 43 44 after_cursor: str | None = Field( 45 default=None, 46 description="Opaque cursor to pass when fetching messages newer than those in this snapshot. `null` when this snapshot already reflects the latest messages.", 47 ) 48 agent: Agent | None = Field( 49 default=None, 50 description="The agent associated with this chat room. `null` when no agent is attached.", 51 ) 52 before_cursor: str | None = Field( 53 default=None, 54 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.", 55 ) 56 is_transient: bool = Field( 57 ..., 58 description="Whether this thread is ephemeral. Transient threads are not retained in long-term storage and may be deleted when the session ends.", 59 ) 60 members: list[ChatMember] = Field( 61 ..., 62 description="All active members of the chat room, including both human users and agents.", 63 ) 64 messages: list[Message] = Field( 65 ..., 66 description="The page of messages currently loaded for the thread, ordered chronologically. Use `before_cursor` or `after_cursor` to page through additional history.", 67 ) 68 messages_loaded_on_last_update: int | None = Field( 69 default=None, 70 description="Number of messages that were added to the snapshot in the most recent incremental update. `null` on the initial load.", 71 ) 72 team: Team | None = Field( 73 default=None, 74 description="The team that owns this thread. `null` for threads scoped to an individual user rather than a team.", 75 ) 76 thread: Thread = Field( 77 ..., 78 description="The parent thread whose message history and membership this snapshot represents.", 79 )
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.
Opaque cursor to pass when fetching messages newer than those in this snapshot. null when this snapshot already reflects the latest messages.
Opaque cursor to pass when fetching messages older than those in this snapshot. null when the beginning of the thread history has been reached.
Whether this thread is ephemeral. Transient threads are not retained in long-term storage and may be deleted when the session ends.
The page of messages currently loaded for the thread, ordered chronologically. Use before_cursor or after_cursor to page through additional history.
Number of messages that were added to the snapshot in the most recent incremental update. null on the initial load.
82class ChatForkThreadResponse(BaseModel): 83 """ 84 Response returned after forking a chat thread. Contains the new thread, its initial chat-room snapshot, and the owning team when applicable. 85 """ 86 87 chat_model: ChatRoomModel | None = Field( 88 default=None, 89 description="Initial chat-room render snapshot for the forked thread, including members and loaded messages. `null` for transient threads whose room model is suppressed.", 90 ) 91 team: Team | None = Field( 92 default=None, 93 description="Team that owns the forked thread. Present only when the original thread was team-scoped; `null` for personal threads.", 94 ) 95 thread: Thread = Field( 96 ..., description="The newly-created thread produced by the fork operation." 97 )
Response returned after forking a chat thread. Contains the new thread, its initial chat-room snapshot, and the owning team when applicable.
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.
100class ChatLoadMoreMessagesResponse(BaseModel): 101 """ 102 Response returned after loading an additional page of chat messages. Contains a refreshed chat-room snapshot with the newly-fetched messages merged in. 103 """ 104 105 data: ChatRoomModel = Field( 106 ..., 107 description="Updated chat-room snapshot for the thread, incorporating the newly-loaded page of messages alongside any previously loaded messages.", 108 )
Response returned after loading an additional page of chat messages. Contains a refreshed chat-room snapshot with the newly-fetched messages merged in.
111class ChatLocalToolFunction(BaseModel): 112 """ 113 A function implemented by the client connected to a personal thread. 114 """ 115 116 description: str 117 name: str 118 parameters: dict[str, Any]
A function implemented by the client connected to a personal thread.
121class ChatLocalToolDefinition(BaseModel): 122 """ 123 An OpenAI-compatible local function definition supplied while joining a personal thread. 124 """ 125 126 function: ChatLocalToolFunction 127 type: Literal["function"]
An OpenAI-compatible local function definition supplied while joining a personal thread.
130class ChatMarkThreadReadResponse(BaseModel): 131 """ 132 Response returned after marking a chat thread as read. Confirms that the read marker was successfully recorded for the authenticated user. 133 """ 134 135 success: bool = Field( 136 ..., 137 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.", 138 )
Response returned after marking a chat thread as read. Confirms that the read marker was successfully recorded for the authenticated user.
141class ChatMessageListResponse(BaseModel): 142 """ 143 Response returned when listing the messages of a joined chat thread. Contains the set of messages currently loaded for the thread. 144 """ 145 146 messages: list[Message] = Field( 147 ..., 148 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.", 149 )
Response returned when listing the messages of a joined chat thread. Contains the set of messages currently loaded for the thread.
152class ChatPostMessageResponse(BaseModel): 153 """ 154 Response returned after successfully posting a message to a chat thread. Contains the persisted message object echoed back to the sender. 155 """ 156 157 message: Message = Field( 158 ..., 159 description="The message that was created and stored. Contains the full message object including its assigned ID, author, content, and timestamps.", 160 )
Response returned after successfully posting a message to a chat thread. Contains the persisted message object echoed back to the sender.