Interface ResponseOutputItem.Visitor
-
- All Implemented Interfaces:
public interface ResponseOutputItem.Visitor<T extends Object>An interface that defines how to map each variant of ResponseOutputItem to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract TvisitMessage(ResponseOutputMessage message)An output message from the model. abstract TvisitFileSearchCall(ResponseFileSearchToolCall fileSearchCall)The results of a file search tool call. abstract TvisitFunctionCall(ResponseFunctionToolCall functionCall)A tool call to run a function. abstract TvisitFunctionCallOutput(ResponseFunctionToolCallOutputItem functionCallOutput)abstract TvisitWebSearchCall(ResponseFunctionWebSearch webSearchCall)The results of a web search tool call. abstract TvisitComputerCall(ResponseComputerToolCall computerCall)A tool call to a computer use tool. abstract TvisitComputerCallOutput(ResponseComputerToolCallOutputItem computerCallOutput)abstract TvisitReasoning(ResponseReasoningItem reasoning)A description of the chain of thought used by a reasoning model while generating a response. abstract TvisitToolSearchCall(ResponseToolSearchCall toolSearchCall)abstract TvisitToolSearchOutput(ResponseToolSearchOutputItem toolSearchOutput)abstract TvisitAdditionalTools(ResponseOutputItem.AdditionalTools additionalTools)abstract TvisitCompaction(ResponseCompactionItem compaction)A compaction item generated by the v1/responses/compactAPI.abstract TvisitImageGenerationCall(ResponseOutputItem.ImageGenerationCall imageGenerationCall)An image generation request made by the model. abstract TvisitCodeInterpreterCall(ResponseCodeInterpreterToolCall codeInterpreterCall)A tool call to run code. abstract TvisitLocalShellCall(ResponseOutputItem.LocalShellCall localShellCall)A tool call to run a command on the local shell. abstract TvisitLocalShellCallOutput(ResponseOutputItem.LocalShellCallOutput localShellCallOutput)The output of a local shell tool call. abstract TvisitShellCall(ResponseFunctionShellToolCall shellCall)A tool call that executes one or more shell commands in a managed environment. abstract TvisitShellCallOutput(ResponseFunctionShellToolCallOutput shellCallOutput)The output of a shell tool call that was emitted. abstract TvisitApplyPatchCall(ResponseApplyPatchToolCall applyPatchCall)A tool call that applies file diffs by creating, deleting, or updating files. abstract TvisitApplyPatchCallOutput(ResponseApplyPatchToolCallOutput applyPatchCallOutput)The output emitted by an apply patch tool call. abstract TvisitMcpCall(ResponseOutputItem.McpCall mcpCall)An invocation of a tool on an MCP server. abstract TvisitMcpListTools(ResponseOutputItem.McpListTools mcpListTools)A list of tools available on an MCP server. abstract TvisitMcpApprovalRequest(ResponseOutputItem.McpApprovalRequest mcpApprovalRequest)A request for human approval of a tool invocation. abstract TvisitMcpApprovalResponse(ResponseOutputItem.McpApprovalResponse mcpApprovalResponse)A response to an MCP approval request. abstract TvisitCustomToolCall(ResponseCustomToolCall customToolCall)A call to a custom tool created by the model. abstract TvisitCustomToolCallOutput(ResponseCustomToolCallOutputItem customToolCallOutput)The output of a custom tool call from your code, being sent back to the model. Tunknown(JsonValue json)Maps an unknown variant of ResponseOutputItem to a value of type T. -
-
Method Detail
-
visitMessage
abstract T visitMessage(ResponseOutputMessage message)
An output message from the model.
-
visitFileSearchCall
abstract T visitFileSearchCall(ResponseFileSearchToolCall fileSearchCall)
The results of a file search tool call. See the file search guide for more information.
-
visitFunctionCall
abstract T visitFunctionCall(ResponseFunctionToolCall functionCall)
A tool call to run a function. See the function calling guide for more information.
-
visitFunctionCallOutput
abstract T visitFunctionCallOutput(ResponseFunctionToolCallOutputItem functionCallOutput)
-
visitWebSearchCall
abstract T visitWebSearchCall(ResponseFunctionWebSearch webSearchCall)
The results of a web search tool call. See the web search guide for more information.
-
visitComputerCall
abstract T visitComputerCall(ResponseComputerToolCall computerCall)
A tool call to a computer use tool. See the computer use guide for more information.
-
visitComputerCallOutput
abstract T visitComputerCallOutput(ResponseComputerToolCallOutputItem computerCallOutput)
-
visitReasoning
abstract T visitReasoning(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.
-
visitToolSearchCall
abstract T visitToolSearchCall(ResponseToolSearchCall toolSearchCall)
-
visitToolSearchOutput
abstract T visitToolSearchOutput(ResponseToolSearchOutputItem toolSearchOutput)
-
visitAdditionalTools
abstract T visitAdditionalTools(ResponseOutputItem.AdditionalTools additionalTools)
-
visitCompaction
abstract T visitCompaction(ResponseCompactionItem compaction)
A compaction item generated by the
v1/responses/compactAPI.
-
visitImageGenerationCall
abstract T visitImageGenerationCall(ResponseOutputItem.ImageGenerationCall imageGenerationCall)
An image generation request made by the model.
-
visitCodeInterpreterCall
abstract T visitCodeInterpreterCall(ResponseCodeInterpreterToolCall codeInterpreterCall)
A tool call to run code.
-
visitLocalShellCall
abstract T visitLocalShellCall(ResponseOutputItem.LocalShellCall localShellCall)
A tool call to run a command on the local shell.
-
visitLocalShellCallOutput
abstract T visitLocalShellCallOutput(ResponseOutputItem.LocalShellCallOutput localShellCallOutput)
The output of a local shell tool call.
-
visitShellCall
abstract T visitShellCall(ResponseFunctionShellToolCall shellCall)
A tool call that executes one or more shell commands in a managed environment.
-
visitShellCallOutput
abstract T visitShellCallOutput(ResponseFunctionShellToolCallOutput shellCallOutput)
The output of a shell tool call that was emitted.
-
visitApplyPatchCall
abstract T visitApplyPatchCall(ResponseApplyPatchToolCall applyPatchCall)
A tool call that applies file diffs by creating, deleting, or updating files.
-
visitApplyPatchCallOutput
abstract T visitApplyPatchCallOutput(ResponseApplyPatchToolCallOutput applyPatchCallOutput)
The output emitted by an apply patch tool call.
-
visitMcpCall
abstract T visitMcpCall(ResponseOutputItem.McpCall mcpCall)
An invocation of a tool on an MCP server.
-
visitMcpListTools
abstract T visitMcpListTools(ResponseOutputItem.McpListTools mcpListTools)
A list of tools available on an MCP server.
-
visitMcpApprovalRequest
abstract T visitMcpApprovalRequest(ResponseOutputItem.McpApprovalRequest mcpApprovalRequest)
A request for human approval of a tool invocation.
-
visitMcpApprovalResponse
abstract T visitMcpApprovalResponse(ResponseOutputItem.McpApprovalResponse mcpApprovalResponse)
A response to an MCP approval request.
-
visitCustomToolCall
abstract T visitCustomToolCall(ResponseCustomToolCall customToolCall)
A call to a custom tool created by the model.
-
visitCustomToolCallOutput
abstract T visitCustomToolCallOutput(ResponseCustomToolCallOutputItem customToolCallOutput)
The output of a custom tool call from your code, being sent back to the model.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of ResponseOutputItem to a value of type T.
An instance of ResponseOutputItem can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of.
-
-
-
-