Class BetaResponseInputItem
-
- All Implemented Interfaces:
public final class BetaResponseInputItemA 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 interfaceBetaResponseInputItem.VisitorAn interface that defines how to map each variant of BetaResponseInputItem to a value of type T.
public final classBetaResponseInputItem.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 classBetaResponseInputItem.ComputerCallOutputThe output of a computer tool call.
public final classBetaResponseInputItem.FunctionCallOutputThe output of a function tool call.
public final classBetaResponseInputItem.AgentMessageA message routed between agents.
public final classBetaResponseInputItem.MultiAgentCallpublic final classBetaResponseInputItem.MultiAgentCallOutputpublic final classBetaResponseInputItem.ToolSearchCallpublic final classBetaResponseInputItem.AdditionalToolspublic final classBetaResponseInputItem.ImageGenerationCallAn image generation request made by the model.
public final classBetaResponseInputItem.LocalShellCallA tool call to run a command on the local shell.
public final classBetaResponseInputItem.LocalShellCallOutputThe output of a local shell tool call.
public final classBetaResponseInputItem.ShellCallA tool representing a request to execute one or more shell commands.
public final classBetaResponseInputItem.ShellCallOutputThe streamed output items emitted by a shell tool call.
public final classBetaResponseInputItem.ApplyPatchCallA tool call representing a request to create, delete, or update files using diff patches.
public final classBetaResponseInputItem.ApplyPatchCallOutputThe streamed output emitted by an apply patch tool call.
public final classBetaResponseInputItem.McpListToolsA list of tools available on an MCP server.
public final classBetaResponseInputItem.McpApprovalRequestA request for human approval of a tool invocation.
public final classBetaResponseInputItem.McpApprovalResponseA response to an MCP approval request.
public final classBetaResponseInputItem.McpCallAn invocation of a tool on an MCP server.
public final classBetaResponseInputItem.CompactionTriggerCompacts the current context. Must be the final input item.
public final classBetaResponseInputItem.ItemReferenceAn internal identifier for an item to reference.
public final classBetaResponseInputItem.Programpublic final classBetaResponseInputItem.ProgramOutput
-
Method Summary
-
-
Method Detail
-
betaEasyInputMessage
final Optional<BetaEasyInputMessage> betaEasyInputMessage()
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<BetaResponseInputItem.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.
-
betaResponseOutputMessage
final Optional<BetaResponseOutputMessage> betaResponseOutputMessage()
An output message from the model.
-
fileSearchCall
final Optional<BetaResponseFileSearchToolCall> fileSearchCall()
The results of a file search tool call. See the file search guide for more information.
-
computerCall
final Optional<BetaResponseComputerToolCall> computerCall()
A tool call to a computer use tool. See the computer use guide for more information.
-
computerCallOutput
final Optional<BetaResponseInputItem.ComputerCallOutput> computerCallOutput()
The output of a computer tool call.
-
webSearchCall
final Optional<BetaResponseFunctionWebSearch> webSearchCall()
The results of a web search tool call. See the web search guide for more information.
-
functionCall
final Optional<BetaResponseFunctionToolCall> functionCall()
A tool call to run a function. See the function calling guide for more information.
-
functionCallOutput
final Optional<BetaResponseInputItem.FunctionCallOutput> functionCallOutput()
The output of a function tool call.
-
agentMessage
final Optional<BetaResponseInputItem.AgentMessage> agentMessage()
A message routed between agents.
-
multiAgentCall
final Optional<BetaResponseInputItem.MultiAgentCall> multiAgentCall()
-
multiAgentCallOutput
final Optional<BetaResponseInputItem.MultiAgentCallOutput> multiAgentCallOutput()
-
toolSearchCall
final Optional<BetaResponseInputItem.ToolSearchCall> toolSearchCall()
-
toolSearchOutput
final Optional<BetaResponseToolSearchOutputItemParam> toolSearchOutput()
-
additionalTools
final Optional<BetaResponseInputItem.AdditionalTools> additionalTools()
-
reasoning
final Optional<BetaResponseReasoningItem> 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.
-
compaction
final Optional<BetaResponseCompactionItemParam> compaction()
A compaction item generated by the
v1/responses/compactAPI.
-
imageGenerationCall
final Optional<BetaResponseInputItem.ImageGenerationCall> imageGenerationCall()
An image generation request made by the model.
-
codeInterpreterCall
final Optional<BetaResponseCodeInterpreterToolCall> codeInterpreterCall()
A tool call to run code.
-
localShellCall
final Optional<BetaResponseInputItem.LocalShellCall> localShellCall()
A tool call to run a command on the local shell.
-
localShellCallOutput
final Optional<BetaResponseInputItem.LocalShellCallOutput> localShellCallOutput()
The output of a local shell tool call.
-
shellCall
final Optional<BetaResponseInputItem.ShellCall> shellCall()
A tool representing a request to execute one or more shell commands.
-
shellCallOutput
final Optional<BetaResponseInputItem.ShellCallOutput> shellCallOutput()
The streamed output items emitted by a shell tool call.
-
applyPatchCall
final Optional<BetaResponseInputItem.ApplyPatchCall> applyPatchCall()
A tool call representing a request to create, delete, or update files using diff patches.
-
applyPatchCallOutput
final Optional<BetaResponseInputItem.ApplyPatchCallOutput> applyPatchCallOutput()
The streamed output emitted by an apply patch tool call.
-
mcpListTools
final Optional<BetaResponseInputItem.McpListTools> mcpListTools()
A list of tools available on an MCP server.
-
mcpApprovalRequest
final Optional<BetaResponseInputItem.McpApprovalRequest> mcpApprovalRequest()
A request for human approval of a tool invocation.
-
mcpApprovalResponse
final Optional<BetaResponseInputItem.McpApprovalResponse> mcpApprovalResponse()
A response to an MCP approval request.
-
mcpCall
final Optional<BetaResponseInputItem.McpCall> mcpCall()
An invocation of a tool on an MCP server.
-
customToolCallOutput
final Optional<BetaResponseCustomToolCallOutput> customToolCallOutput()
The output of a custom tool call from your code, being sent back to the model.
-
customToolCall
final Optional<BetaResponseCustomToolCall> customToolCall()
A call to a custom tool created by the model.
-
compactionTrigger
final Optional<BetaResponseInputItem.CompactionTrigger> compactionTrigger()
Compacts the current context. Must be the final input item.
-
itemReference
final Optional<BetaResponseInputItem.ItemReference> itemReference()
An internal identifier for an item to reference.
-
program
final Optional<BetaResponseInputItem.Program> program()
-
programOutput
final Optional<BetaResponseInputItem.ProgramOutput> programOutput()
-
isBetaEasyInputMessage
final Boolean isBetaEasyInputMessage()
-
isBetaResponseOutputMessage
final Boolean isBetaResponseOutputMessage()
-
isFileSearchCall
final Boolean isFileSearchCall()
-
isComputerCall
final Boolean isComputerCall()
-
isComputerCallOutput
final Boolean isComputerCallOutput()
-
isWebSearchCall
final Boolean isWebSearchCall()
-
isFunctionCall
final Boolean isFunctionCall()
-
isFunctionCallOutput
final Boolean isFunctionCallOutput()
-
isAgentMessage
final Boolean isAgentMessage()
-
isMultiAgentCall
final Boolean isMultiAgentCall()
-
isMultiAgentCallOutput
final Boolean isMultiAgentCallOutput()
-
isToolSearchCall
final Boolean isToolSearchCall()
-
isToolSearchOutput
final Boolean isToolSearchOutput()
-
isAdditionalTools
final Boolean isAdditionalTools()
-
isReasoning
final Boolean isReasoning()
-
isCompaction
final Boolean isCompaction()
-
isImageGenerationCall
final Boolean isImageGenerationCall()
-
isCodeInterpreterCall
final Boolean isCodeInterpreterCall()
-
isLocalShellCall
final Boolean isLocalShellCall()
-
isLocalShellCallOutput
final Boolean isLocalShellCallOutput()
-
isShellCall
final Boolean isShellCall()
-
isShellCallOutput
final Boolean isShellCallOutput()
-
isApplyPatchCall
final Boolean isApplyPatchCall()
-
isApplyPatchCallOutput
final Boolean isApplyPatchCallOutput()
-
isMcpListTools
final Boolean isMcpListTools()
-
isMcpApprovalRequest
final Boolean isMcpApprovalRequest()
-
isMcpApprovalResponse
final Boolean isMcpApprovalResponse()
-
isCustomToolCallOutput
final Boolean isCustomToolCallOutput()
-
isCustomToolCall
final Boolean isCustomToolCall()
-
isCompactionTrigger
final Boolean isCompactionTrigger()
-
isItemReference
final Boolean isItemReference()
-
isProgramOutput
final Boolean isProgramOutput()
-
asBetaEasyInputMessage
final BetaEasyInputMessage asBetaEasyInputMessage()
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 BetaResponseInputItem.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.
-
asBetaResponseOutputMessage
final BetaResponseOutputMessage asBetaResponseOutputMessage()
An output message from the model.
-
asFileSearchCall
final BetaResponseFileSearchToolCall asFileSearchCall()
The results of a file search tool call. See the file search guide for more information.
-
asComputerCall
final BetaResponseComputerToolCall asComputerCall()
A tool call to a computer use tool. See the computer use guide for more information.
-
asComputerCallOutput
final BetaResponseInputItem.ComputerCallOutput asComputerCallOutput()
The output of a computer tool call.
-
asWebSearchCall
final BetaResponseFunctionWebSearch asWebSearchCall()
The results of a web search tool call. See the web search guide for more information.
-
asFunctionCall
final BetaResponseFunctionToolCall asFunctionCall()
A tool call to run a function. See the function calling guide for more information.
-
asFunctionCallOutput
final BetaResponseInputItem.FunctionCallOutput asFunctionCallOutput()
The output of a function tool call.
-
asAgentMessage
final BetaResponseInputItem.AgentMessage asAgentMessage()
A message routed between agents.
-
asMultiAgentCall
final BetaResponseInputItem.MultiAgentCall asMultiAgentCall()
-
asMultiAgentCallOutput
final BetaResponseInputItem.MultiAgentCallOutput asMultiAgentCallOutput()
-
asToolSearchCall
final BetaResponseInputItem.ToolSearchCall asToolSearchCall()
-
asToolSearchOutput
final BetaResponseToolSearchOutputItemParam asToolSearchOutput()
-
asAdditionalTools
final BetaResponseInputItem.AdditionalTools asAdditionalTools()
-
asReasoning
final BetaResponseReasoningItem 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.
-
asCompaction
final BetaResponseCompactionItemParam asCompaction()
A compaction item generated by the
v1/responses/compactAPI.
-
asImageGenerationCall
final BetaResponseInputItem.ImageGenerationCall asImageGenerationCall()
An image generation request made by the model.
-
asCodeInterpreterCall
final BetaResponseCodeInterpreterToolCall asCodeInterpreterCall()
A tool call to run code.
-
asLocalShellCall
final BetaResponseInputItem.LocalShellCall asLocalShellCall()
A tool call to run a command on the local shell.
-
asLocalShellCallOutput
final BetaResponseInputItem.LocalShellCallOutput asLocalShellCallOutput()
The output of a local shell tool call.
-
asShellCall
final BetaResponseInputItem.ShellCall asShellCall()
A tool representing a request to execute one or more shell commands.
-
asShellCallOutput
final BetaResponseInputItem.ShellCallOutput asShellCallOutput()
The streamed output items emitted by a shell tool call.
-
asApplyPatchCall
final BetaResponseInputItem.ApplyPatchCall asApplyPatchCall()
A tool call representing a request to create, delete, or update files using diff patches.
-
asApplyPatchCallOutput
final BetaResponseInputItem.ApplyPatchCallOutput asApplyPatchCallOutput()
The streamed output emitted by an apply patch tool call.
-
asMcpListTools
final BetaResponseInputItem.McpListTools asMcpListTools()
A list of tools available on an MCP server.
-
asMcpApprovalRequest
final BetaResponseInputItem.McpApprovalRequest asMcpApprovalRequest()
A request for human approval of a tool invocation.
-
asMcpApprovalResponse
final BetaResponseInputItem.McpApprovalResponse asMcpApprovalResponse()
A response to an MCP approval request.
-
asMcpCall
final BetaResponseInputItem.McpCall asMcpCall()
An invocation of a tool on an MCP server.
-
asCustomToolCallOutput
final BetaResponseCustomToolCallOutput asCustomToolCallOutput()
The output of a custom tool call from your code, being sent back to the model.
-
asCustomToolCall
final BetaResponseCustomToolCall asCustomToolCall()
A call to a custom tool created by the model.
-
asCompactionTrigger
final BetaResponseInputItem.CompactionTrigger asCompactionTrigger()
Compacts the current context. Must be the final input item.
-
asItemReference
final BetaResponseInputItem.ItemReference asItemReference()
An internal identifier for an item to reference.
-
asProgram
final BetaResponseInputItem.Program asProgram()
-
asProgramOutput
final BetaResponseInputItem.ProgramOutput asProgramOutput()
-
accept
final <T extends Any> T accept(BetaResponseInputItem.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = betaResponseInputItem.accept(new BetaResponseInputItem.Visitor<Optional<String>>() { @Override public Optional<String> visitBetaEasyInputMessage(BetaEasyInputMessage betaEasyInputMessage) { return Optional.of(betaEasyInputMessage.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaResponseInputItem validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofBetaEasyInputMessage
final static BetaResponseInputItem ofBetaEasyInputMessage(BetaEasyInputMessage betaEasyInputMessage)
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 BetaResponseInputItem ofMessage(BetaResponseInputItem.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.
-
ofBetaResponseOutputMessage
final static BetaResponseInputItem ofBetaResponseOutputMessage(BetaResponseOutputMessage betaResponseOutputMessage)
An output message from the model.
-
ofFileSearchCall
final static BetaResponseInputItem ofFileSearchCall(BetaResponseFileSearchToolCall fileSearchCall)
The results of a file search tool call. See the file search guide for more information.
-
ofComputerCall
final static BetaResponseInputItem ofComputerCall(BetaResponseComputerToolCall computerCall)
A tool call to a computer use tool. See the computer use guide for more information.
-
ofComputerCallOutput
final static BetaResponseInputItem ofComputerCallOutput(BetaResponseInputItem.ComputerCallOutput computerCallOutput)
The output of a computer tool call.
-
ofWebSearchCall
final static BetaResponseInputItem ofWebSearchCall(BetaResponseFunctionWebSearch webSearchCall)
The results of a web search tool call. See the web search guide for more information.
-
ofFunctionCall
final static BetaResponseInputItem ofFunctionCall(BetaResponseFunctionToolCall functionCall)
A tool call to run a function. See the function calling guide for more information.
-
ofFunctionCallOutput
final static BetaResponseInputItem ofFunctionCallOutput(BetaResponseInputItem.FunctionCallOutput functionCallOutput)
The output of a function tool call.
-
ofAgentMessage
final static BetaResponseInputItem ofAgentMessage(BetaResponseInputItem.AgentMessage agentMessage)
A message routed between agents.
-
ofMultiAgentCall
final static BetaResponseInputItem ofMultiAgentCall(BetaResponseInputItem.MultiAgentCall multiAgentCall)
-
ofMultiAgentCallOutput
final static BetaResponseInputItem ofMultiAgentCallOutput(BetaResponseInputItem.MultiAgentCallOutput multiAgentCallOutput)
-
ofToolSearchCall
final static BetaResponseInputItem ofToolSearchCall(BetaResponseInputItem.ToolSearchCall toolSearchCall)
-
ofToolSearchOutput
final static BetaResponseInputItem ofToolSearchOutput(BetaResponseToolSearchOutputItemParam toolSearchOutput)
-
ofAdditionalTools
final static BetaResponseInputItem ofAdditionalTools(BetaResponseInputItem.AdditionalTools additionalTools)
-
ofReasoning
final static BetaResponseInputItem ofReasoning(BetaResponseReasoningItem 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.
-
ofCompaction
final static BetaResponseInputItem ofCompaction(BetaResponseCompactionItemParam compaction)
A compaction item generated by the
v1/responses/compactAPI.
-
ofImageGenerationCall
final static BetaResponseInputItem ofImageGenerationCall(BetaResponseInputItem.ImageGenerationCall imageGenerationCall)
An image generation request made by the model.
-
ofCodeInterpreterCall
final static BetaResponseInputItem ofCodeInterpreterCall(BetaResponseCodeInterpreterToolCall codeInterpreterCall)
A tool call to run code.
-
ofLocalShellCall
final static BetaResponseInputItem ofLocalShellCall(BetaResponseInputItem.LocalShellCall localShellCall)
A tool call to run a command on the local shell.
-
ofLocalShellCallOutput
final static BetaResponseInputItem ofLocalShellCallOutput(BetaResponseInputItem.LocalShellCallOutput localShellCallOutput)
The output of a local shell tool call.
-
ofShellCall
final static BetaResponseInputItem ofShellCall(BetaResponseInputItem.ShellCall shellCall)
A tool representing a request to execute one or more shell commands.
-
ofShellCallOutput
final static BetaResponseInputItem ofShellCallOutput(BetaResponseInputItem.ShellCallOutput shellCallOutput)
The streamed output items emitted by a shell tool call.
-
ofApplyPatchCall
final static BetaResponseInputItem ofApplyPatchCall(BetaResponseInputItem.ApplyPatchCall applyPatchCall)
A tool call representing a request to create, delete, or update files using diff patches.
-
ofApplyPatchCallOutput
final static BetaResponseInputItem ofApplyPatchCallOutput(BetaResponseInputItem.ApplyPatchCallOutput applyPatchCallOutput)
The streamed output emitted by an apply patch tool call.
-
ofMcpListTools
final static BetaResponseInputItem ofMcpListTools(BetaResponseInputItem.McpListTools mcpListTools)
A list of tools available on an MCP server.
-
ofMcpApprovalRequest
final static BetaResponseInputItem ofMcpApprovalRequest(BetaResponseInputItem.McpApprovalRequest mcpApprovalRequest)
A request for human approval of a tool invocation.
-
ofMcpApprovalResponse
final static BetaResponseInputItem ofMcpApprovalResponse(BetaResponseInputItem.McpApprovalResponse mcpApprovalResponse)
A response to an MCP approval request.
-
ofMcpCall
final static BetaResponseInputItem ofMcpCall(BetaResponseInputItem.McpCall mcpCall)
An invocation of a tool on an MCP server.
-
ofCustomToolCallOutput
final static BetaResponseInputItem ofCustomToolCallOutput(BetaResponseCustomToolCallOutput customToolCallOutput)
The output of a custom tool call from your code, being sent back to the model.
-
ofCustomToolCall
final static BetaResponseInputItem ofCustomToolCall(BetaResponseCustomToolCall customToolCall)
A call to a custom tool created by the model.
-
ofCompactionTrigger
final static BetaResponseInputItem ofCompactionTrigger(BetaResponseInputItem.CompactionTrigger compactionTrigger)
Compacts the current context. Must be the final input item.
-
ofItemReference
final static BetaResponseInputItem ofItemReference(BetaResponseInputItem.ItemReference itemReference)
An internal identifier for an item to reference.
-
ofProgram
final static BetaResponseInputItem ofProgram(BetaResponseInputItem.Program program)
-
ofProgramOutput
final static BetaResponseInputItem ofProgramOutput(BetaResponseInputItem.ProgramOutput programOutput)
-
-
-
-