TemplateTool

public final class TemplateTool


Contains a set of tools (like function declarations) that the server template model has access to.

Summary

Nested types

public static class TemplateTool.Companion

Public methods

static final @NonNull TemplateTool
functionDeclarations(
    @NonNull List<@NonNull TemplateFunctionDeclaration> functionDeclarations,
    List<@NonNull TemplateAutoFunctionDeclaration<@NonNull ?, @NonNull ?>> autoFunctionDeclarations
)

Creates a TemplateTool instance that provides the model with access to the functionDeclarations.

static final @NonNull TemplateTool

Creates a TemplateTool instance that allows the model to use grounding with Google Maps.

Public methods

functionDeclarations

public static final @NonNull TemplateTool functionDeclarations(
    @NonNull List<@NonNull TemplateFunctionDeclaration> functionDeclarations,
    List<@NonNull TemplateAutoFunctionDeclaration<@NonNull ?, @NonNull ?>> autoFunctionDeclarations
)

Creates a TemplateTool instance that provides the model with access to the functionDeclarations.

Parameters
@NonNull List<@NonNull TemplateFunctionDeclaration> functionDeclarations

The list of functions that this tool allows the model access to.

googleMaps

public static final @NonNull TemplateTool googleMaps(@NonNull GoogleMaps googleMaps)

Creates a TemplateTool instance that allows the model to use grounding with Google Maps.

Grounding with Google Maps can be used to allow the model to connect to Google Maps to incorporate location-based information into its responses.

When using this feature, you are required to comply with the "Grounding with Google Maps" usage requirements for your chosen API provider: Gemini Developer API or Vertex AI Gemini API (see Service Terms section within the Service Specific Terms).

Returns
@NonNull TemplateTool

A TemplateTool configured for Google Maps.