Class ResponseOutputItem
-
- All Implemented Interfaces:
public final class ResponseOutputItem
An output message from the model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ResponseOutputItem.Visitor
An interface that defines how to map each variant of ResponseOutputItem to a value of type T.
public final class
ResponseOutputItem.ImageGenerationCall
An image generation request made by the model.
public final class
ResponseOutputItem.LocalShellCall
A tool call to run a command on the local shell.
public final class
ResponseOutputItem.McpCall
An invocation of a tool on an MCP server.
public final class
ResponseOutputItem.McpListTools
A list of tools available on an MCP server.
public final class
ResponseOutputItem.McpApprovalRequest
A request for human approval of a tool invocation.
-
Method Summary
Modifier and Type Method Description final Optional<ResponseOutputMessage>
message()
An output message from the model. final Optional<ResponseFileSearchToolCall>
fileSearchCall()
The results of a file search tool call. final Optional<ResponseFunctionToolCall>
functionCall()
A tool call to run a function. final Optional<ResponseFunctionWebSearch>
webSearchCall()
The results of a web search tool call. final Optional<ResponseComputerToolCall>
computerCall()
A tool call to a computer use tool. final Optional<ResponseReasoningItem>
reasoning()
A description of the chain of thought used by a reasoning model while generating a response. final Optional<ResponseOutputItem.ImageGenerationCall>
imageGenerationCall()
An image generation request made by the model. final Optional<ResponseCodeInterpreterToolCall>
codeInterpreterCall()
A tool call to run code. final Optional<ResponseOutputItem.LocalShellCall>
localShellCall()
A tool call to run a command on the local shell. final Optional<ResponseOutputItem.McpCall>
mcpCall()
An invocation of a tool on an MCP server. final Optional<ResponseOutputItem.McpListTools>
mcpListTools()
A list of tools available on an MCP server. final Optional<ResponseOutputItem.McpApprovalRequest>
mcpApprovalRequest()
A request for human approval of a tool invocation. final Boolean
isMessage()
final Boolean
isFileSearchCall()
final Boolean
isFunctionCall()
final Boolean
isWebSearchCall()
final Boolean
isComputerCall()
final Boolean
isReasoning()
final Boolean
isImageGenerationCall()
final Boolean
isCodeInterpreterCall()
final Boolean
isLocalShellCall()
final Boolean
isMcpCall()
final Boolean
isMcpListTools()
final Boolean
isMcpApprovalRequest()
final ResponseOutputMessage
asMessage()
An output message from the model. final ResponseFileSearchToolCall
asFileSearchCall()
The results of a file search tool call. final ResponseFunctionToolCall
asFunctionCall()
A tool call to run a function. final ResponseFunctionWebSearch
asWebSearchCall()
The results of a web search tool call. final ResponseComputerToolCall
asComputerCall()
A tool call to a computer use tool. final ResponseReasoningItem
asReasoning()
A description of the chain of thought used by a reasoning model while generating a response. final ResponseOutputItem.ImageGenerationCall
asImageGenerationCall()
An image generation request made by the model. final ResponseCodeInterpreterToolCall
asCodeInterpreterCall()
A tool call to run code. final ResponseOutputItem.LocalShellCall
asLocalShellCall()
A tool call to run a command on the local shell. final ResponseOutputItem.McpCall
asMcpCall()
An invocation of a tool on an MCP server. final ResponseOutputItem.McpListTools
asMcpListTools()
A list of tools available on an MCP server. final ResponseOutputItem.McpApprovalRequest
asMcpApprovalRequest()
A request for human approval of a tool invocation. final Optional<JsonValue>
_json()
final <T extends Any> T
accept(ResponseOutputItem.Visitor<T> visitor)
final ResponseOutputItem
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ResponseOutputItem
ofMessage(ResponseOutputMessage message)
An output message from the model. final static ResponseOutputItem
ofFileSearchCall(ResponseFileSearchToolCall fileSearchCall)
The results of a file search tool call. final static ResponseOutputItem
ofFunctionCall(ResponseFunctionToolCall functionCall)
A tool call to run a function. final static ResponseOutputItem
ofWebSearchCall(ResponseFunctionWebSearch webSearchCall)
The results of a web search tool call. final static ResponseOutputItem
ofComputerCall(ResponseComputerToolCall computerCall)
A tool call to a computer use tool. final static ResponseOutputItem
ofReasoning(ResponseReasoningItem reasoning)
A description of the chain of thought used by a reasoning model while generating a response. final static ResponseOutputItem
ofImageGenerationCall(ResponseOutputItem.ImageGenerationCall imageGenerationCall)
An image generation request made by the model. final static ResponseOutputItem
ofCodeInterpreterCall(ResponseCodeInterpreterToolCall codeInterpreterCall)
A tool call to run code. final static ResponseOutputItem
ofLocalShellCall(ResponseOutputItem.LocalShellCall localShellCall)
A tool call to run a command on the local shell. final static ResponseOutputItem
ofMcpCall(ResponseOutputItem.McpCall mcpCall)
An invocation of a tool on an MCP server. final static ResponseOutputItem
ofMcpListTools(ResponseOutputItem.McpListTools mcpListTools)
A list of tools available on an MCP server. final static ResponseOutputItem
ofMcpApprovalRequest(ResponseOutputItem.McpApprovalRequest mcpApprovalRequest)
A request for human approval of a tool invocation. -
-
Method Detail
-
message
final Optional<ResponseOutputMessage> message()
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.
-
functionCall
final Optional<ResponseFunctionToolCall> functionCall()
A tool call to run a function. See the function calling guide for more information.
-
webSearchCall
final Optional<ResponseFunctionWebSearch> webSearchCall()
The results of a web search tool call. See the web 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.
-
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<ResponseOutputItem.ImageGenerationCall> imageGenerationCall()
An image generation request made by the model.
-
codeInterpreterCall
final Optional<ResponseCodeInterpreterToolCall> codeInterpreterCall()
A tool call to run code.
-
localShellCall
final Optional<ResponseOutputItem.LocalShellCall> localShellCall()
A tool call to run a command on the local shell.
-
mcpCall
final Optional<ResponseOutputItem.McpCall> mcpCall()
An invocation of a tool on an MCP server.
-
mcpListTools
final Optional<ResponseOutputItem.McpListTools> mcpListTools()
A list of tools available on an MCP server.
-
mcpApprovalRequest
final Optional<ResponseOutputItem.McpApprovalRequest> mcpApprovalRequest()
A request for human approval of a tool invocation.
-
isFileSearchCall
final Boolean isFileSearchCall()
-
isFunctionCall
final Boolean isFunctionCall()
-
isWebSearchCall
final Boolean isWebSearchCall()
-
isComputerCall
final Boolean isComputerCall()
-
isReasoning
final Boolean isReasoning()
-
isImageGenerationCall
final Boolean isImageGenerationCall()
-
isCodeInterpreterCall
final Boolean isCodeInterpreterCall()
-
isLocalShellCall
final Boolean isLocalShellCall()
-
isMcpListTools
final Boolean isMcpListTools()
-
isMcpApprovalRequest
final Boolean isMcpApprovalRequest()
-
asMessage
final ResponseOutputMessage asMessage()
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.
-
asFunctionCall
final ResponseFunctionToolCall asFunctionCall()
A tool call to run a function. See the function calling guide for more information.
-
asWebSearchCall
final ResponseFunctionWebSearch asWebSearchCall()
The results of a web search tool call. See the web 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.
-
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 ResponseOutputItem.ImageGenerationCall asImageGenerationCall()
An image generation request made by the model.
-
asCodeInterpreterCall
final ResponseCodeInterpreterToolCall asCodeInterpreterCall()
A tool call to run code.
-
asLocalShellCall
final ResponseOutputItem.LocalShellCall asLocalShellCall()
A tool call to run a command on the local shell.
-
asMcpCall
final ResponseOutputItem.McpCall asMcpCall()
An invocation of a tool on an MCP server.
-
asMcpListTools
final ResponseOutputItem.McpListTools asMcpListTools()
A list of tools available on an MCP server.
-
asMcpApprovalRequest
final ResponseOutputItem.McpApprovalRequest asMcpApprovalRequest()
A request for human approval of a tool invocation.
-
accept
final <T extends Any> T accept(ResponseOutputItem.Visitor<T> visitor)
-
validate
final ResponseOutputItem validate()
-
ofMessage
final static ResponseOutputItem ofMessage(ResponseOutputMessage message)
An output message from the model.
-
ofFileSearchCall
final static ResponseOutputItem ofFileSearchCall(ResponseFileSearchToolCall fileSearchCall)
The results of a file search tool call. See the file search guide for more information.
-
ofFunctionCall
final static ResponseOutputItem ofFunctionCall(ResponseFunctionToolCall functionCall)
A tool call to run a function. See the function calling guide for more information.
-
ofWebSearchCall
final static ResponseOutputItem ofWebSearchCall(ResponseFunctionWebSearch webSearchCall)
The results of a web search tool call. See the web search guide for more information.
-
ofComputerCall
final static ResponseOutputItem ofComputerCall(ResponseComputerToolCall computerCall)
A tool call to a computer use tool. See the computer use guide for more information.
-
ofReasoning
final static ResponseOutputItem 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 ResponseOutputItem ofImageGenerationCall(ResponseOutputItem.ImageGenerationCall imageGenerationCall)
An image generation request made by the model.
-
ofCodeInterpreterCall
final static ResponseOutputItem ofCodeInterpreterCall(ResponseCodeInterpreterToolCall codeInterpreterCall)
A tool call to run code.
-
ofLocalShellCall
final static ResponseOutputItem ofLocalShellCall(ResponseOutputItem.LocalShellCall localShellCall)
A tool call to run a command on the local shell.
-
ofMcpCall
final static ResponseOutputItem ofMcpCall(ResponseOutputItem.McpCall mcpCall)
An invocation of a tool on an MCP server.
-
ofMcpListTools
final static ResponseOutputItem ofMcpListTools(ResponseOutputItem.McpListTools mcpListTools)
A list of tools available on an MCP server.
-
ofMcpApprovalRequest
final static ResponseOutputItem ofMcpApprovalRequest(ResponseOutputItem.McpApprovalRequest mcpApprovalRequest)
A request for human approval of a tool invocation.
-
-
-
-