Durch die Fundierung mit Google Maps werden die generativen Funktionen von Gemini mit den umfangreichen, faktenbasierten und aktuellen Daten von Google Maps verbunden. Mit dieser Funktion können Entwickler standortbezogene Funktionen ganz einfach in ihre Anwendungen einbinden. Wenn eine Nutzeranfrage einen Kontext hat, der sich auf Google Maps-Daten bezieht, nutzt das Gemini-Modell Google Maps, um sachlich korrekte und aktuelle Antworten zu liefern, die für den vom Nutzer angegebenen Standort oder den ungefähren Ort relevant sind.
- Genaue, standortbezogene Antworten:Nutzen Sie die umfangreichen und aktuellen Daten von Google Maps für geografisch spezifische Anfragen.
- Erweiterte Personalisierung:Empfehlungen und Informationen basierend auf den von Nutzern angegebenen Standorten anpassen.
Jetzt starten
In diesem Beispiel wird gezeigt, wie Sie Grounding mit Google Maps in Ihre Anwendung einbinden, um genaue, standortbezogene Antworten auf Nutzeranfragen zu erhalten. Im Prompt wird nach lokalen Empfehlungen gefragt. Der Standort des Nutzers ist optional. So kann das Gemini-Modell Google Maps-Daten verwenden.
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
}]
}'
So funktioniert die Fundierung mit Google Maps
Bei der Fundierung mit Google Maps wird die Gemini API in das Google Geo-Ökosystem eingebunden, indem die Maps API als Fundierungsquelle verwendet wird. Wenn die Anfrage eines Nutzers geografischen Kontext enthält, kann das Gemini-Modell das Tool „Fundierung mit Google Maps“ aufrufen. Das Modell kann dann Antworten generieren, die auf Google Maps-Daten basieren, die für den angegebenen Ort relevant sind.
Der Prozess umfasst in der Regel Folgendes:
- Nutzeranfrage:Ein Nutzer sendet eine Anfrage an Ihre Anwendung, die möglicherweise geografischen Kontext enthält (z.B. „Cafés in meiner Nähe“, „Museen in San Francisco“).
- Tool-Aufruf:Das Gemini-Modell erkennt die geografische Intention und ruft das Tool „Fundierung mit Google Maps“ auf. Optional können dem Tool die
latitudeundlongitudedes Nutzers zur Verfügung gestellt werden. Das Tool ist ein textbasiertes Suchtool und funktioniert ähnlich wie die Suche in Maps. Bei lokalen Anfragen („in meiner Nähe“) werden die Koordinaten verwendet, während spezifische oder nicht lokale Anfragen wahrscheinlich nicht vom expliziten Standort beeinflusst werden. - Datenabruf:Der Dienst „Fundierung mit Google Maps“ fragt Google Maps nach relevanten Informationen ab, z.B. nach Orten, Rezensionen, Fotos, Adressen und Öffnungszeiten.
- Fundierte Generierung:Die abgerufenen Maps-Daten werden verwendet, um die Antwort des Gemini-Modells zu fundieren und so für faktische Richtigkeit und Relevanz zu sorgen.
- Antwort und Anmerkungen:Das Modell gibt eine Textantwort mit Inline-Anmerkungen zurück, die auf Google Maps-Quellen verweisen. So können Entwickler Zitate anzeigen.
Fundierung mit Google Maps – warum und wann
Die Fundierung mit Google Maps ist ideal für Anwendungen, die genaue, aktuelle und standortspezifische Informationen erfordern. Die Nutzererfahrung wird durch relevante und personalisierte Inhalte verbessert, die auf der umfangreichen Google Maps-Datenbank mit über 250 Millionen Orten weltweit basieren.
Sie sollten die Fundierung mit Google Maps verwenden, wenn Ihre Anwendung Folgendes leisten muss:
- Geben Sie vollständige und korrekte Antworten auf standortbezogene Fragen.
- Konversationelle Reiseplaner und lokale Reiseführer erstellen
- Empfehlungen für Sehenswürdigkeiten basierend auf Standort und Nutzerpräferenzen wie Restaurants oder Geschäfte.
- Standortbezogene Funktionen für soziale Netzwerke, Einzelhandel oder Essenslieferdienste entwickeln
Die Fundierung mit Google Maps eignet sich besonders für Anwendungsfälle, in denen Nähe und aktuelle Fakten entscheidend sind, z. B. wenn Sie nach dem „besten Café in meiner Nähe“ suchen oder eine Wegbeschreibung benötigen.
Anwendungsfälle
Die Fundierung mit Google Maps unterstützt eine Vielzahl von ortsbezogenen Anwendungsfällen.
Ortsbezogene Fragen beantworten
Sie können detaillierte Fragen zu einem bestimmten Ort stellen und erhalten Antworten, die auf Google-Nutzerrezensionen und anderen Maps-Daten basieren.
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(""));
}
}
}
}
}
}
}
}
}
Ok
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)
}
}
}
}
}
}
}
}
Standortbezogene Personalisierung
Empfehlungen erhalten, die auf die Vorlieben eines Nutzers und eine bestimmte geografische Region zugeschnitten sind.
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(""));
}
}
}
}
}
}
}
}
}
Ok
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)
}
}
}
}
}
}
}
}
Unterstützung bei der Reiseplanung
Mehrtagespläne mit Wegbeschreibungen und Informationen zu verschiedenen Orten erstellen, ideal für Reise-Apps.
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
}]
}'
Anforderungen an die Dienstnutzung
In diesem Abschnitt werden die Anforderungen für die Nutzung von Grounding mit Google Maps beschrieben.
Nutzer über die Verwendung von Google Maps-Quellen informieren
Für jedes fundierte Google Maps-Ergebnis erhalten Sie Quellangaben in den Inhaltsblöcken des model_output-Schritts, die jede Antwort unterstützen. Die folgenden Metadaten werden zurückgegeben:
- Quell-URL
- name
Wenn Sie Ergebnisse aus der Fundierung mit Google Maps präsentieren, müssen Sie die zugehörigen Google Maps-Quellen angeben und Ihre Nutzer über Folgendes informieren:
- Die Google Maps-Quellen müssen unmittelbar auf die generierten Inhalte folgen, die durch die Quellen belegt werden. Diese generierten Inhalte werden auch als fundierte Google Maps-Ergebnisse bezeichnet.
- Die Google Maps-Quellen müssen innerhalb einer Nutzerinteraktion sichtbar sein.
Google Maps-Quellen mit Google Maps-Links anzeigen
Für jede Quellannotation muss eine Linkvorschau generiert werden, die den folgenden Anforderungen entspricht:
- Weisen Sie jede Quelle Google Maps zu und halten Sie sich dabei an die Richtlinien für die Quellenangabe von Text für Google Maps.
- Zeigen Sie den in der Antwort angegebenen Quellennamen an.
- Verlinken Sie die Quelle mit
urlaus der Annotation.
Richtlinien für die Quellenangabe als Text in Google Maps
Wenn Sie Quellen in Text Google Maps zuordnen, halten Sie sich an diese Richtlinien:
- Ändern Sie den Text „Google Maps“ nicht:
- Ändern Sie die Groß- und Kleinschreibung von „Google Maps“ nicht.
- Fügen Sie keinen Zeilenumbruch in Google Maps ein.
- Google Maps darf nicht in eine andere Sprache lokalisiert werden.
- Verhindern Sie, dass Browser Google Maps übersetzen, indem Sie das HTML-Attribut translate="no" verwenden.
Weitere Informationen zu einigen unserer Google Maps-Datenanbieter und ihren Lizenzbedingungen finden Sie in den rechtlichen Hinweisen zu Google Maps und Google Earth.
Best Practices
- Nutzerstandort angeben:Für die relevantesten und personalisierten Antworten sollten Sie immer
latitudeundlongitudein Ihregoogle_maps-Toolkonfiguration aufnehmen, wenn der Standort des Nutzers bekannt ist. - Endnutzer informieren:Informieren Sie Ihre Endnutzer deutlich darüber, dass Google Maps-Daten verwendet werden, um ihre Anfragen zu beantworten, insbesondere wenn das Tool aktiviert ist.
- Bei Bedarf aktivieren:Die Fundierung mit Google Maps ist standardmäßig deaktiviert. Aktivieren Sie die Option (
"tools": [{"type": "google_maps"}]) nur, wenn eine Abfrage einen eindeutigen geografischen Kontext hat, um Leistung und Kosten zu optimieren.
Beschränkungen
- Die Fundierung mit Google Maps unterstützt derzeit nur Prompts und Antworten in englischer Sprache.
- Das Tool ist möglicherweise nicht in allen Regionen verfügbar.
- Die Ergebnisse können je nach Standortgenauigkeit und verfügbaren Maps-Daten variieren.
- Geografischer Umfang:Die Fundierung mit Google Maps ist weltweit verfügbar.
- Standardstatus:Das Tool „Fundierung mit Google Maps“ ist standardmäßig deaktiviert. Sie müssen sie in Ihren API-Anfragen explizit aktivieren.
Preise und Ratenbegrenzungen
Die Preise für die Fundierung mit Google Maps variieren je nach Modellgeneration:
- Gemini 3-Modelle:Für Ihr Projekt wird jede Suchanfrage abgerechnet, die das Modell ausführt. Ein einzelner Such-Prompt (Ihre API-Anfrage an das Modell) kann dazu führen, dass das Modell mehrere Suchanfragen ausführt, um die erforderlichen Informationen zu finden. Jede dieser Anfragen gilt als kostenpflichtige Nutzung des Tools.
- Gemini 2.5 und ältere Modelle:Ihr Projekt wird pro Suchanfrage abgerechnet. Eine Anfrage wird nur dann abgerechnet, wenn durch den Prompt mindestens ein Google Maps-basiertes Ergebnis zurückgegeben wird. Dabei spielt es keine Rolle, wie viele einzelne Suchanfragen das Modell intern ausgeführt hat, um dieses Ergebnis zu erhalten.
Ausführliche Informationen zu den Preisen finden Sie auf der Seite „Gemini API-Preise“.
Unterstützte Modelle
Die folgenden Modelle unterstützen Fundierung mit Google Maps:
| Modell | Fundierung mit Google Maps |
|---|---|
| Gemini 3.8 Flash | ✔️ |
| Gemini 3.7 Flash | ✔️ |
| Gemini 3.6 Flash | ✔️ |
| Gemini 3.5 Flash-Lite | ✔️ |
| Gemini 3.5 Flash | ✔️ |
| Gemini 3.1 Pro (Vorabversion) | ✔️ |
| Gemini 3.1 Flash-Lite | ✔️ |
| Gemini 3 Flash (Vorabversion) | ✔️ |
| Gemini 2.5 Pro | ✔️ |
| Gemini 2.5 Flash | ✔️ |
| Gemini 2.5 Flash-Lite | ✔️ |
Unterstützte Tool-Kombinationen
Sie können die Fundierung mit Google Maps mit anderen integrierten Tools wie der Fundierung mit der Google Suche (unterstützt von Gemini 3.5 Flash und neueren Modellen) kombinieren, um komplexere Anwendungsfälle zu ermöglichen. Gemini 3-Modelle unterstützen auch die Kombination dieser integrierten Tools mit benutzerdefinierten Tools (Funktionsaufruf). Weitere Informationen zu Tool-Kombinationen
Nächste Schritte
- Weitere Informationen zu anderen verfügbaren Tools
- Weitere Informationen zu Best Practices für die verantwortungsbewusste Anwendung von KI und den Sicherheitsfiltern der Gemini API finden Sie im Leitfaden zu Sicherheitseinstellungen.