Interface Tool.Visitor
-
- All Implemented Interfaces:
public interface Tool.Visitor<T extends Object>
-
-
Method Summary
Modifier and Type Method Description abstract T
visitFunction(FunctionTool function)
Defines a function in your own code the model can choose to call. abstract T
visitFileSearch(FileSearchTool fileSearch)
A tool that searches for relevant content from uploaded files. abstract T
visitWebSearch(WebSearchTool webSearch)
This tool searches the web for relevant results to use in a response. abstract T
visitComputerUsePreview(ComputerTool computerUsePreview)
A tool that controls a virtual computer. abstract T
visitMcp(Tool.Mcp mcp)
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. abstract T
visitCodeInterpreter(Tool.CodeInterpreter codeInterpreter)
A tool that runs Python code to help generate a response to a prompt. abstract T
visitImageGeneration(Tool.ImageGeneration imageGeneration)
A tool that generates images using a model like gpt-image-1
.abstract T
visitLocalShell(JsonValue localShell)
A tool that allows the model to execute shell commands in a local environment. T
unknown(JsonValue json)
Maps an unknown variant of Tool to a value of type T. -
-
Method Detail
-
visitFunction
abstract T visitFunction(FunctionTool function)
Defines a function in your own code the model can choose to call. Learn more about function calling.
-
visitFileSearch
abstract T visitFileSearch(FileSearchTool fileSearch)
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
visitWebSearch
abstract T visitWebSearch(WebSearchTool webSearch)
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
visitComputerUsePreview
abstract T visitComputerUsePreview(ComputerTool computerUsePreview)
A tool that controls a virtual computer. Learn more about the computer tool.
-
visitMcp
abstract T visitMcp(Tool.Mcp mcp)
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
visitCodeInterpreter
abstract T visitCodeInterpreter(Tool.CodeInterpreter codeInterpreter)
A tool that runs Python code to help generate a response to a prompt.
-
visitImageGeneration
abstract T visitImageGeneration(Tool.ImageGeneration imageGeneration)
A tool that generates images using a model like
gpt-image-1
.
-
visitLocalShell
abstract T visitLocalShell(JsonValue localShell)
A tool that allows the model to execute shell commands in a local environment.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of Tool to a value of type T.
An instance of Tool 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.
-
-
-
-