O embasamento com o Google Maps conecta os recursos generativos do Gemini aos dados ricos, factuais e atualizados do Google Maps. Com esse recurso, os desenvolvedores podem incorporar facilmente funcionalidades com reconhecimento de local aos aplicativos. Quando uma consulta do usuário tem um contexto relacionado a dados do Maps, o modelo do Gemini usa o Google Maps para fornecer respostas factuais, atualizadas e relevantes para o local ou a área geral especificada pelo usuário.
- Respostas precisas e com reconhecimento de local:aproveite os dados extensos e atuais do Google Maps para consultas geograficamente específicas.
- Personalização aprimorada:personalize recomendações e informações com base nos locais fornecidos pelo usuário.
Primeiros passos
Este exemplo demonstra como integrar o embasamento com o Google Maps ao seu aplicativo para fornecer respostas precisas e com reconhecimento de local às consultas dos usuários. O comando pede recomendações locais com um local do usuário opcional, permitindo que o modelo do Gemini use dados do Google Maps.
Python
# This will only work for SDK newer than 2.0.0
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="What are the best Italian restaurants within a 15-minute walk from here?",
tools=[{
"type": "google_maps",
"latitude": 34.050481,
"longitude": -118.248526
}]
)
# Print the model's text response and annotations
for step in interaction.steps:
if step.type == "model_output":
for content_block in step.content:
if content_block.type == "text":
print(content_block.text)
if content_block.annotations:
print("\nSources:")
for annotation in content_block.annotations:
if annotation.type == "place_citation":
print(f" - {annotation.name}: {annotation.url}")
JavaScript
// This will only work for SDK newer than 2.0.0
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
async function main() {
const interaction = await ai.interactions.create({
model: "gemini-3.8-flash",
input: "What are the best Italian restaurants within a 15-minute walk from here?",
tools: [{
type: "google_maps",
latitude: 34.050481,
longitude: -118.248526
}]
});
// Print the model's text response and annotations
for (const step of interaction.steps) {
if (step.type === 'model_output') {
for (const contentBlock of step.content) {
if (contentBlock.type === 'text') {
console.log(contentBlock.text);
if (contentBlock.annotations) {
console.log("\nSources:");
for (const annotation of contentBlock.annotations) {
if (annotation.type === 'place_citation') {
console.log(` - {annotation.name}: {annotation.url}`);
}
}
}
}
}
}
}
}
main();
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.Annotation;
import com.google.genai.gaos.models.interactions.Content;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.GoogleMaps;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ModelOutputStep;
import com.google.genai.gaos.models.interactions.PlaceCitation;
import com.google.genai.gaos.models.interactions.Step;
import com.google.genai.gaos.models.interactions.TextContent;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;
Client client = new Client();
CreateModelInteraction params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(
InteractionsInput.of(
"What are the best Italian restaurants within a 15-minute walk from here?"))
.tools(
Arrays.asList(
GoogleMaps.builder().latitude(34.050481).longitude(-118.248526).build()))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
// Print the model's text response and annotations
if (interaction.steps().isPresent()) {
for (Step step : interaction.steps().get()) {
if (step instanceof ModelOutputStep) {
ModelOutputStep outputStep = (ModelOutputStep) step;
if (outputStep.content().isPresent()) {
for (Content contentBlock : outputStep.content().get()) {
if (contentBlock instanceof TextContent) {
TextContent textContent = (TextContent) contentBlock;
System.out.println(textContent.text().orElse(""));
if (textContent.annotations().isPresent()
&& !textContent.annotations().get().isEmpty()) {
System.out.println("\nSources:");
for (Annotation annotation : textContent.annotations().get()) {
if (annotation instanceof PlaceCitation) {
PlaceCitation citation = (PlaceCitation) annotation;
System.out.printf(
" - %s: %s%n", citation.name().orElse(""), citation.url().orElse(""));
}
}
}
}
}
}
}
}
}
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
resp, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(
interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput("What are the best Italian restaurants within a 15-minute walk from here?"),
Tools: []interactions.Tool{
interactions.NewTool(interactions.GoogleMaps{
Latitude: genai.Ptr(34.050481),
Longitude: genai.Ptr(-118.248526),
}),
},
},
),
})
if err != nil {
log.Fatal(err)
}
// Print the model's text response and annotations
for _, step := range resp.Interaction.Steps {
if step.ModelOutputStep != nil {
for _, content := range step.ModelOutputStep.Content {
if content.TextContent != nil {
fmt.Println(content.TextContent.Text)
if len(content.TextContent.Annotations) > 0 {
fmt.Println("\nSources:")
for _, annotation := range content.TextContent.Annotations {
if annotation.PlaceCitation != nil {
c := annotation.PlaceCitation
name := ""
if c.Name != nil {
name = *c.Name
}
url := ""
if c.URL != nil {
url = *c.URL
}
fmt.Printf(" - %s: %s\n", name, url)
}
}
}
}
}
}
}
}
REST
# Specifies the API revision to avoid breaking changes when they become default
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini-3.8-flash",
"input": "What are the best Italian restaurants within a 15-minute walk from here?",
"tools": [{
"type": "google_maps",
"latitude": 34.050481,
"longitude": -118.248526
}]
}'
Como funciona o embasamento com o Google Maps
O embasamento com o Google Maps integra a API Gemini ao ecossistema do Google Geo usando a API Maps como fonte de embasamento. Quando a consulta de um usuário contém contexto geográfico, o modelo do Gemini pode invocar a ferramenta de embasamento com o Google Maps. Em seguida, o modelo pode gerar respostas com base nos dados do Google Maps relevantes para o local fornecido.
O processo geralmente envolve:
- Consulta do usuário:um usuário envia uma consulta ao seu aplicativo, possivelmente incluindo contexto geográfico (por exemplo, "cafés perto de mim", "museus em São Francisco").
- Invocação de ferramenta:o modelo do Gemini, reconhecendo a intenção geográfica, invoca a ferramenta de embasamento com o Google Maps. Essa ferramenta pode ser fornecida com o
latitudee olongitudedo usuário. A ferramenta é de pesquisa textual e funciona de maneira semelhante à pesquisa no Maps. Consultas locais ("perto de mim") usam as coordenadas, enquanto consultas específicas ou não locais provavelmente não serão influenciadas pela localização explícita. - Recuperação de dados:o serviço de embasamento com o Google Maps consulta o Google Maps para encontrar informações relevantes (por exemplo, lugares, avaliações, fotos, endereços, horários de funcionamento).
- Geração embasada:os dados recuperados do Maps são usados para informar a resposta do modelo Gemini, garantindo precisão e relevância factual.
- Resposta e anotações:o modelo retorna uma resposta em texto com anotações inline que vinculam a fontes do Google Maps, permitindo que os desenvolvedores mostrem citações.
Por que e quando usar o Embasamento com o Google Maps
O embasamento com o Google Maps é ideal para aplicativos que exigem informações precisas, atualizadas e específicas de um local. Ela melhora a experiência do usuário ao fornecer conteúdo relevante e personalizado com base no extenso banco de dados do Google Maps, que tem mais de 250 milhões de lugares no mundo todo.
Use o embasamento com o Google Maps quando seu aplicativo precisar:
- Forneça respostas completas e precisas para perguntas específicas de uma região.
- Crie planejadores de viagens e guias locais conversacionais.
- Recomendar pontos de interesse com base na localização e nas preferências do usuário, como restaurantes ou lojas.
- Crie experiências com reconhecimento de local para serviços de redes sociais, varejo ou entrega de comida.
A fundamentação com o Google Maps é excelente em casos de uso em que a proximidade e os dados factuais atuais são essenciais, como encontrar o "melhor café perto de mim" ou receber rotas.
Casos de uso
O embasamento com o Google Maps oferece suporte a vários casos de uso com reconhecimento de local.
Como lidar com perguntas específicas sobre um lugar
Faça perguntas detalhadas sobre um lugar específico para receber respostas com base nas avaliações dos usuários do Google e em outros dados do Maps.
Python
# This will only work for SDK newer than 2.0.0
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Is there a cafe near the corner of 1st and Main that has outdoor seating?",
tools=[{
"type": "google_maps",
"latitude": 34.050481,
"longitude": -118.248526
}]
)
for step in interaction.steps:
if step.type == "model_output":
for content_block in step.content:
if content_block.type == "text":
print(content_block.text)
if content_block.annotations:
print("\nSources:")
for annotation in content_block.annotations:
if annotation.type == "place_citation":
print(f" - {annotation.name}: {annotation.url}")
JavaScript
// This will only work for SDK newer than 2.0.0
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
async function main() {
const interaction = await ai.interactions.create({
model: "gemini-3.8-flash",
input: "Is there a cafe near the corner of 1st and Main that has outdoor seating?",
tools: [{
type: "google_maps",
latitude: 34.050481,
longitude: -118.248526
}]
});
for (const step of interaction.steps) {
if (step.type === 'model_output') {
for (const contentBlock of step.content) {
if (contentBlock.type === 'text') {
console.log(contentBlock.text);
if (contentBlock.annotations) {
console.log("\nSources:");
for (const annotation of contentBlock.annotations) {
if (annotation.type === 'place_citation') {
console.log(` - ${annotation.name}: ${annotation.url}`);
}
}
}
}
}
}
}
}
main();
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.Annotation;
import com.google.genai.gaos.models.interactions.Content;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.GoogleMaps;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ModelOutputStep;
import com.google.genai.gaos.models.interactions.PlaceCitation;
import com.google.genai.gaos.models.interactions.Step;
import com.google.genai.gaos.models.interactions.TextContent;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;
Client client = new Client();
CreateModelInteraction params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(
InteractionsInput.of(
"Is there a cafe near the corner of 1st and Main that has outdoor seating?"))
.tools(
Arrays.asList(
GoogleMaps.builder().latitude(34.050481).longitude(-118.248526).build()))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
if (interaction.steps().isPresent()) {
for (Step step : interaction.steps().get()) {
if (step instanceof ModelOutputStep) {
ModelOutputStep outputStep = (ModelOutputStep) step;
if (outputStep.content().isPresent()) {
for (Content contentBlock : outputStep.content().get()) {
if (contentBlock instanceof TextContent) {
TextContent textContent = (TextContent) contentBlock;
System.out.println(textContent.text().orElse(""));
if (textContent.annotations().isPresent()
&& !textContent.annotations().get().isEmpty()) {
System.out.println("\nSources:");
for (Annotation annotation : textContent.annotations().get()) {
if (annotation instanceof PlaceCitation) {
PlaceCitation citation = (PlaceCitation) annotation;
System.out.printf(
" - %s: %s%n", citation.name().orElse(""), citation.url().orElse(""));
}
}
}
}
}
}
}
}
}
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
resp, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(
interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput("Is there a cafe near the corner of 1st and Main that has outdoor seating?"),
Tools: []interactions.Tool{
interactions.NewTool(interactions.GoogleMaps{
Latitude: genai.Ptr(34.050481),
Longitude: genai.Ptr(-118.248526),
}),
},
},
),
})
if err != nil {
log.Fatal(err)
}
for _, step := range resp.Interaction.Steps {
if step.ModelOutputStep != nil {
for _, content := range step.ModelOutputStep.Content {
if content.TextContent != nil {
fmt.Println(content.TextContent.Text)
if len(content.TextContent.Annotations) > 0 {
fmt.Println("\nSources:")
for _, annotation := range content.TextContent.Annotations {
if annotation.PlaceCitation != nil {
c := annotation.PlaceCitation
name := ""
if c.Name != nil {
name = *c.Name
}
url := ""
if c.URL != nil {
url = *c.URL
}
fmt.Printf(" - %s: %s\n", name, url)
}
}
}
}
}
}
}
}
Oferecer personalização com base no local
Receber recomendações personalizadas de acordo com as preferências de um usuário e uma área geográfica específica.
Python
# This will only work for SDK newer than 2.0.0
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Which family-friendly restaurants near here have the best playground reviews?",
tools=[{
"type": "google_maps",
"latitude": 30.2672,
"longitude": -97.7431
}]
)
for step in interaction.steps:
if step.type == "model_output":
for content_block in step.content:
if content_block.type == "text":
print(content_block.text)
if content_block.annotations:
print("\nSources:")
for annotation in content_block.annotations:
if annotation.type == "place_citation":
print(f" - {annotation.name}: {annotation.url}")
JavaScript
// This will only work for SDK newer than 2.0.0
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
async function main() {
const interaction = await ai.interactions.create({
model: "gemini-3.8-flash",
input: "Which family-friendly restaurants near here have the best playground reviews?",
tools: [{
type: "google_maps",
latitude: 30.2672,
longitude: -97.7431
}]
});
for (const step of interaction.steps) {
if (step.type === 'model_output') {
for (const contentBlock of step.content) {
if (contentBlock.type === 'text') {
console.log(contentBlock.text);
if (contentBlock.annotations) {
console.log("\nSources:");
for (const annotation of contentBlock.annotations) {
if (annotation.type === 'place_citation') {
console.log(` - ${annotation.name}: ${annotation.url}`);
}
}
}
}
}
}
}
}
main();
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.Annotation;
import com.google.genai.gaos.models.interactions.Content;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.GoogleMaps;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ModelOutputStep;
import com.google.genai.gaos.models.interactions.PlaceCitation;
import com.google.genai.gaos.models.interactions.Step;
import com.google.genai.gaos.models.interactions.TextContent;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;
Client client = new Client();
CreateModelInteraction params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(
InteractionsInput.of(
"Which family-friendly restaurants near here have the best playground reviews?"))
.tools(
Arrays.asList(GoogleMaps.builder().latitude(30.2672).longitude(-97.7431).build()))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
if (interaction.steps().isPresent()) {
for (Step step : interaction.steps().get()) {
if (step instanceof ModelOutputStep) {
ModelOutputStep outputStep = (ModelOutputStep) step;
if (outputStep.content().isPresent()) {
for (Content contentBlock : outputStep.content().get()) {
if (contentBlock instanceof TextContent) {
TextContent textContent = (TextContent) contentBlock;
System.out.println(textContent.text().orElse(""));
if (textContent.annotations().isPresent()
&& !textContent.annotations().get().isEmpty()) {
System.out.println("\nSources:");
for (Annotation annotation : textContent.annotations().get()) {
if (annotation instanceof PlaceCitation) {
PlaceCitation citation = (PlaceCitation) annotation;
System.out.printf(
" - %s: %s%n", citation.name().orElse(""), citation.url().orElse(""));
}
}
}
}
}
}
}
}
}
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
resp, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(
interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput("Which family-friendly restaurants near here have the best playground reviews?"),
Tools: []interactions.Tool{
interactions.NewTool(interactions.GoogleMaps{
Latitude: genai.Ptr(30.2672),
Longitude: genai.Ptr(-97.7431),
}),
},
},
),
})
if err != nil {
log.Fatal(err)
}
for _, step := range resp.Interaction.Steps {
if step.ModelOutputStep != nil {
for _, content := range step.ModelOutputStep.Content {
if content.TextContent != nil {
fmt.Println(content.TextContent.Text)
if len(content.TextContent.Annotations) > 0 {
fmt.Println("\nSources:")
for _, annotation := range content.TextContent.Annotations {
if annotation.PlaceCitation != nil {
c := annotation.PlaceCitation
name := ""
if c.Name != nil {
name = *c.Name
}
url := ""
if c.URL != nil {
url = *c.URL
}
fmt.Printf(" - %s: %s\n", name, url)
}
}
}
}
}
}
}
}
Ajuda no planejamento de itinerários
Gere planos de vários dias com rotas e informações sobre vários locais, perfeito para aplicativos de viagens.
Python
# This will only work for SDK newer than 2.0.0
from google import genai
client = genai.Client()
prompt = "Plan a day in San Francisco for me. I want to see the Golden Gate Bridge, visit a museum, and have a nice dinner."
interaction = client.interactions.create(
model="gemini-3.8-flash",
input=prompt,
tools=[{
"type": "google_maps",
"latitude": 37.78193,
"longitude": -122.40476
}]
)
# ... code to process response
JavaScript
// This will only work for SDK newer than 2.0.0
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
async function main() {
const interaction = await ai.interactions.create({
model: "gemini-3.8-flash",
input: "Plan a day in San Francisco for me. I want to see the Golden Gate Bridge, visit a museum, and have a nice dinner.",
tools: [{
type: "google_maps",
latitude: 37.78193,
longitude: -122.40476
}]
});
}
main();
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.GoogleMaps;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.Arrays;
Client client = new Client();
String prompt =
"Plan a day in San Francisco for me. I want to see the Golden Gate Bridge, visit a museum, and have a nice dinner.";
CreateModelInteraction params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(InteractionsInput.of(prompt))
.tools(
Arrays.asList(GoogleMaps.builder().latitude(37.78193).longitude(-122.40476).build()))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
// ... code to process response
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
prompt := "Plan a day in San Francisco for me. I want to see the Golden Gate Bridge, visit a museum, and have a nice dinner."
resp, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(
interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput(prompt),
Tools: []interactions.Tool{
interactions.NewTool(interactions.GoogleMaps{
Latitude: genai.Ptr(37.78193),
Longitude: genai.Ptr(-122.40476),
}),
},
},
),
})
if err != nil {
log.Fatal(err)
}
// ... code to process response
fmt.Println(resp.Interaction.GetOutputText())
}
REST
# Specifies the API revision to avoid breaking changes when they become default
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini-3.8-flash",
"input": "Plan a day in San Francisco for me. I want to see the Golden Gate Bridge, visit a museum, and have a nice dinner.",
"tools": [{
"type": "google_maps",
"latitude": 37.78193,
"longitude": -122.40476
}]
}'
Requisitos de uso do serviço
Esta seção descreve os requisitos de uso do serviço para o embasamento com o Google Maps.
Informar o usuário sobre o uso de fontes do Google Maps
Com cada resultado embasado do Google Maps, você recebe anotações de origem nos blocos de conteúdo da etapa model_output que apoiam cada resposta. Os seguintes metadados são
retornados:
- URL de origem
- nome
Ao apresentar resultados do embasamento com o Google Maps, especifique as fontes associadas do Google Maps e informe aos usuários o seguinte:
- As fontes do Google Maps precisam aparecer imediatamente após o conteúdo gerado que elas embasam. Esse conteúdo gerado também é chamado de Resultado Embasado do Google Maps.
- As fontes do Google Maps precisam ser acessíveis em uma única interação do usuário.
Mostrar fontes do Google Maps com links do Google Maps
Para cada anotação de origem, uma prévia de link precisa ser gerada seguindo estes requisitos:
- Atribua cada fonte ao Google Maps seguindo as diretrizes de atribuição do texto do Google Maps.
- Mostre o nome da fonte fornecido na resposta.
- Vincule à fonte usando o
urlda anotação.
Diretrizes de atribuição de texto do Google Maps
Ao atribuir fontes ao Google Maps em texto, siga estas diretrizes:
- Não modifique o texto do Google Maps de forma alguma:
- Não mude a capitalização de Google Maps.
- Não quebre o Google Maps em várias linhas.
- Não localize o Google Maps para outro idioma.
- Impeça que os navegadores traduzam o Google Maps usando o atributo HTML translate="no".
Para mais informações sobre alguns dos nossos provedores de dados do Google Maps e os termos de licença deles, consulte os avisos legais do Google Maps e do Google Earth.
Práticas recomendadas
- Forneça a localização do usuário:para receber respostas mais relevantes e personalizadas,
sempre inclua
latitudeelongitudena configuração da ferramentagoogle_mapsquando a localização do usuário for conhecida. - Informe os usuários finais:deixe claro para os usuários finais que os dados do Google Maps estão sendo usados para responder às consultas deles, principalmente quando a ferramenta está ativada.
- Desativar quando não for necessário:o embasamento com o Google Maps fica desativado por padrão. Ative (
"tools": [{"type": "google_maps"}]) somente quando uma consulta tiver um contexto geográfico claro para otimizar o desempenho e o custo.
Limitações
- No momento, o embasamento com o Google Maps só aceita comandos e respostas em inglês.
- A ferramenta pode não estar disponível em todas as regiões.
- Os resultados podem variar com base na precisão da localização e nos dados disponíveis do Maps.
- Abrangência geográfica:o embasamento com o Google Maps está disponível no mundo todo.
- Estado padrão:a ferramenta Embasamento com o Google Maps fica desativada por padrão. É necessário ativá-lo explicitamente nas solicitações de API.
Preços e limites de taxa
Os preços do embasamento com o Google Maps variam de acordo com a geração do modelo:
- Modelos do Gemini 3:seu projeto é cobrado por cada consulta de pesquisa que o modelo decide executar. Um único comando de pesquisa (sua solicitação de API ao modelo) pode fazer com que o modelo execute várias consultas de pesquisa para encontrar as informações necessárias. Cada uma dessas consultas conta como um uso faturável da ferramenta.
- Gemini 2.5 e modelos mais antigos:seu projeto é faturado por comando de pesquisa. Uma solicitação só é cobrada se o comando retornar pelo menos um resultado embasado do Google Maps, não importa quantas consultas de pesquisa individuais o modelo tenha realizado internamente para chegar a esse resultado.
Para informações detalhadas sobre preços, consulte a página de preços da API Gemini.
Modelos compatíveis
Os seguintes modelos são compatíveis com o embasamento com o Google Maps:
| Modelo | Embasamento com o Google Maps |
|---|---|
| Gemini 3.8 Flash | ✔️ |
| Gemini 3.7 Flash | ✔️ |
| Gemini 3.6 Flash | ✔️ |
| Gemini 3.5 Flash-Lite | ✔️ |
| Gemini 3.5 Flash | ✔️ |
| Pré-lançamento do Gemini 3.1 Pro | ✔️ |
| Gemini 3.1 Flash-Lite | ✔️ |
| Pré-lançamento do Gemini 3 Flash | ✔️ |
| Gemini 2.5 Pro | ✔️ |
| Gemini 2.5 Flash | ✔️ |
| Gemini 2.5 Flash-Lite | ✔️ |
Combinações de ferramentas compatíveis
Você pode usar o Embasamento com o Google Maps com outras ferramentas integradas, como o Embasamento com a Pesquisa Google (compatível com o Gemini 3.5 Flash e modelos mais recentes) para casos de uso mais complexos. Os modelos do Gemini 3 também permitem combinar essas ferramentas integradas com ferramentas personalizadas (chamada de função). Saiba mais na página Combinações de ferramentas.
A seguir
- Conheça outras ferramentas disponíveis.
- Para saber mais sobre as práticas recomendadas de IA responsável e os filtros de segurança da API Gemini, consulte o guia de configurações de segurança.