Skip to main content

ResponseItem

Enum ResponseItem 

Source
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>
§role: String
§

AgentMessage

AgentMessageResponseItem

Fields

§author: String
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§recipient: String
§

Reasoning

ReasoningResponseItem

Fields

§encrypted_content: Option<String>
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§

LocalShellCall

LocalShellCallResponseItem

Fields

§call_id: Option<String>

Set when using the Responses API.

§id: Option<String>

Legacy id field retained for compatibility with older payloads.

§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§

FunctionCall

FunctionCallResponseItem

Fields

§arguments: String
§call_id: String
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§name: String
§namespace: Option<String>
§

ToolSearchCall

ToolSearchCallResponseItem

Fields

§arguments: Value
§call_id: Option<String>
§execution: String
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§status: Option<String>
§

FunctionCallOutput

FunctionCallOutputResponseItem

Fields

§call_id: String
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§

CustomToolCall

CustomToolCallResponseItem

Fields

§call_id: String
§input: String
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§name: String
§namespace: Option<String>
§status: Option<String>
§

CustomToolCallOutput

CustomToolCallOutputResponseItem

Fields

§call_id: String
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§

ToolSearchOutput

ToolSearchOutputResponseItem

Fields

§call_id: Option<String>
§execution: String
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§status: String
§tools: Vec<Value>
§

WebSearchCall

WebSearchCallResponseItem

Fields

§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§status: Option<String>
§

ImageGenerationCall

ImageGenerationCallResponseItem

Fields

§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§result: String
§revised_prompt: Option<String>
§status: String
§

Compaction

CompactionResponseItem

Fields

§encrypted_content: String
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§

CompactionTrigger

§

ContextCompaction

ContextCompactionResponseItem

Fields

§encrypted_content: Option<String>
§internal_chat_message_metadata_passthrough: Option<InternalChatMessageMetadataPassthrough>
§

Other

Trait Implementations§

Source§

impl Clone for ResponseItem

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResponseItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ResponseItem

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ResponseItem

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,