Interface Tool.Visitor
- 
                    
                    - All Implemented Interfaces:
 
 public interface Tool.Visitor<T extends Object>
- 
                
                    
                    - 
                                
                            
                                Method SummaryModifier and Type Method Description abstract TvisitFunction(FunctionTool function)Defines a function in your own code the model can choose to call. abstract TvisitFileSearch(FileSearchTool fileSearch)A tool that searches for relevant content from uploaded files. abstract TvisitComputerUsePreview(ComputerTool computerUsePreview)A tool that controls a virtual computer. abstract TvisitWebSearch(WebSearchTool webSearch)Search the Internet for sources related to the prompt. abstract TvisitMcp(Tool.Mcp mcp)Give the model access to additional tools via remote Model Context Protocol (MCP) servers. abstract TvisitCodeInterpreter(Tool.CodeInterpreter codeInterpreter)A tool that runs Python code to help generate a response to a prompt. abstract TvisitImageGeneration(Tool.ImageGeneration imageGeneration)A tool that generates images using a model like gpt-image-1.abstract TvisitLocalShell(JsonValue localShell)A tool that allows the model to execute shell commands in a local environment. abstract TvisitCustom(CustomTool custom)A custom tool that processes input using a specified format. abstract TvisitWebSearchPreview(WebSearchPreviewTool webSearchPreview)This tool searches the web for relevant results to use in a response. Tunknown(JsonValue json)Maps an unknown variant of Tool to a value of type T. - 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        visitFunctionabstract T visitFunction(FunctionTool function) Defines a function in your own code the model can choose to call. Learn more about function calling. 
 - 
                                        visitFileSearchabstract T visitFileSearch(FileSearchTool fileSearch) A tool that searches for relevant content from uploaded files. Learn more about the file search tool. 
 - 
                                        visitComputerUsePreviewabstract T visitComputerUsePreview(ComputerTool computerUsePreview) A tool that controls a virtual computer. Learn more about the computer tool. 
 - 
                                        visitWebSearchabstract T visitWebSearch(WebSearchTool webSearch) Search the Internet for sources related to the prompt. Learn more about the web search tool. 
 - 
                                        visitMcpabstract T visitMcp(Tool.Mcp mcp) Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP. 
 - 
                                        visitCodeInterpreterabstract T visitCodeInterpreter(Tool.CodeInterpreter codeInterpreter) A tool that runs Python code to help generate a response to a prompt. 
 - 
                                        visitImageGenerationabstract T visitImageGeneration(Tool.ImageGeneration imageGeneration) A tool that generates images using a model like gpt-image-1.
 - 
                                        visitLocalShellabstract T visitLocalShell(JsonValue localShell) A tool that allows the model to execute shell commands in a local environment. 
 - 
                                        visitCustomabstract T visitCustom(CustomTool custom) A custom tool that processes input using a specified format. Learn more about custom tools. 
 - 
                                        visitWebSearchPreviewabstract T visitWebSearchPreview(WebSearchPreviewTool webSearchPreview) This tool searches the web for relevant results to use in a response. Learn more about the web search tool. 
 - 
                                        unknownT 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. 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-