Class ResponseInputItem
-
- All Implemented Interfaces:
public final class ResponseInputItem
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developer
orsystem
role take precedence over instructions given with theuser
role. Messages with theassistant
role are presumed to have been generated by the model in previous interactions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ResponseInputItem.Visitor
An interface that defines how to map each variant of ResponseInputItem to a value of type T.
public final class
ResponseInputItem.Message
A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developer
orsystem
role take precedence over instructions given with theuser
role.public final class
ResponseInputItem.ComputerCallOutput
The output of a computer tool call.
public final class
ResponseInputItem.FunctionCallOutput
The output of a function tool call.
public final class
ResponseInputItem.ImageGenerationCall
An image generation request made by the model.
public final class
ResponseInputItem.LocalShellCall
A tool call to run a command on the local shell.
public final class
ResponseInputItem.LocalShellCallOutput
The output of a local shell tool call.
public final class
ResponseInputItem.McpListTools
A list of tools available on an MCP server.
public final class
ResponseInputItem.McpApprovalRequest
A request for human approval of a tool invocation.
public final class
ResponseInputItem.McpApprovalResponse
A response to an MCP approval request.
public final class
ResponseInputItem.McpCall
An invocation of a tool on an MCP server.
public final class
ResponseInputItem.ItemReference
An 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<ResponseInputItem.ItemReference>
itemReference()
An internal identifier for an item to reference. final Boolean
isEasyInputMessage()
final Boolean
isMessage()
final Boolean
isResponseOutputMessage()
final Boolean
isFileSearchCall()
final Boolean
isComputerCall()
final Boolean
isComputerCallOutput()
final Boolean
isWebSearchCall()
final Boolean
isFunctionCall()
final Boolean
isFunctionCallOutput()
final Boolean
isReasoning()
final Boolean
isImageGenerationCall()
final Boolean
isCodeInterpreterCall()
final Boolean
isLocalShellCall()
final Boolean
isLocalShellCallOutput()
final Boolean
isMcpListTools()
final Boolean
isMcpApprovalRequest()
final Boolean
isMcpApprovalResponse()
final Boolean
isMcpCall()
final Boolean
isItemReference()
final EasyInputMessage
asEasyInputMessage()
A message input to the model with a role indicating instruction following hierarchy. final ResponseInputItem.Message
asMessage()
A message input to the model with a role indicating instruction following hierarchy. final ResponseOutputMessage
asResponseOutputMessage()
An output message from the model. final ResponseFileSearchToolCall
asFileSearchCall()
The results of a file search tool call. final ResponseComputerToolCall
asComputerCall()
A tool call to a computer use tool. final ResponseInputItem.ComputerCallOutput
asComputerCallOutput()
The output of a computer tool call. final ResponseFunctionWebSearch
asWebSearchCall()
The results of a web search tool call. final ResponseFunctionToolCall
asFunctionCall()
A tool call to run a function. final ResponseInputItem.FunctionCallOutput
asFunctionCallOutput()
The output of a function tool call. final ResponseReasoningItem
asReasoning()
A description of the chain of thought used by a reasoning model while generating a response. final ResponseInputItem.ImageGenerationCall
asImageGenerationCall()
An image generation request made by the model. final ResponseCodeInterpreterToolCall
asCodeInterpreterCall()
A tool call to run code. final ResponseInputItem.LocalShellCall
asLocalShellCall()
A tool call to run a command on the local shell. final ResponseInputItem.LocalShellCallOutput
asLocalShellCallOutput()
The output of a local shell tool call. final ResponseInputItem.McpListTools
asMcpListTools()
A list of tools available on an MCP server. final ResponseInputItem.McpApprovalRequest
asMcpApprovalRequest()
A request for human approval of a tool invocation. final ResponseInputItem.McpApprovalResponse
asMcpApprovalResponse()
A response to an MCP approval request. final ResponseInputItem.McpCall
asMcpCall()
An invocation of a tool on an MCP server. final ResponseInputItem.ItemReference
asItemReference()
An internal identifier for an item to reference. final Optional<JsonValue>
_json()
final <T extends Any> T
accept(ResponseInputItem.Visitor<T> visitor)
final ResponseInputItem
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ResponseInputItem
ofEasyInputMessage(EasyInputMessage easyInputMessage)
A message input to the model with a role indicating instruction following hierarchy. final static ResponseInputItem
ofMessage(ResponseInputItem.Message message)
A message input to the model with a role indicating instruction following hierarchy. final static ResponseInputItem
ofResponseOutputMessage(ResponseOutputMessage responseOutputMessage)
An output message from the model. final static ResponseInputItem
ofFileSearchCall(ResponseFileSearchToolCall fileSearchCall)
The results of a file search tool call. final static ResponseInputItem
ofComputerCall(ResponseComputerToolCall computerCall)
A tool call to a computer use tool. final static ResponseInputItem
ofComputerCallOutput(ResponseInputItem.ComputerCallOutput computerCallOutput)
The output of a computer tool call. final static ResponseInputItem
ofWebSearchCall(ResponseFunctionWebSearch webSearchCall)
The results of a web search tool call. final static ResponseInputItem
ofFunctionCall(ResponseFunctionToolCall functionCall)
A tool call to run a function. final static ResponseInputItem
ofFunctionCallOutput(ResponseInputItem.FunctionCallOutput functionCallOutput)
The output of a function tool call. final static ResponseInputItem
ofReasoning(ResponseReasoningItem reasoning)
A description of the chain of thought used by a reasoning model while generating a response. final static ResponseInputItem
ofImageGenerationCall(ResponseInputItem.ImageGenerationCall imageGenerationCall)
An image generation request made by the model. final static ResponseInputItem
ofCodeInterpreterCall(ResponseCodeInterpreterToolCall codeInterpreterCall)
A tool call to run code. final static ResponseInputItem
ofLocalShellCall(ResponseInputItem.LocalShellCall localShellCall)
A tool call to run a command on the local shell. final static ResponseInputItem
ofLocalShellCallOutput(ResponseInputItem.LocalShellCallOutput localShellCallOutput)
The output of a local shell tool call. final static ResponseInputItem
ofMcpListTools(ResponseInputItem.McpListTools mcpListTools)
A list of tools available on an MCP server. final static ResponseInputItem
ofMcpApprovalRequest(ResponseInputItem.McpApprovalRequest mcpApprovalRequest)
A request for human approval of a tool invocation. final static ResponseInputItem
ofMcpApprovalResponse(ResponseInputItem.McpApprovalResponse mcpApprovalResponse)
A response to an MCP approval request. final static ResponseInputItem
ofMcpCall(ResponseInputItem.McpCall mcpCall)
An invocation of a tool on an MCP server. final static ResponseInputItem
ofItemReference(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
developer
orsystem
role take precedence over instructions given with theuser
role. Messages with theassistant
role 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
developer
orsystem
role take precedence over instructions given with theuser
role.
-
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
input
to 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.
-
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()
-
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
developer
orsystem
role take precedence over instructions given with theuser
role. Messages with theassistant
role 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
developer
orsystem
role take precedence over instructions given with theuser
role.
-
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
input
to 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.
-
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
developer
orsystem
role take precedence over instructions given with theuser
role. Messages with theassistant
role 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
developer
orsystem
role take precedence over instructions given with theuser
role.
-
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
input
to 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.
-
ofItemReference
final static ResponseInputItem ofItemReference(ResponseInputItem.ItemReference itemReference)
An internal identifier for an item to reference.
-
-
-
-