Class Tool.Builder
- Enclosing class:
- Tool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Toolbuild()Clears the value of codeExecution field.Clears the value of computerUse field.Clears the value of enterpriseWebSearch field.Clears the value of fileSearch field.Clears the value of functionDeclarations field.Clears the value of functions field.Clears the value of googleMaps field.Clears the value of googleSearch field.Clears the value of googleSearchRetrieval field.Clears the value of retrieval field.Clears the value of urlContext field.abstract Tool.BuildercodeExecution(ToolCodeExecution codeExecution) Setter for codeExecution.codeExecution(ToolCodeExecution.Builder codeExecutionBuilder) Setter for codeExecution builder.abstract Tool.BuildercomputerUse(ComputerUse computerUse) Setter for computerUse.computerUse(ComputerUse.Builder computerUseBuilder) Setter for computerUse builder.abstract Tool.BuilderenterpriseWebSearch(EnterpriseWebSearch enterpriseWebSearch) Setter for enterpriseWebSearch.enterpriseWebSearch(EnterpriseWebSearch.Builder enterpriseWebSearchBuilder) Setter for enterpriseWebSearch builder.abstract Tool.BuilderfileSearch(FileSearch fileSearch) Setter for fileSearch.fileSearch(FileSearch.Builder fileSearchBuilder) Setter for fileSearch builder.functionDeclarations(FunctionDeclaration... functionDeclarations) Setter for functionDeclarations.functionDeclarations(FunctionDeclaration.Builder... functionDeclarationsBuilders) Setter for functionDeclarations builder.abstract Tool.BuilderfunctionDeclarations(List<FunctionDeclaration> functionDeclarations) Setter for functionDeclarations.Setter for functions.abstract Tool.BuilderSetter for functions.abstract Tool.BuildergoogleMaps(GoogleMaps googleMaps) Setter for googleMaps.googleMaps(GoogleMaps.Builder googleMapsBuilder) Setter for googleMaps builder.abstract Tool.BuildergoogleSearch(GoogleSearch googleSearch) Setter for googleSearch.googleSearch(GoogleSearch.Builder googleSearchBuilder) Setter for googleSearch builder.abstract Tool.BuildergoogleSearchRetrieval(GoogleSearchRetrieval googleSearchRetrieval) Setter for googleSearchRetrieval.googleSearchRetrieval(GoogleSearchRetrieval.Builder googleSearchRetrievalBuilder) Setter for googleSearchRetrieval builder.abstract Tool.BuilderSetter for retrieval.retrieval(Retrieval.Builder retrievalBuilder) Setter for retrieval builder.abstract Tool.BuilderurlContext(UrlContext urlContext) Setter for urlContext.urlContext(UrlContext.Builder urlContextBuilder) Setter for urlContext builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
functionDeclarations
Setter for functionDeclarations.functionDeclarations: List of function declarations that the tool supports.
-
functionDeclarations
@CanIgnoreReturnValue public Tool.Builder functionDeclarations(FunctionDeclaration... functionDeclarations) Setter for functionDeclarations.functionDeclarations: List of function declarations that the tool supports.
-
functionDeclarations
@CanIgnoreReturnValue public Tool.Builder functionDeclarations(FunctionDeclaration.Builder... functionDeclarationsBuilders) Setter for functionDeclarations builder.functionDeclarations: List of function declarations that the tool supports.
-
clearFunctionDeclarations
Clears the value of functionDeclarations field. -
retrieval
Setter for retrieval.retrieval: Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API.
-
retrieval
Setter for retrieval builder.retrieval: Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API.
-
clearRetrieval
Clears the value of retrieval field. -
googleSearchRetrieval
Setter for googleSearchRetrieval.googleSearchRetrieval: Optional. Specialized retrieval tool that is powered by Google Search.
-
googleSearchRetrieval
@CanIgnoreReturnValue public Tool.Builder googleSearchRetrieval(GoogleSearchRetrieval.Builder googleSearchRetrievalBuilder) Setter for googleSearchRetrieval builder.googleSearchRetrieval: Optional. Specialized retrieval tool that is powered by Google Search.
-
clearGoogleSearchRetrieval
Clears the value of googleSearchRetrieval field. -
functions
Setter for functions.functions: The java.lang.reflect.Method instance. If provided, it will to be parsed into a list of FunctionDeclaration instances, and be assigned to the functionDeclarations field.
-
functions
Setter for functions.functions: The java.lang.reflect.Method instance. If provided, it will to be parsed into a list of FunctionDeclaration instances, and be assigned to the functionDeclarations field.
-
clearFunctions
Clears the value of functions field. -
computerUse
Setter for computerUse.computerUse: Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
-
computerUse
Setter for computerUse builder.computerUse: Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
-
clearComputerUse
Clears the value of computerUse field. -
fileSearch
Setter for fileSearch.fileSearch: Optional. Tool to retrieve knowledge from the File Search Stores.
-
fileSearch
Setter for fileSearch builder.fileSearch: Optional. Tool to retrieve knowledge from the File Search Stores.
-
clearFileSearch
Clears the value of fileSearch field. -
codeExecution
Setter for codeExecution.codeExecution: Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
-
codeExecution
@CanIgnoreReturnValue public Tool.Builder codeExecution(ToolCodeExecution.Builder codeExecutionBuilder) Setter for codeExecution builder.codeExecution: Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
-
clearCodeExecution
Clears the value of codeExecution field. -
enterpriseWebSearch
Setter for enterpriseWebSearch.enterpriseWebSearch: Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API.
-
enterpriseWebSearch
@CanIgnoreReturnValue public Tool.Builder enterpriseWebSearch(EnterpriseWebSearch.Builder enterpriseWebSearchBuilder) Setter for enterpriseWebSearch builder.enterpriseWebSearch: Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API.
-
clearEnterpriseWebSearch
Clears the value of enterpriseWebSearch field. -
googleMaps
Setter for googleMaps.googleMaps: Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
-
googleMaps
Setter for googleMaps builder.googleMaps: Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
-
clearGoogleMaps
Clears the value of googleMaps field. -
googleSearch
Setter for googleSearch.googleSearch: Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
-
googleSearch
Setter for googleSearch builder.googleSearch: Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
-
clearGoogleSearch
Clears the value of googleSearch field. -
urlContext
Setter for urlContext.urlContext: Optional. Tool to support URL context retrieval.
-
urlContext
Setter for urlContext builder.urlContext: Optional. Tool to support URL context retrieval.
-
clearUrlContext
Clears the value of urlContext field. -
build
-