TemplateTool

class TemplateTool


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

Summary

Public companion functions

TemplateTool
functionDeclarations(
    functionDeclarations: List<TemplateFunctionDeclaration>,
    autoFunctionDeclarations: List<TemplateAutoFunctionDeclaration<*, *>>?
)

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

TemplateTool
googleMaps(googleMaps: GoogleMaps)

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

Public companion functions

functionDeclarations

fun functionDeclarations(
    functionDeclarations: List<TemplateFunctionDeclaration>,
    autoFunctionDeclarations: List<TemplateAutoFunctionDeclaration<*, *>>? = null
): TemplateTool

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

Parameters
functionDeclarations: List<TemplateFunctionDeclaration>

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

googleMaps

fun googleMaps(googleMaps: GoogleMaps = GoogleMaps()): TemplateTool

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
TemplateTool

A TemplateTool configured for Google Maps.