Class ResponseItem
-
- All Implemented Interfaces:
public final class ResponseItem
Content item used to generate a response.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ResponseItem.Visitor
An interface that defines how to map each variant of ResponseItem to a value of type T.
public final class
ResponseItem.ImageGenerationCall
An image generation request made by the model.
public final class
ResponseItem.LocalShellCall
A tool call to run a command on the local shell.
public final class
ResponseItem.LocalShellCallOutput
The output of a local shell tool call.
public final class
ResponseItem.McpListTools
A list of tools available on an MCP server.
public final class
ResponseItem.McpApprovalRequest
A request for human approval of a tool invocation.
public final class
ResponseItem.McpApprovalResponse
A response to an MCP approval request.
public final class
ResponseItem.McpCall
An invocation of a tool on an MCP server.
-
Method Summary
-
-
Method Detail
-
responseInputMessageItem
final Optional<ResponseInputMessageItem> responseInputMessageItem()
-
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<ResponseComputerToolCallOutputItem> computerCallOutput()
-
webSearchCall
final Optional<ResponseFunctionWebSearch> webSearchCall()
The results of a web search tool call. See the web search guide for more information.
-
functionCall
final Optional<ResponseFunctionToolCallItem> functionCall()
A tool call to run a function. See the function calling guide for more information.
-
functionCallOutput
final Optional<ResponseFunctionToolCallOutputItem> functionCallOutput()
-
imageGenerationCall
final Optional<ResponseItem.ImageGenerationCall> imageGenerationCall()
An image generation request made by the model.
-
codeInterpreterCall
final Optional<ResponseCodeInterpreterToolCall> codeInterpreterCall()
A tool call to run code.
-
localShellCall
final Optional<ResponseItem.LocalShellCall> localShellCall()
A tool call to run a command on the local shell.
-
localShellCallOutput
final Optional<ResponseItem.LocalShellCallOutput> localShellCallOutput()
The output of a local shell tool call.
-
mcpListTools
final Optional<ResponseItem.McpListTools> mcpListTools()
A list of tools available on an MCP server.
-
mcpApprovalRequest
final Optional<ResponseItem.McpApprovalRequest> mcpApprovalRequest()
A request for human approval of a tool invocation.
-
mcpApprovalResponse
final Optional<ResponseItem.McpApprovalResponse> mcpApprovalResponse()
A response to an MCP approval request.
-
mcpCall
final Optional<ResponseItem.McpCall> mcpCall()
An invocation of a tool on an MCP server.
-
isResponseInputMessageItem
final Boolean isResponseInputMessageItem()
-
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()
-
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()
-
asResponseInputMessageItem
final ResponseInputMessageItem asResponseInputMessageItem()
-
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 ResponseComputerToolCallOutputItem asComputerCallOutput()
-
asWebSearchCall
final ResponseFunctionWebSearch asWebSearchCall()
The results of a web search tool call. See the web search guide for more information.
-
asFunctionCall
final ResponseFunctionToolCallItem asFunctionCall()
A tool call to run a function. See the function calling guide for more information.
-
asFunctionCallOutput
final ResponseFunctionToolCallOutputItem asFunctionCallOutput()
-
asImageGenerationCall
final ResponseItem.ImageGenerationCall asImageGenerationCall()
An image generation request made by the model.
-
asCodeInterpreterCall
final ResponseCodeInterpreterToolCall asCodeInterpreterCall()
A tool call to run code.
-
asLocalShellCall
final ResponseItem.LocalShellCall asLocalShellCall()
A tool call to run a command on the local shell.
-
asLocalShellCallOutput
final ResponseItem.LocalShellCallOutput asLocalShellCallOutput()
The output of a local shell tool call.
-
asMcpListTools
final ResponseItem.McpListTools asMcpListTools()
A list of tools available on an MCP server.
-
asMcpApprovalRequest
final ResponseItem.McpApprovalRequest asMcpApprovalRequest()
A request for human approval of a tool invocation.
-
asMcpApprovalResponse
final ResponseItem.McpApprovalResponse asMcpApprovalResponse()
A response to an MCP approval request.
-
asMcpCall
final ResponseItem.McpCall asMcpCall()
An invocation of a tool on an MCP server.
-
accept
final <T extends Any> T accept(ResponseItem.Visitor<T> visitor)
-
validate
final ResponseItem validate()
-
ofResponseInputMessageItem
final static ResponseItem ofResponseInputMessageItem(ResponseInputMessageItem responseInputMessageItem)
-
ofResponseOutputMessage
final static ResponseItem ofResponseOutputMessage(ResponseOutputMessage responseOutputMessage)
An output message from the model.
-
ofFileSearchCall
final static ResponseItem ofFileSearchCall(ResponseFileSearchToolCall fileSearchCall)
The results of a file search tool call. See the file search guide for more information.
-
ofComputerCall
final static ResponseItem ofComputerCall(ResponseComputerToolCall computerCall)
A tool call to a computer use tool. See the computer use guide for more information.
-
ofComputerCallOutput
final static ResponseItem ofComputerCallOutput(ResponseComputerToolCallOutputItem computerCallOutput)
-
ofWebSearchCall
final static ResponseItem ofWebSearchCall(ResponseFunctionWebSearch webSearchCall)
The results of a web search tool call. See the web search guide for more information.
-
ofFunctionCall
final static ResponseItem ofFunctionCall(ResponseFunctionToolCallItem functionCall)
A tool call to run a function. See the function calling guide for more information.
-
ofFunctionCallOutput
final static ResponseItem ofFunctionCallOutput(ResponseFunctionToolCallOutputItem functionCallOutput)
-
ofImageGenerationCall
final static ResponseItem ofImageGenerationCall(ResponseItem.ImageGenerationCall imageGenerationCall)
An image generation request made by the model.
-
ofCodeInterpreterCall
final static ResponseItem ofCodeInterpreterCall(ResponseCodeInterpreterToolCall codeInterpreterCall)
A tool call to run code.
-
ofLocalShellCall
final static ResponseItem ofLocalShellCall(ResponseItem.LocalShellCall localShellCall)
A tool call to run a command on the local shell.
-
ofLocalShellCallOutput
final static ResponseItem ofLocalShellCallOutput(ResponseItem.LocalShellCallOutput localShellCallOutput)
The output of a local shell tool call.
-
ofMcpListTools
final static ResponseItem ofMcpListTools(ResponseItem.McpListTools mcpListTools)
A list of tools available on an MCP server.
-
ofMcpApprovalRequest
final static ResponseItem ofMcpApprovalRequest(ResponseItem.McpApprovalRequest mcpApprovalRequest)
A request for human approval of a tool invocation.
-
ofMcpApprovalResponse
final static ResponseItem ofMcpApprovalResponse(ResponseItem.McpApprovalResponse mcpApprovalResponse)
A response to an MCP approval request.
-
ofMcpCall
final static ResponseItem ofMcpCall(ResponseItem.McpCall mcpCall)
An invocation of a tool on an MCP server.
-
-
-
-