pub enum ResponseItem {
Show 16 variants
Message {
content: Vec<ContentItem>,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
phase: Option<MessagePhase>,
role: String,
},
AgentMessage {
author: String,
content: Vec<AgentMessageInputContent>,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
recipient: String,
},
Reasoning {
content: Option<Vec<ReasoningItemContent>>,
encrypted_content: Option<String>,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
summary: Vec<ReasoningItemReasoningSummary>,
},
LocalShellCall {
action: LocalShellAction,
call_id: Option<String>,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
status: LocalShellStatus,
},
FunctionCall {
arguments: String,
call_id: String,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
name: String,
namespace: Option<String>,
},
ToolSearchCall {
arguments: Value,
call_id: Option<String>,
execution: String,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
status: Option<String>,
},
FunctionCallOutput {
call_id: String,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
output: FunctionCallOutputBody,
},
CustomToolCall {
call_id: String,
id: Option<String>,
input: String,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
name: String,
namespace: Option<String>,
status: Option<String>,
},
CustomToolCallOutput {
call_id: String,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
name: Option<String>,
output: FunctionCallOutputBody,
},
ToolSearchOutput {
call_id: Option<String>,
execution: String,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
status: String,
tools: Vec<Value>,
},
WebSearchCall {
action: Option<ResponsesApiWebSearchAction>,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
status: Option<String>,
},
ImageGenerationCall {
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
result: String,
revised_prompt: Option<String>,
status: String,
},
Compaction {
encrypted_content: String,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
CompactionTrigger,
ContextCompaction {
encrypted_content: Option<String>,
id: Option<String>,
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>,
},
Other,
}Expand description
ResponseItem
JSON schema
{
"oneOf": [
{
"title": "MessageResponseItem",
"type": "object",
"required": [
"content",
"role",
"type"
],
"properties": {
"content": {
"type": "array",
"items": {
"$ref": "#/definitions/ContentItem"
}
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"phase": {
"anyOf": [
{
"$ref": "#/definitions/MessagePhase"
},
{
"type": "null"
}
]
},
"role": {
"type": "string"
},
"type": {
"title": "MessageResponseItemType",
"type": "string",
"enum": [
"message"
]
}
}
},
{
"title": "AgentMessageResponseItem",
"type": "object",
"required": [
"author",
"content",
"recipient",
"type"
],
"properties": {
"author": {
"type": "string"
},
"content": {
"type": "array",
"items": {
"$ref": "#/definitions/AgentMessageInputContent"
}
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"recipient": {
"type": "string"
},
"type": {
"title": "AgentMessageResponseItemType",
"type": "string",
"enum": [
"agent_message"
]
}
}
},
{
"title": "ReasoningResponseItem",
"type": "object",
"required": [
"summary",
"type"
],
"properties": {
"content": {
"default": null,
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/ReasoningItemContent"
}
},
"encrypted_content": {
"type": [
"string",
"null"
]
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"summary": {
"type": "array",
"items": {
"$ref": "#/definitions/ReasoningItemReasoningSummary"
}
},
"type": {
"title": "ReasoningResponseItemType",
"type": "string",
"enum": [
"reasoning"
]
}
}
},
{
"title": "LocalShellCallResponseItem",
"type": "object",
"required": [
"action",
"status",
"type"
],
"properties": {
"action": {
"$ref": "#/definitions/LocalShellAction"
},
"call_id": {
"description": "Set when using the Responses API.",
"type": [
"string",
"null"
]
},
"id": {
"description": "Legacy id field retained for compatibility with older payloads.",
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"status": {
"$ref": "#/definitions/LocalShellStatus"
},
"type": {
"title": "LocalShellCallResponseItemType",
"type": "string",
"enum": [
"local_shell_call"
]
}
}
},
{
"title": "FunctionCallResponseItem",
"type": "object",
"required": [
"arguments",
"call_id",
"name",
"type"
],
"properties": {
"arguments": {
"type": "string"
},
"call_id": {
"type": "string"
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"name": {
"type": "string"
},
"namespace": {
"type": [
"string",
"null"
]
},
"type": {
"title": "FunctionCallResponseItemType",
"type": "string",
"enum": [
"function_call"
]
}
}
},
{
"title": "ToolSearchCallResponseItem",
"type": "object",
"required": [
"arguments",
"execution",
"type"
],
"properties": {
"arguments": true,
"call_id": {
"type": [
"string",
"null"
]
},
"execution": {
"type": "string"
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"status": {
"type": [
"string",
"null"
]
},
"type": {
"title": "ToolSearchCallResponseItemType",
"type": "string",
"enum": [
"tool_search_call"
]
}
}
},
{
"title": "FunctionCallOutputResponseItem",
"type": "object",
"required": [
"call_id",
"output",
"type"
],
"properties": {
"call_id": {
"type": "string"
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"output": {
"$ref": "#/definitions/FunctionCallOutputBody"
},
"type": {
"title": "FunctionCallOutputResponseItemType",
"type": "string",
"enum": [
"function_call_output"
]
}
}
},
{
"title": "CustomToolCallResponseItem",
"type": "object",
"required": [
"call_id",
"input",
"name",
"type"
],
"properties": {
"call_id": {
"type": "string"
},
"id": {
"type": [
"string",
"null"
]
},
"input": {
"type": "string"
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"name": {
"type": "string"
},
"namespace": {
"type": [
"string",
"null"
]
},
"status": {
"type": [
"string",
"null"
]
},
"type": {
"title": "CustomToolCallResponseItemType",
"type": "string",
"enum": [
"custom_tool_call"
]
}
}
},
{
"title": "CustomToolCallOutputResponseItem",
"type": "object",
"required": [
"call_id",
"output",
"type"
],
"properties": {
"call_id": {
"type": "string"
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"name": {
"type": [
"string",
"null"
]
},
"output": {
"$ref": "#/definitions/FunctionCallOutputBody"
},
"type": {
"title": "CustomToolCallOutputResponseItemType",
"type": "string",
"enum": [
"custom_tool_call_output"
]
}
}
},
{
"title": "ToolSearchOutputResponseItem",
"type": "object",
"required": [
"execution",
"status",
"tools",
"type"
],
"properties": {
"call_id": {
"type": [
"string",
"null"
]
},
"execution": {
"type": "string"
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"status": {
"type": "string"
},
"tools": {
"type": "array",
"items": true
},
"type": {
"title": "ToolSearchOutputResponseItemType",
"type": "string",
"enum": [
"tool_search_output"
]
}
}
},
{
"title": "WebSearchCallResponseItem",
"type": "object",
"required": [
"type"
],
"properties": {
"action": {
"anyOf": [
{
"$ref": "#/definitions/ResponsesApiWebSearchAction"
},
{
"type": "null"
}
]
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"status": {
"type": [
"string",
"null"
]
},
"type": {
"title": "WebSearchCallResponseItemType",
"type": "string",
"enum": [
"web_search_call"
]
}
}
},
{
"title": "ImageGenerationCallResponseItem",
"type": "object",
"required": [
"result",
"status",
"type"
],
"properties": {
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"result": {
"type": "string"
},
"revised_prompt": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string"
},
"type": {
"title": "ImageGenerationCallResponseItemType",
"type": "string",
"enum": [
"image_generation_call"
]
}
}
},
{
"title": "CompactionResponseItem",
"type": "object",
"required": [
"encrypted_content",
"type"
],
"properties": {
"encrypted_content": {
"type": "string"
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"type": {
"title": "CompactionResponseItemType",
"type": "string",
"enum": [
"compaction"
]
}
}
},
{
"title": "CompactionTriggerResponseItem",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"title": "CompactionTriggerResponseItemType",
"type": "string",
"enum": [
"compaction_trigger"
]
}
}
},
{
"title": "ContextCompactionResponseItem",
"type": "object",
"required": [
"type"
],
"properties": {
"encrypted_content": {
"type": [
"string",
"null"
]
},
"id": {
"type": [
"string",
"null"
]
},
"internal_chat_message_metadata_passthrough": {
"anyOf": [
{
"$ref": "#/definitions/InternalChatMessageMetadataPassthrough"
},
{
"type": "null"
}
]
},
"type": {
"title": "ContextCompactionResponseItemType",
"type": "string",
"enum": [
"context_compaction"
]
}
}
},
{
"title": "OtherResponseItem",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"title": "OtherResponseItemType",
"type": "string",
"enum": [
"other"
]
}
}
}
]
}Variants§
Message
MessageResponseItem
Fields
§
content: Vec<ContentItem>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>§
phase: Option<MessagePhase>AgentMessage
AgentMessageResponseItem
Fields
§
content: Vec<AgentMessageInputContent>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>Reasoning
ReasoningResponseItem
Fields
§
content: Option<Vec<ReasoningItemContent>>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>§
summary: Vec<ReasoningItemReasoningSummary>LocalShellCall
LocalShellCallResponseItem
Fields
§
action: LocalShellAction§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>§
status: LocalShellStatusFunctionCall
FunctionCallResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>ToolSearchCall
ToolSearchCallResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>FunctionCallOutput
FunctionCallOutputResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>§
output: FunctionCallOutputBodyCustomToolCall
CustomToolCallResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>CustomToolCallOutput
CustomToolCallOutputResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>§
output: FunctionCallOutputBodyToolSearchOutput
ToolSearchOutputResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>WebSearchCall
WebSearchCallResponseItem
Fields
§
action: Option<ResponsesApiWebSearchAction>§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>ImageGenerationCall
ImageGenerationCallResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>Compaction
CompactionResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>CompactionTrigger
ContextCompaction
ContextCompactionResponseItem
Fields
§
internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>Other
Trait Implementations§
Source§impl Clone for ResponseItem
impl Clone for ResponseItem
Source§fn clone(&self) -> ResponseItem
fn clone(&self) -> ResponseItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseItem
impl Debug for ResponseItem
Source§impl<'de> Deserialize<'de> for ResponseItem
impl<'de> Deserialize<'de> for ResponseItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ResponseItem
impl RefUnwindSafe for ResponseItem
impl Send for ResponseItem
impl Sync for ResponseItem
impl Unpin for ResponseItem
impl UnsafeUnpin for ResponseItem
impl UnwindSafe for ResponseItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more