pub enum Item {
Show 18 variants
Message(MessageItem),
FileSearchCall(FileSearchToolCall),
ComputerCall(ComputerToolCall),
ComputerCallOutput(ComputerCallOutputItemParam),
WebSearchCall(WebSearchToolCall),
FunctionCall(FunctionToolCall),
FunctionCallOutput(FunctionCallOutputItemParam),
Reasoning(ReasoningItem),
ImageGenerationCall(ImageGenToolCall),
CodeInterpreterCall(CodeInterpreterToolCall),
LocalShellCall(LocalShellToolCall),
LocalShellCallOutput(LocalShellToolCallOutput),
McpListTools(MCPListTools),
McpApprovalRequest(MCPApprovalRequest),
McpApprovalResponse(MCPApprovalResponse),
McpCall(MCPToolCall),
CustomToolCallOutput(CustomToolCallOutput),
CustomToolCall(CustomToolCall),
}Expand description
Content item used to generate a response.
This is a properly discriminated union based on the type field, using Rust’s
type-safe enum with serde’s tag attribute for efficient deserialization.
§OpenAPI Specification
Corresponds to the Item schema in the OpenAPI spec with a type discriminator.
Variants§
Message(MessageItem)
A message (type: “message”). Can represent InputMessage (user/system/developer) or OutputMessage (assistant).
InputMessage: A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. OutputMessage: A message output from the model.
FileSearchCall(FileSearchToolCall)
The results of a file search tool call. See the file search guide for more information.
ComputerCall(ComputerToolCall)
A tool call to a computer use tool. See the computer use guide for more information.
ComputerCallOutput(ComputerCallOutputItemParam)
The output of a computer tool call.
WebSearchCall(WebSearchToolCall)
The results of a web search tool call. See the web search guide for more information.
FunctionCall(FunctionToolCall)
A tool call to run a function. See the
function calling guide for more information.
FunctionCallOutput(FunctionCallOutputItemParam)
The output of a function tool call.
Reasoning(ReasoningItem)
A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
ImageGenerationCall(ImageGenToolCall)
An image generation request made by the model.
CodeInterpreterCall(CodeInterpreterToolCall)
A tool call to run code.
LocalShellCall(LocalShellToolCall)
A tool call to run a command on the local shell.
LocalShellCallOutput(LocalShellToolCallOutput)
The output of a local shell tool call.
McpListTools(MCPListTools)
A list of tools available on an MCP server.
McpApprovalRequest(MCPApprovalRequest)
A request for human approval of a tool invocation.
McpApprovalResponse(MCPApprovalResponse)
A response to an MCP approval request.
McpCall(MCPToolCall)
An invocation of a tool on an MCP server.
CustomToolCallOutput(CustomToolCallOutput)
The output of a custom tool call from your code, being sent back to the model.
CustomToolCall(CustomToolCall)
A call to a custom tool created by the model.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Item
impl<'de> Deserialize<'de> for Item
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>,
impl StructuralPartialEq for Item
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnwindSafe for Item
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)