Class ResponseInputItem
-
- All Implemented Interfaces:
public final class ResponseInputItemA message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResponseInputItem.VisitorAn interface that defines how to map each variant of ResponseInputItem to a value of type T.
public final classResponseInputItem.MessageA message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.public final classResponseInputItem.ComputerCallOutputThe output of a computer tool call.
public final classResponseInputItem.FunctionCallOutputThe output of a function tool call.
public final classResponseInputItem.ImageGenerationCallAn image generation request made by the model.
public final classResponseInputItem.LocalShellCallA tool call to run a command on the local shell.
public final classResponseInputItem.LocalShellCallOutputThe output of a local shell tool call.
public final classResponseInputItem.McpListToolsA list of tools available on an MCP server.
public final classResponseInputItem.McpApprovalRequestA request for human approval of a tool invocation.
public final classResponseInputItem.McpApprovalResponseA response to an MCP approval request.
public final classResponseInputItem.McpCallAn invocation of a tool on an MCP server.
public final classResponseInputItem.ItemReferenceAn internal identifier for an item to reference.
-
Method Summary
Modifier and Type Method Description final Optional<EasyInputMessage>easyInputMessage()A message input to the model with a role indicating instruction following hierarchy. final Optional<ResponseInputItem.Message>message()A message input to the model with a role indicating instruction following hierarchy. final Optional<ResponseOutputMessage>responseOutputMessage()An output message from the model. final Optional<ResponseFileSearchToolCall>fileSearchCall()The results of a file search tool call. final Optional<ResponseComputerToolCall>computerCall()A tool call to a computer use tool. final Optional<ResponseInputItem.ComputerCallOutput>computerCallOutput()The output of a computer tool call. final Optional<ResponseFunctionWebSearch>webSearchCall()The results of a web search tool call. final Optional<ResponseFunctionToolCall>functionCall()A tool call to run a function. final Optional<ResponseInputItem.FunctionCallOutput>functionCallOutput()The output of a function tool call. final Optional<ResponseReasoningItem>reasoning()A description of the chain of thought used by a reasoning model while generating a response. final Optional<ResponseInputItem.ImageGenerationCall>imageGenerationCall()An image generation request made by the model. final Optional<ResponseCodeInterpreterToolCall>codeInterpreterCall()A tool call to run code. final Optional<ResponseInputItem.LocalShellCall>localShellCall()A tool call to run a command on the local shell. final Optional<ResponseInputItem.LocalShellCallOutput>localShellCallOutput()The output of a local shell tool call. final Optional<ResponseInputItem.McpListTools>mcpListTools()A list of tools available on an MCP server. final Optional<ResponseInputItem.McpApprovalRequest>mcpApprovalRequest()A request for human approval of a tool invocation. final Optional<ResponseInputItem.McpApprovalResponse>mcpApprovalResponse()A response to an MCP approval request. final Optional<ResponseInputItem.McpCall>mcpCall()An invocation of a tool on an MCP server. final Optional<ResponseCustomToolCallOutput>customToolCallOutput()The output of a custom tool call from your code, being sent back to the model. final Optional<ResponseCustomToolCall>customToolCall()A call to a custom tool created by the model. final Optional<ResponseInputItem.ItemReference>itemReference()An internal identifier for an item to reference. final BooleanisEasyInputMessage()final BooleanisMessage()final BooleanisResponseOutputMessage()final BooleanisFileSearchCall()final BooleanisComputerCall()final BooleanisComputerCallOutput()final BooleanisWebSearchCall()final BooleanisFunctionCall()final BooleanisFunctionCallOutput()final BooleanisReasoning()final BooleanisImageGenerationCall()final BooleanisCodeInterpreterCall()final BooleanisLocalShellCall()final BooleanisLocalShellCallOutput()final BooleanisMcpListTools()final BooleanisMcpApprovalRequest()final BooleanisMcpApprovalResponse()final BooleanisMcpCall()final BooleanisCustomToolCallOutput()final BooleanisCustomToolCall()final BooleanisItemReference()final EasyInputMessageasEasyInputMessage()A message input to the model with a role indicating instruction following hierarchy. final ResponseInputItem.MessageasMessage()A message input to the model with a role indicating instruction following hierarchy. final ResponseOutputMessageasResponseOutputMessage()An output message from the model. final ResponseFileSearchToolCallasFileSearchCall()The results of a file search tool call. final ResponseComputerToolCallasComputerCall()A tool call to a computer use tool. final ResponseInputItem.ComputerCallOutputasComputerCallOutput()The output of a computer tool call. final ResponseFunctionWebSearchasWebSearchCall()The results of a web search tool call. final ResponseFunctionToolCallasFunctionCall()A tool call to run a function. final ResponseInputItem.FunctionCallOutputasFunctionCallOutput()The output of a function tool call. final ResponseReasoningItemasReasoning()A description of the chain of thought used by a reasoning model while generating a response. final ResponseInputItem.ImageGenerationCallasImageGenerationCall()An image generation request made by the model. final ResponseCodeInterpreterToolCallasCodeInterpreterCall()A tool call to run code. final ResponseInputItem.LocalShellCallasLocalShellCall()A tool call to run a command on the local shell. final ResponseInputItem.LocalShellCallOutputasLocalShellCallOutput()The output of a local shell tool call. final ResponseInputItem.McpListToolsasMcpListTools()A list of tools available on an MCP server. final ResponseInputItem.McpApprovalRequestasMcpApprovalRequest()A request for human approval of a tool invocation. final ResponseInputItem.McpApprovalResponseasMcpApprovalResponse()A response to an MCP approval request. final ResponseInputItem.McpCallasMcpCall()An invocation of a tool on an MCP server. final ResponseCustomToolCallOutputasCustomToolCallOutput()The output of a custom tool call from your code, being sent back to the model. final ResponseCustomToolCallasCustomToolCall()A call to a custom tool created by the model. final ResponseInputItem.ItemReferenceasItemReference()An internal identifier for an item to reference. final Optional<JsonValue>_json()final <T extends Any> Taccept(ResponseInputItem.Visitor<T> visitor)final ResponseInputItemvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ResponseInputItemofEasyInputMessage(EasyInputMessage easyInputMessage)A message input to the model with a role indicating instruction following hierarchy. final static ResponseInputItemofMessage(ResponseInputItem.Message message)A message input to the model with a role indicating instruction following hierarchy. final static ResponseInputItemofResponseOutputMessage(ResponseOutputMessage responseOutputMessage)An output message from the model. final static ResponseInputItemofFileSearchCall(ResponseFileSearchToolCall fileSearchCall)The results of a file search tool call. final static ResponseInputItemofComputerCall(ResponseComputerToolCall computerCall)A tool call to a computer use tool. final static ResponseInputItemofComputerCallOutput(ResponseInputItem.ComputerCallOutput computerCallOutput)The output of a computer tool call. final static ResponseInputItemofWebSearchCall(ResponseFunctionWebSearch webSearchCall)The results of a web search tool call. final static ResponseInputItemofFunctionCall(ResponseFunctionToolCall functionCall)A tool call to run a function. final static ResponseInputItemofFunctionCallOutput(ResponseInputItem.FunctionCallOutput functionCallOutput)The output of a function tool call. final static ResponseInputItemofReasoning(ResponseReasoningItem reasoning)A description of the chain of thought used by a reasoning model while generating a response. final static ResponseInputItemofImageGenerationCall(ResponseInputItem.ImageGenerationCall imageGenerationCall)An image generation request made by the model. final static ResponseInputItemofCodeInterpreterCall(ResponseCodeInterpreterToolCall codeInterpreterCall)A tool call to run code. final static ResponseInputItemofLocalShellCall(ResponseInputItem.LocalShellCall localShellCall)A tool call to run a command on the local shell. final static ResponseInputItemofLocalShellCallOutput(ResponseInputItem.LocalShellCallOutput localShellCallOutput)The output of a local shell tool call. final static ResponseInputItemofMcpListTools(ResponseInputItem.McpListTools mcpListTools)A list of tools available on an MCP server. final static ResponseInputItemofMcpApprovalRequest(ResponseInputItem.McpApprovalRequest mcpApprovalRequest)A request for human approval of a tool invocation. final static ResponseInputItemofMcpApprovalResponse(ResponseInputItem.McpApprovalResponse mcpApprovalResponse)A response to an MCP approval request. final static ResponseInputItemofMcpCall(ResponseInputItem.McpCall mcpCall)An invocation of a tool on an MCP server. final static ResponseInputItemofCustomToolCallOutput(ResponseCustomToolCallOutput customToolCallOutput)The output of a custom tool call from your code, being sent back to the model. final static ResponseInputItemofCustomToolCall(ResponseCustomToolCall customToolCall)A call to a custom tool created by the model. final static ResponseInputItemofItemReference(ResponseInputItem.ItemReference itemReference)An internal identifier for an item to reference. -
-
Method Detail
-
easyInputMessage
final Optional<EasyInputMessage> easyInputMessage()
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.
-
message
final Optional<ResponseInputItem.Message> message()
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.
-
responseOutputMessage
final Optional<ResponseOutputMessage> responseOutputMessage()
An output message from the model.
-
fileSearchCall
final Optional<ResponseFileSearchToolCall> fileSearchCall()
The results of a file search tool call. See the file search guide for more information.
-
computerCall
final Optional<ResponseComputerToolCall> computerCall()
A tool call to a computer use tool. See the computer use guide for more information.
-
computerCallOutput
final Optional<ResponseInputItem.ComputerCallOutput> computerCallOutput()
The output of a computer tool call.
-
webSearchCall
final Optional<ResponseFunctionWebSearch> webSearchCall()
The results of a web search tool call. See the web search guide for more information.
-
functionCall
final Optional<ResponseFunctionToolCall> functionCall()
A tool call to run a function. See the function calling guide for more information.
-
functionCallOutput
final Optional<ResponseInputItem.FunctionCallOutput> functionCallOutput()
The output of a function tool call.
-
reasoning
final Optional<ResponseReasoningItem> reasoning()
A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.
-
imageGenerationCall
final Optional<ResponseInputItem.ImageGenerationCall> imageGenerationCall()
An image generation request made by the model.
-
codeInterpreterCall
final Optional<ResponseCodeInterpreterToolCall> codeInterpreterCall()
A tool call to run code.
-
localShellCall
final Optional<ResponseInputItem.LocalShellCall> localShellCall()
A tool call to run a command on the local shell.
-
localShellCallOutput
final Optional<ResponseInputItem.LocalShellCallOutput> localShellCallOutput()
The output of a local shell tool call.
-
mcpListTools
final Optional<ResponseInputItem.McpListTools> mcpListTools()
A list of tools available on an MCP server.
-
mcpApprovalRequest
final Optional<ResponseInputItem.McpApprovalRequest> mcpApprovalRequest()
A request for human approval of a tool invocation.
-
mcpApprovalResponse
final Optional<ResponseInputItem.McpApprovalResponse> mcpApprovalResponse()
A response to an MCP approval request.
-
mcpCall
final Optional<ResponseInputItem.McpCall> mcpCall()
An invocation of a tool on an MCP server.
-
customToolCallOutput
final Optional<ResponseCustomToolCallOutput> customToolCallOutput()
The output of a custom tool call from your code, being sent back to the model.
-
customToolCall
final Optional<ResponseCustomToolCall> customToolCall()
A call to a custom tool created by the model.
-
itemReference
final Optional<ResponseInputItem.ItemReference> itemReference()
An internal identifier for an item to reference.
-
isEasyInputMessage
final Boolean isEasyInputMessage()
-
isResponseOutputMessage
final Boolean isResponseOutputMessage()
-
isFileSearchCall
final Boolean isFileSearchCall()
-
isComputerCall
final Boolean isComputerCall()
-
isComputerCallOutput
final Boolean isComputerCallOutput()
-
isWebSearchCall
final Boolean isWebSearchCall()
-
isFunctionCall
final Boolean isFunctionCall()
-
isFunctionCallOutput
final Boolean isFunctionCallOutput()
-
isReasoning
final Boolean isReasoning()
-
isImageGenerationCall
final Boolean isImageGenerationCall()
-
isCodeInterpreterCall
final Boolean isCodeInterpreterCall()
-
isLocalShellCall
final Boolean isLocalShellCall()
-
isLocalShellCallOutput
final Boolean isLocalShellCallOutput()
-
isMcpListTools
final Boolean isMcpListTools()
-
isMcpApprovalRequest
final Boolean isMcpApprovalRequest()
-
isMcpApprovalResponse
final Boolean isMcpApprovalResponse()
-
isCustomToolCallOutput
final Boolean isCustomToolCallOutput()
-
isCustomToolCall
final Boolean isCustomToolCall()
-
isItemReference
final Boolean isItemReference()
-
asEasyInputMessage
final EasyInputMessage asEasyInputMessage()
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.
-
asMessage
final ResponseInputItem.Message asMessage()
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.
-
asResponseOutputMessage
final ResponseOutputMessage asResponseOutputMessage()
An output message from the model.
-
asFileSearchCall
final ResponseFileSearchToolCall asFileSearchCall()
The results of a file search tool call. See the file search guide for more information.
-
asComputerCall
final ResponseComputerToolCall asComputerCall()
A tool call to a computer use tool. See the computer use guide for more information.
-
asComputerCallOutput
final ResponseInputItem.ComputerCallOutput asComputerCallOutput()
The output of a computer tool call.
-
asWebSearchCall
final ResponseFunctionWebSearch asWebSearchCall()
The results of a web search tool call. See the web search guide for more information.
-
asFunctionCall
final ResponseFunctionToolCall asFunctionCall()
A tool call to run a function. See the function calling guide for more information.
-
asFunctionCallOutput
final ResponseInputItem.FunctionCallOutput asFunctionCallOutput()
The output of a function tool call.
-
asReasoning
final ResponseReasoningItem asReasoning()
A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.
-
asImageGenerationCall
final ResponseInputItem.ImageGenerationCall asImageGenerationCall()
An image generation request made by the model.
-
asCodeInterpreterCall
final ResponseCodeInterpreterToolCall asCodeInterpreterCall()
A tool call to run code.
-
asLocalShellCall
final ResponseInputItem.LocalShellCall asLocalShellCall()
A tool call to run a command on the local shell.
-
asLocalShellCallOutput
final ResponseInputItem.LocalShellCallOutput asLocalShellCallOutput()
The output of a local shell tool call.
-
asMcpListTools
final ResponseInputItem.McpListTools asMcpListTools()
A list of tools available on an MCP server.
-
asMcpApprovalRequest
final ResponseInputItem.McpApprovalRequest asMcpApprovalRequest()
A request for human approval of a tool invocation.
-
asMcpApprovalResponse
final ResponseInputItem.McpApprovalResponse asMcpApprovalResponse()
A response to an MCP approval request.
-
asMcpCall
final ResponseInputItem.McpCall asMcpCall()
An invocation of a tool on an MCP server.
-
asCustomToolCallOutput
final ResponseCustomToolCallOutput asCustomToolCallOutput()
The output of a custom tool call from your code, being sent back to the model.
-
asCustomToolCall
final ResponseCustomToolCall asCustomToolCall()
A call to a custom tool created by the model.
-
asItemReference
final ResponseInputItem.ItemReference asItemReference()
An internal identifier for an item to reference.
-
accept
final <T extends Any> T accept(ResponseInputItem.Visitor<T> visitor)
-
validate
final ResponseInputItem validate()
-
ofEasyInputMessage
final static ResponseInputItem ofEasyInputMessage(EasyInputMessage easyInputMessage)
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.
-
ofMessage
final static ResponseInputItem ofMessage(ResponseInputItem.Message message)
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.
-
ofResponseOutputMessage
final static ResponseInputItem ofResponseOutputMessage(ResponseOutputMessage responseOutputMessage)
An output message from the model.
-
ofFileSearchCall
final static ResponseInputItem ofFileSearchCall(ResponseFileSearchToolCall fileSearchCall)
The results of a file search tool call. See the file search guide for more information.
-
ofComputerCall
final static ResponseInputItem ofComputerCall(ResponseComputerToolCall computerCall)
A tool call to a computer use tool. See the computer use guide for more information.
-
ofComputerCallOutput
final static ResponseInputItem ofComputerCallOutput(ResponseInputItem.ComputerCallOutput computerCallOutput)
The output of a computer tool call.
-
ofWebSearchCall
final static ResponseInputItem ofWebSearchCall(ResponseFunctionWebSearch webSearchCall)
The results of a web search tool call. See the web search guide for more information.
-
ofFunctionCall
final static ResponseInputItem ofFunctionCall(ResponseFunctionToolCall functionCall)
A tool call to run a function. See the function calling guide for more information.
-
ofFunctionCallOutput
final static ResponseInputItem ofFunctionCallOutput(ResponseInputItem.FunctionCallOutput functionCallOutput)
The output of a function tool call.
-
ofReasoning
final static ResponseInputItem ofReasoning(ResponseReasoningItem reasoning)
A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.
-
ofImageGenerationCall
final static ResponseInputItem ofImageGenerationCall(ResponseInputItem.ImageGenerationCall imageGenerationCall)
An image generation request made by the model.
-
ofCodeInterpreterCall
final static ResponseInputItem ofCodeInterpreterCall(ResponseCodeInterpreterToolCall codeInterpreterCall)
A tool call to run code.
-
ofLocalShellCall
final static ResponseInputItem ofLocalShellCall(ResponseInputItem.LocalShellCall localShellCall)
A tool call to run a command on the local shell.
-
ofLocalShellCallOutput
final static ResponseInputItem ofLocalShellCallOutput(ResponseInputItem.LocalShellCallOutput localShellCallOutput)
The output of a local shell tool call.
-
ofMcpListTools
final static ResponseInputItem ofMcpListTools(ResponseInputItem.McpListTools mcpListTools)
A list of tools available on an MCP server.
-
ofMcpApprovalRequest
final static ResponseInputItem ofMcpApprovalRequest(ResponseInputItem.McpApprovalRequest mcpApprovalRequest)
A request for human approval of a tool invocation.
-
ofMcpApprovalResponse
final static ResponseInputItem ofMcpApprovalResponse(ResponseInputItem.McpApprovalResponse mcpApprovalResponse)
A response to an MCP approval request.
-
ofMcpCall
final static ResponseInputItem ofMcpCall(ResponseInputItem.McpCall mcpCall)
An invocation of a tool on an MCP server.
-
ofCustomToolCallOutput
final static ResponseInputItem ofCustomToolCallOutput(ResponseCustomToolCallOutput customToolCallOutput)
The output of a custom tool call from your code, being sent back to the model.
-
ofCustomToolCall
final static ResponseInputItem ofCustomToolCall(ResponseCustomToolCall customToolCall)
A call to a custom tool created by the model.
-
ofItemReference
final static ResponseInputItem ofItemReference(ResponseInputItem.ItemReference itemReference)
An internal identifier for an item to reference.
-
-
-
-