Package com.google.genai.types
Class Tool
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Tool
Tool details of a tool that the model may use to generate a response.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
objectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Tool.Builderbuilder()Instantiates a builder for Tool.abstract Optional<ToolCodeExecution>Optional.static ToolDeserializes a JSON string to a Tool object.abstract Optional<List<FunctionDeclaration>>List of function declarations that the tool supports.abstract Optional<GoogleSearch>Optional.abstract Optional<GoogleSearchRetrieval>Optional.Optional.abstract Tool.BuilderCreates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, toJson, toJsonNode, toJsonString
-
Constructor Details
-
Tool
public Tool()
-
-
Method Details
-
functionDeclarations
List of function declarations that the tool supports. -
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. -
googleSearch
Optional. Google Search tool type. Specialized retrieval tool that is powered by Google Search. -
googleSearchRetrieval
Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search. -
codeExecution
Optional. CodeExecution tool type. Enables the model to execute code as part of generation. This field is only used by the Gemini Developer API services. -
builder
Instantiates a builder for Tool. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a Tool object.
-