Class Tool
-
- All Implemented Interfaces:
public final class Tool
A tool that can be used to generate a response.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
Tool.Visitor
An interface that defines how to map each variant of Tool to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<FileSearchTool>
fileSearch()
A tool that searches for relevant content from uploaded files. final Optional<FunctionTool>
function()
Defines a function in your own code the model can choose to call. final Optional<WebSearchTool>
webSearch()
This tool searches the web for relevant results to use in a response. final Optional<ComputerTool>
computerUsePreview()
A tool that controls a virtual computer. final Boolean
isFileSearch()
final Boolean
isFunction()
final Boolean
isWebSearch()
final Boolean
isComputerUsePreview()
final FileSearchTool
asFileSearch()
A tool that searches for relevant content from uploaded files. final FunctionTool
asFunction()
Defines a function in your own code the model can choose to call. final WebSearchTool
asWebSearch()
This tool searches the web for relevant results to use in a response. final ComputerTool
asComputerUsePreview()
A tool that controls a virtual computer. final Optional<JsonValue>
_json()
final <T extends Any> T
accept(Tool.Visitor<T> visitor)
final Tool
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Tool
ofFileSearch(FileSearchTool fileSearch)
A tool that searches for relevant content from uploaded files. final static Tool
ofFunction(FunctionTool function)
Defines a function in your own code the model can choose to call. final static Tool
ofWebSearch(WebSearchTool webSearch)
This tool searches the web for relevant results to use in a response. final static Tool
ofComputerUsePreview(ComputerTool computerUsePreview)
A tool that controls a virtual computer. -
-
Method Detail
-
fileSearch
final Optional<FileSearchTool> fileSearch()
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
function
final Optional<FunctionTool> function()
Defines a function in your own code the model can choose to call. Learn more about function calling.
-
webSearch
final Optional<WebSearchTool> webSearch()
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
computerUsePreview
final Optional<ComputerTool> computerUsePreview()
A tool that controls a virtual computer. Learn more about the computer tool.
-
isFileSearch
final Boolean isFileSearch()
-
isFunction
final Boolean isFunction()
-
isWebSearch
final Boolean isWebSearch()
-
isComputerUsePreview
final Boolean isComputerUsePreview()
-
asFileSearch
final FileSearchTool asFileSearch()
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
asFunction
final FunctionTool asFunction()
Defines a function in your own code the model can choose to call. Learn more about function calling.
-
asWebSearch
final WebSearchTool asWebSearch()
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
asComputerUsePreview
final ComputerTool asComputerUsePreview()
A tool that controls a virtual computer. Learn more about the computer tool.
-
accept
final <T extends Any> T accept(Tool.Visitor<T> visitor)
-
ofFileSearch
final static Tool ofFileSearch(FileSearchTool fileSearch)
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
ofFunction
final static Tool ofFunction(FunctionTool function)
Defines a function in your own code the model can choose to call. Learn more about function calling.
-
ofWebSearch
final static Tool ofWebSearch(WebSearchTool webSearch)
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
-
ofComputerUsePreview
final static Tool ofComputerUsePreview(ComputerTool computerUsePreview)
A tool that controls a virtual computer. Learn more about the computer tool.
-
-
-
-