This reference is currently available in English. The Cloud console remains in your selected language.
BEEOS CLOUD / DEVELOPER REFERENCE
Messages
List and read conversation messages and manage reply share links.
Overview
The messages domain reads the messages of a conversation and manages the share links of replies.
6 operations · SDK resource: TypeScript cloud.messages · Python cloud.messages · Go cloud.Messages · API overview
Main objects
MessageEnvelopeResponse: one message;MessagePagelists messages.ReplyShareResponse: a reply that a share link resolves to.
MessageEnvelopeResponse
| Field | Type | Required | Description |
|---|---|---|---|
data | MessageEnvelope | yes | The message. |
Every field, and the methods that use this object: appendix.
MessagePage
| Field | Type | Required | Description |
|---|---|---|---|
messages | array<Message> | yes | Messages on this page. |
next_cursor | string | no | Cursor to pass as cursor to get the next page. Empty when has_more is false. |
has_more | boolean | yes | Whether more messages are available after this page. |
latest_offset | integer | yes | Upper bound of the offsets scanned for this page. It is not the history boundary; use history_boundary_offset for that. Constraints: format=int64. |
history_generation | integer | yes | Generation of the conversation history this page was read from. Constraints: format=int64. |
history_boundary_offset | integer | yes | Offset of the history boundary for the current generation: the point a clear or recovery of the history moved the start of the history to. Constraints: format=int64. |
Every field, and the methods that use this object: appendix.
ReplyShareResponse
| Field | Type | Required | Description |
|---|---|---|---|
data | object | yes | The shared reply. |
data.slug | string | yes | Public slug that identifies the share. |
data.created_at | string | yes | Time the share was created. |
data.agent | object | yes | The agent that wrote the reply. |
data.agent.name | string | yes | Display name of the agent. |
data.agent.avatar_url | string | yes | URL of the agent's avatar. |
data.agent.framework | string | yes | Agent framework of the instance the agent runs on. |
data.reply | object | yes | The shared reply. |
data.reply.parts | array<object> | yes | Content of the reply. It holds one part of type text. |
data.reply.parts[].type | string | yes | Always text. |
data.reply.parts[].text | string | yes | Text of the reply. |
data.reply.created_at | string | yes | Time the reply message was created. |
data.sources | array<object> | yes | Web sources the reply cites. Only https sources are listed. Each source is returned with url, domain (its host name) and, when the agent provided one, title. |
data.sources[].url | string | no | URL of the source. |
data.sources[].title | string | no | Title of the source, when the agent provided one. |
data.files | array<object> | yes | Files the reply links to. Only files published by BeeOS are listed. Each file is returned with name, public_url and, when known, mime_type. |
data.files[].file_id | string | no | Reserved. The server does not currently return this field; a file is identified by public_url. |
data.files[].filename | string | no | Reserved. The server does not currently return this field; the file name is returned as name. |
data.files[].content_type | string | no | Reserved. The server does not currently return this field; the MIME type is returned as mime_type. |
data.files[].size_bytes | integer | no | Reserved. The server does not currently return this field. |
Every field, and the methods that use this object: appendix.
MessageEnvelope
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | ID of the message. |
conversation_id | string | yes | ID of the conversation the message belongs to. |
type | string | yes | Kind of the message. Use it to tell the caller's prompts from the agent's replies and other messages. New kinds can be added, so ignore values you do not know. Allowed values: see the table below, MessageEnvelope.type values. |
sender | string | yes | Identity that sent the message. Other senders appear as their own identity ID. |
reply_to | string | no | ID of the message this message replies to, for example the chat_message an agent_reply answers. Omitted for messages that are not replies. |
body | string | yes | Text of the message. For a reply that is still streaming it is the text produced so far. |
parts | array<map<string, JSONValue>> | no | Structured parts of the message in order, such as reasoning, tool calls, files and sources. Each part has a type; see the variants listed for the items of this field. Structure by type: see the variant table. |
state | string | yes | Lifecycle state of the message. A message starts as streaming and moves exactly once to one of the final states; a final message never changes again. Messages stored before states existed have an empty state and are final. Allowed values: see the table below, MessageEnvelope.state values. |
stop_reason | string | no | Why the message reached a final state. Present only on final messages and can be empty when the reason is unknown. Allowed values: see the table below, MessageEnvelope.stop_reason values. |
content | JSONValue | no | Reserved. The Server API does not currently return this field; read body and parts. |
created_at | string | no | Time the message was created, in RFC 3339 format. Constraints: format=date-time. |
updated_at | string | no | Time the message was last changed, in RFC 3339 format. Omitted when the message was never updated. Constraints: format=date-time. |
MessageEnvelope.type values
| Value | Meaning |
|---|---|
"chat_message" | A prompt sent by the caller to the agent. |
"agent_reply" | The agent's reply to a chat_message. While state is streaming the reply is still being written and body holds the text produced so far. |
"agent_reply_error" | An error reply from the agent, sent as its own message kind instead of an agent_reply that carries an error. |
"agent.refuse" | The agent declined to handle the message. content holds a reason, for example agent_busy when the agent was already working on another turn, and a readable message. |
"agent_busy" | Older name of agent.refuse, still sent by some agent runtimes. Treat it the same way. |
"agent_reply_delta" | A chunk of an agent reply that is still being produced. |
"agent_reasoning" | The agent's reasoning ("thinking") text. It is stored as its own message next to the agent_reply it belongs to, with the same reply_to, and the reasoning text is in body. It is never the final answer. |
"a2a_status_update" | A status change of an Agent-to-Agent (A2A) task. |
"a2a_result" | The final outcome of an A2A task, sent when the task completes or cannot be dispatched. |
"agent_request" | The task request delivered to an agent for an A2A task. |
"a2a_task" | The first message of an A2A task, published when the task is dispatched in queue mode. |
"chat_cancel" | A request to stop the agent's turn for an earlier chat_message. content holds target_message_id and an optional reason. |
"device_command" | One tool call for controlling a device or computer, such as a screenshot, click or typing. The agent runs it on the device without a model turn. |
"device_result" | The successful result of a device_command. reply_to is the ID of the command. |
"device_error" | The failure of a device_command. content holds error and code. |
MessageEnvelope.state values
| Value | Meaning |
|---|---|
"streaming" | The message is still being written. body and parts can still change. |
"completed" | The message was finished normally. |
"failed" | The agent failed to finish the message. |
"refused" | The agent refused to answer. body holds the refusal text. |
"cancelled" | The message was stopped on request before it finished. |
MessageEnvelope.stop_reason values
| Value | Meaning |
|---|---|
"end_turn" | The agent finished its turn normally. |
"max_tokens" | The output limit was reached before the agent finished. |
"tool_use" | The agent stopped to call a tool. |
"user_stop" | The user stopped the agent. |
"timeout" | The time limit was reached before the agent finished. |
"error" | The agent stopped because of an error. |
"refused" | The agent refused to answer. |
"content_filter" | The reply was stopped by a content filter. |
"agent_lost" | The server ended the message because the agent that was producing it is no longer running, for example because it crashed or was replaced. |
Every field, and the methods that use this object: appendix.
Message
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | ID of the message. |
conversation_id | string | yes | ID of the conversation the message belongs to. |
type | string | yes | Kind of the message. Use it to tell the caller's prompts from the agent's replies and other messages. New kinds can be added, so ignore values you do not know. Allowed values: see the table below, Message.type values. |
content | JSONValue | yes | Payload of the message as JSON. Its structure depends on type; see the variants listed for this field. For current agent replies read body and parts instead. The server removes the metadata and from keys before returning it. Structure by Message.type: see the variant table. |
sender | string | yes | Identity that sent the message. Other senders appear as their own identity ID. |
reply_to | string | no | ID of the message this message replies to, for example the chat_message an agent_reply answers. Omitted for messages that are not replies. |
created_at | string | yes | Time the message was created, in RFC 3339 format. Constraints: format=date-time. |
offset | integer | yes | Position of the message in the conversation history. Newer messages have larger offsets. Constraints: format=int64. |
history_generation | integer | yes | Generation of the conversation history the message belongs to. Constraints: format=int64. |
state | string | no | Lifecycle state of the message. A message starts as streaming and moves exactly once to one of the final states; a final message never changes again. Messages stored before states existed have an empty state and are final. Allowed values: see the table below, Message.state values. |
stop_reason | string | no | Why the message reached a final state. Present only on final messages and can be empty when the reason is unknown. Allowed values: see the table below, Message.stop_reason values. |
body | string | no | Text of the message. For a reply that is still streaming it is the text produced so far. |
parts | array<map<string, JSONValue>> | no | Structured parts of the message in order, such as reasoning, tool calls, files and sources. Each part has a type; see the variants listed for the items of this field. Structure by type: see the variant table. |
updated_at | string | no | Time the message was last changed, in RFC 3339 format. Omitted when the message was never updated. Constraints: format=date-time. |
runtime_dispatch | map<string, JSONValue> | no | Result of handing the message to the agent runtime, as an object with status and code. Present only when a dispatch result is recorded for the message; otherwise omitted. |
realtime_publish_status | string | no | Reserved. The Server API does not currently return this field. Allowed values: "published", "unconfirmed", "not_republished". (enum table) |
Message.type values
| Value | Meaning |
|---|---|
"chat_message" | A prompt sent by the caller to the agent. |
"agent_reply" | The agent's reply to a chat_message. While state is streaming the reply is still being written and body holds the text produced so far. |
"agent_reply_error" | An error reply from the agent, sent as its own message kind instead of an agent_reply that carries an error. |
"agent.refuse" | The agent declined to handle the message. content holds a reason, for example agent_busy when the agent was already working on another turn, and a readable message. |
"agent_busy" | Older name of agent.refuse, still sent by some agent runtimes. Treat it the same way. |
"agent_reply_delta" | A chunk of an agent reply that is still being produced. |
"agent_reasoning" | The agent's reasoning ("thinking") text. It is stored as its own message next to the agent_reply it belongs to, with the same reply_to, and the reasoning text is in body. It is never the final answer. |
"a2a_status_update" | A status change of an Agent-to-Agent (A2A) task. |
"a2a_result" | The final outcome of an A2A task, sent when the task completes or cannot be dispatched. |
"agent_request" | The task request delivered to an agent for an A2A task. |
"a2a_task" | The first message of an A2A task, published when the task is dispatched in queue mode. |
"chat_cancel" | A request to stop the agent's turn for an earlier chat_message. content holds target_message_id and an optional reason. |
"device_command" | One tool call for controlling a device or computer, such as a screenshot, click or typing. The agent runs it on the device without a model turn. |
"device_result" | The successful result of a device_command. reply_to is the ID of the command. |
"device_error" | The failure of a device_command. content holds error and code. |
Message.state values
| Value | Meaning |
|---|---|
"streaming" | The message is still being written. body and parts can still change. |
"completed" | The message was finished normally. |
"failed" | The agent failed to finish the message. |
"refused" | The agent refused to answer. body holds the refusal text. |
"cancelled" | The message was stopped on request before it finished. |
Message.stop_reason values
| Value | Meaning |
|---|---|
"end_turn" | The agent finished its turn normally. |
"max_tokens" | The output limit was reached before the agent finished. |
"tool_use" | The agent stopped to call a tool. |
"user_stop" | The user stopped the agent. |
"timeout" | The time limit was reached before the agent finished. |
"error" | The agent stopped because of an error. |
"refused" | The agent refused to answer. |
"content_filter" | The reply was stopped by a content filter. |
"agent_lost" | The server ended the message because the agent that was producing it is no longer running, for example because it crashed or was replaced. |
Every field, and the methods that use this object: appendix.
Typical flow
- List the messages of a conversation with
messages.listand read one withmessages.get. - Share a reply with
messages.createShare; read the existing link withmessages.getShare. - Anyone with the slug can open the reply through
messages.resolveShare. - Withdraw the link with
messages.revokeShare.
Methods
| Method | HTTP | Summary |
|---|---|---|
| messages.list | GET /v1/agents/{agentId}/conversations/{conversationId}/messages | List conversation messages |
| messages.get | GET /v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId} | Get a conversation message |
| messages.getShare | GET /v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/share | Get a reply share link |
| messages.createShare | POST /v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/share | Create a reply share link |
| messages.revokeShare | DELETE /v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/share | Revoke a reply share link |
| messages.resolveShare | GET /v1/reply-shares/{slug} | Resolve a reply share link |
messages.list
GET /v1/agents/{agentId}/conversations/{conversationId}/messages · Operation ID listConversationMessages
List conversation messages
Required scopes: messages:read.
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.messages.list | list(agentId: string, conversationId: string, query?: Models.ListConversationMessagesQuery): Promise<Models.ListConversationMessagesResponse> |
| Python | cloud.messages.list | def list(self, agent_id: str, conversation_id: str, options: ListConversationMessagesOptions | None = None) -> MessagePage |
| Go | cloud.Messages.List | func (r *MessagesResource) List(ctx context.Context, agentId string, conversationId string, options ListConversationMessagesOptions) (MessagePage, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agentId | path | string | yes | ID of the agent, the id returned by the agents API. |
conversationId | path | string | yes | ID of the conversation, as returned when it was created or listed. |
cursor | query | string | no | Cursor from next_cursor of the previous page. Omit it to get the first page. At most 4096 characters. |
limit | query | integer | no | Maximum number of messages to return in one page. Defaults to 50. The server accepts values from 1 to 200. Constraints: minimum=1, maximum=100. |
Response
200 Authoritative message history page · application/json · Schema: MessagePage
| Field | Type | Required | Description |
|---|---|---|---|
messages | array<Message> | yes | Messages on this page. |
next_cursor | string | no | Cursor to pass as cursor to get the next page. Empty when has_more is false. |
has_more | boolean | yes | Whether more messages are available after this page. |
latest_offset | integer | yes | Upper bound of the offsets scanned for this page. It is not the history boundary; use history_boundary_offset for that. Constraints: format=int64. |
history_generation | integer | yes | Generation of the conversation history this page was read from. Constraints: format=int64. |
history_boundary_offset | integer | yes | Offset of the history boundary for the current generation: the point a clear or recovery of the history moved the start of the history to. Constraints: format=int64. |
Errors
| Status | Schema | Description |
|---|---|---|
| other (default) | ErrorResponse | Cloud Server error |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.messages.list("agent_123", "conversation_123");
console.log(result);messages.get
GET /v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId} · Operation ID getConversationMessage
Get a conversation message
Required scopes: messages:read.
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.messages.get | get(agentId: string, conversationId: string, messageId: string): Promise<Models.GetConversationMessageResponse> |
| Python | cloud.messages.get | def get(self, agent_id: str, conversation_id: str, message_id: str) -> MessageEnvelopeResponse |
| Go | cloud.Messages.Get | func (r *MessagesResource) Get(ctx context.Context, agentId string, conversationId string, messageId string) (MessageEnvelopeResponse, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agentId | path | string | yes | ID of the agent, the id returned by the agents API. |
conversationId | path | string | yes | ID of the conversation, as returned when it was created or listed. |
messageId | path | string | yes | ID of the message. |
Response
200 Authoritative v3 message snapshot · application/json · Schema: MessageEnvelopeResponse
| Field | Type | Required | Description |
|---|---|---|---|
data | MessageEnvelope | yes | The message. |
Errors
| Status | Schema | Description |
|---|---|---|
| other (default) | ErrorResponse | Cloud Server error |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.messages.get("agent_123", "conversation_123", "message_123");
console.log(result);messages.getShare
GET /v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/share · Operation ID getShareReply
Get a reply share link
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.messages.getShare | getShare(agentId: string, conversationId: string, messageId: string): Promise<Models.GetShareReplyResponse> |
| Python | cloud.messages.get_share | def get_share(self, agent_id: str, conversation_id: str, message_id: str) -> GetShareReplyResponse |
| Go | cloud.Messages.GetShare | func (r *MessagesResource) GetShare(ctx context.Context, agentId string, conversationId string, messageId string) (GetShareReplyResponse, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agentId | path | string | yes | ID of the agent, the id returned by the agents API. |
conversationId | path | string | yes | ID of the conversation, as returned when it was created or listed. |
messageId | path | string | yes | ID of the message. |
Response
200 · application/json
| Field | Type | Required | Description |
|---|---|---|---|
data | object | yes | The share of the reply. |
data.slug | string | yes | Public slug that identifies the share. Use it to resolve the shared reply with the reply share lookup. |
data.created_at | string | yes | Time the share was created. |
Errors
| Status | Schema | Description |
|---|---|---|
| other (default) | ErrorResponse | Cloud Server error |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.messages.getShare("agent_123", "conversation_123", "message_123");
console.log(result);messages.createShare
POST /v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/share · Operation ID createShareReply
Create a reply share link
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.messages.createShare | createShare(agentId: string, conversationId: string, messageId: string): Promise<Models.CreateShareReplyResponse> |
| Python | cloud.messages.create_share | def create_share(self, agent_id: str, conversation_id: str, message_id: str) -> CreateShareReplyResponse |
| Go | cloud.Messages.CreateShare | func (r *MessagesResource) CreateShare(ctx context.Context, agentId string, conversationId string, messageId string) (CreateShareReplyResponse, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agentId | path | string | yes | ID of the agent, the id returned by the agents API. |
conversationId | path | string | yes | ID of the conversation, as returned when it was created or listed. |
messageId | path | string | yes | ID of the message. |
Response
200 · application/json
| Field | Type | Required | Description |
|---|---|---|---|
data | object | yes | The share of the reply. |
data.slug | string | yes | Public slug that identifies the share. Use it to resolve the shared reply with the reply share lookup. |
data.created_at | string | yes | Time the share was created. |
Errors
| Status | Schema | Description |
|---|---|---|
| other (default) | ErrorResponse | Cloud Server error |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.messages.createShare("agent_123", "conversation_123", "message_123");
console.log(result);messages.revokeShare
DELETE /v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/share · Operation ID revokeShareReply
Revoke a reply share link
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.messages.revokeShare | revokeShare(agentId: string, conversationId: string, messageId: string): Promise<Models.RevokeShareReplyResponse> |
| Python | cloud.messages.revoke_share | def revoke_share(self, agent_id: str, conversation_id: str, message_id: str) -> None |
| Go | cloud.Messages.RevokeShare | func (r *MessagesResource) RevokeShare(ctx context.Context, agentId string, conversationId string, messageId string) error |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agentId | path | string | yes | ID of the agent, the id returned by the agents API. |
conversationId | path | string | yes | ID of the conversation, as returned when it was created or listed. |
messageId | path | string | yes | ID of the message. |
Response
204
No response body.
Errors
| Status | Schema | Description |
|---|---|---|
| other (default) | ErrorResponse | Cloud Server error |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.messages.revokeShare("agent_123", "conversation_123", "message_123");
console.log(result);messages.resolveShare
GET /v1/reply-shares/{slug} · Operation ID resolveReplyShare
Resolve a reply share link
SDK methods
| Language | Method | Signature |
|---|---|---|
| TypeScript | cloud.messages.resolveShare | resolveShare(slug: string): Promise<Models.ResolveReplyShareResponse> |
| Python | cloud.messages.resolve_share | def resolve_share(self, slug: str) -> ReplyShareResponse |
| Go | cloud.Messages.ResolveShare | func (r *MessagesResource) ResolveShare(ctx context.Context, slug string) (ReplyShareResponse, error) |
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
slug | path | string | yes | Public slug of the shared reply, the data.slug returned when the share was created. |
Response
200 · application/json · Schema: ReplyShareResponse
| Field | Type | Required | Description |
|---|---|---|---|
data | object | yes | The shared reply. |
data.slug | string | yes | Public slug that identifies the share. |
data.created_at | string | yes | Time the share was created. |
data.agent | object | yes | The agent that wrote the reply. |
data.agent.name | string | yes | Display name of the agent. |
data.agent.avatar_url | string | yes | URL of the agent's avatar. |
data.agent.framework | string | yes | Agent framework of the instance the agent runs on. |
data.reply | object | yes | The shared reply. |
data.reply.parts | array<object> | yes | Content of the reply. It holds one part of type text. |
data.reply.parts[].type | string | yes | Always text. |
data.reply.parts[].text | string | yes | Text of the reply. |
data.reply.created_at | string | yes | Time the reply message was created. |
data.sources | array<object> | yes | Web sources the reply cites. Only https sources are listed. Each source is returned with url, domain (its host name) and, when the agent provided one, title. |
data.sources[].url | string | no | URL of the source. |
data.sources[].title | string | no | Title of the source, when the agent provided one. |
data.files | array<object> | yes | Files the reply links to. Only files published by BeeOS are listed. Each file is returned with name, public_url and, when known, mime_type. |
data.files[].file_id | string | no | Reserved. The server does not currently return this field; a file is identified by public_url. |
data.files[].filename | string | no | Reserved. The server does not currently return this field; the file name is returned as name. |
data.files[].content_type | string | no | Reserved. The server does not currently return this field; the MIME type is returned as mime_type. |
data.files[].size_bytes | integer | no | Reserved. The server does not currently return this field. |
Errors
| Status | Schema | Description |
|---|---|---|
| other (default) | ErrorResponse | Cloud Server error |
The error schemas are described in Errors.
Example
import { BeeOSClient } from "@beeos-ai/cloud-sdk";
const cloud = new BeeOSClient({
baseURL: "https://api.cloud.beeos.ai/v1",
apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.messages.resolveShare("share_slug");
console.log(result);Structures by discriminator
Message.content by Message.type
The structure of Message.content depends on Message.type.
| Value of Message.type | Description | Structure |
|---|---|---|
"chat_message" | A prompt sent by the caller to the agent. | MessageContentChatMessage |
"agent_reply" | The agent's reply to a chat_message. While state is streaming the reply is still being written and body holds the text produced so far. | MessageContentAgentReply |
"agent_reply_error" | An error reply from the agent, sent as its own message kind instead of an agent_reply that carries an error. | MessageContentAgentReply |
"agent.refuse" | The agent declined to handle the message. content holds a reason, for example agent_busy when the agent was already working on another turn, and a readable message. | MessageContentAgentRefuse |
"agent_busy" | Older name of agent.refuse, still sent by some agent runtimes. Treat it the same way. | MessageContentAgentRefuse |
"chat_cancel" | A request to stop the agent's turn for an earlier chat_message. content holds target_message_id and an optional reason. | MessageContentChatCancel |
"device_command" | One tool call for controlling a device or computer, such as a screenshot, click or typing. The agent runs it on the device without a model turn. | MessageContentDeviceCommand |
"device_error" | The failure of a device_command. content holds error and code. | MessageContentDeviceError |
Message.parts[] by type
The structure of Message.parts[] depends on its own type value.
| Value of type | Description | Structure |
|---|---|---|
"text" | A piece of the reply text. | MessagePartText |
"thinking" | A piece of the agent's reasoning. | MessagePartThinking |
"tool_use" | A tool call made by the agent. | MessagePartToolUse |
"tool_result" | The result of a tool call. | MessagePartToolResult |
"file" | A file attached to the message. Images, audio and video are all file parts; tell them apart by mime_type. | MessagePartFile |
"source" | A cited source or reference. | MessagePartSource |
"custom" | An extension part for structured content that has no dedicated type. kind says what the part is. | MessagePartCustom |
MessageEnvelope.parts[] by type
The structure of MessageEnvelope.parts[] depends on its own type value.
| Value of type | Description | Structure |
|---|---|---|
"text" | A piece of the reply text. | MessagePartText |
"thinking" | A piece of the agent's reasoning. | MessagePartThinking |
"tool_use" | A tool call made by the agent. | MessagePartToolUse |
"tool_result" | The result of a tool call. | MessagePartToolResult |
"file" | A file attached to the message. Images, audio and video are all file parts; tell them apart by mime_type. | MessagePartFile |
"source" | A cited source or reference. | MessagePartSource |
"custom" | An extension part for structured content that has no dedicated type. kind says what the part is. | MessagePartCustom |