העיגון באמצעות מפות Google מחבר את היכולות הגנרטיביות של Gemini לנתונים העשירים, העובדתיים והעדכניים של מפות Google. התכונה הזו מאפשרת למפתחים לשלב בקלות באפליקציות שלהם פונקציונליות שמבוססת על מיקום. כששאילתה של משתמש מכילה הקשר שקשור לנתונים של מפות Google, מודל Gemini משתמש במפות Google כדי לספק תשובות עדכניות ומדויקות מבחינה עובדתית שרלוונטיות למיקום או לאזור הכללי שצוינו על ידי המשתמש.
- תשובות מדויקות שמודעות למיקום: תוכלו להשתמש בנתונים המקיפים והעדכניים של מפות Google כדי לקבל תשובות לשאלות ספציפיות לגבי מיקומים גיאוגרפיים.
- התאמה אישית משופרת: התאמת ההמלצות והמידע על סמך מיקומים שהמשתמשים סיפקו.
שנתחיל?
בדוגמה הזו אפשר לראות איך לשלב את התכונה 'עיגון בעזרת מפות Google' באפליקציה כדי לספק תשובות מדויקות לשאילתות של משתמשים, בהתאם למיקום שלהם. ההנחיה מבקשת המלצות מקומיות עם מיקום משתמש אופציונלי, ומאפשרת למודל Gemini להשתמש בנתונים של מפות Google.
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
}]
}'
איך פועל העיגון בעזרת מפות Google
עיגון בעזרת מפות Google משלב את Gemini API עם המערכת האקולוגית של Google Geo באמצעות Maps API כמקור לעיגון. כששאילתה של משתמש מכילה הקשר גיאוגרפי, מודל Gemini יכול להפעיל את הכלי 'עיגון באמצעות מפות Google'. לאחר מכן המודל יכול ליצור תשובות שמבוססות על נתונים ממפות Google שרלוונטיים למיקום שצוין.
התהליך בדרך כלל כולל:
- שאילתת משתמש: משתמש שולח שאילתה לאפליקציה שלכם, שיכולה לכלול הקשר גיאוגרפי (לדוגמה, "בתי קפה בסביבה שלי", "מוזיאונים בסן פרנסיסקו").
- הפעלת כלי: מודל Gemini, שמזהה את הכוונה הגיאוגרפית, מפעיל את הכלי עיגון בעזרת מפות Google. אפשר גם לספק לכלי הזה את
latitudeוlongitudeשל המשתמש. הכלי הוא כלי חיפוש טקסטואלי שפועל באופן דומה לחיפוש במפות Google. כלומר, שאילתות מקומיות (למשל, 'בסביבה שלי') ישתמשו בקואורדינטות, בעוד ששאילתות ספציפיות או לא מקומיות לא יושפעו מהמיקום המפורש. - אחזור נתונים: שירות ה-עיגון בעזרת מפות Google שולח שאילתות למפות Google כדי לקבל מידע רלוונטי (לדוגמה, מקומות, ביקורות, תמונות, כתובות, שעות פתיחה).
- יצירה מבוססת-קרקע: נתוני המפות שאוחזרו משמשים כדי לספק מידע לתשובה של מודל Gemini, וכך לוודא שהיא מדויקת ועניינית.
- תשובה והערות: המודל מחזיר תשובה טקסטואלית עם הערות מוטבעות שמקשרות למקורות במפות Google, כדי לאפשר למפתחים להציג ציטוטים.
למה ומתי כדאי להשתמש בעיגון בעזרת מפות Google
עיגון בעזרת מפות Google מתאים במיוחד לאפליקציות שנדרש בהן מידע מדויק, עדכני וספציפי למיקום. הוא משפר את חוויית המשתמש באמצעות תוכן רלוונטי ומותאם אישית שמבוסס על מסד הנתונים הנרחב של מפות Google, שכולל יותר מ-250 מיליון מקומות ברחבי העולם.
כדאי להשתמש בעיגון בעזרת מפות Google כשהאפליקציה צריכה:
- חשוב לענות על השאלות בצורה מקיפה ומדויקת.
- פיתוח כלים לשיחה לתכנון טיולים ומדריכים מקומיים.
- להמליץ על נקודות עניין על סמך מיקום והעדפות משתמש, כמו מסעדות או חנויות.
- ליצור חוויות מודעות למיקום עבור שירותים חברתיים, קמעונאיים או משלוחי אוכל.
עיגון בעזרת מפות Google מצטיין בתרחישי שימוש שבהם נתונים עובדתיים עדכניים וקירבה הם קריטיים, כמו חיפוש של "בית הקפה הכי טוב בסביבה שלי" או קבלת הוראות הגעה.
תרחישים לדוגמה
עיגון בעזרת מפות Google תומך במגוון תרחישי שימוש שמתבססים על מיקום.
איך עונים על שאלות ספציפיות לגבי מקומות
אתם יכולים לשאול שאלות מפורטות על מקום ספציפי ולקבל תשובות שמבוססות על ביקורות של משתמשי Google ועל נתונים אחרים במפות Google.
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)
}
}
}
}
}
}
}
}
התאמה אישית לפי מיקום
לקבל המלצות שמותאמות להעדפות של משתמשים ולאזור גיאוגרפי ספציפי.
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)
}
}
}
}
}
}
}
}
עזרה בתכנון מסלול
ליצור תוכניות לכמה ימים עם הוראות הגעה ומידע על מיקומים שונים, מושלם לאפליקציות נסיעות.
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
}]
}'
דרישות לשימוש בשירות
בקטע הזה מתוארות הדרישות לשימוש בשירות Grounding with Google Maps.
לעדכן את המשתמש לגבי השימוש במקורות של מפות Google
לכל תוצאה במפות Google שמתבססת על מידע ממקורות מהימנים, תקבלו הערות לגבי המקורות בבלוקים של התוכן של שלב model_output שתומכים בכל תשובה. המטא-נתונים הבאים מוחזרים:
- כתובת URL של המקור
- שם
כשמציגים תוצאות מ-עיגון בעזרת מפות Google, צריך לציין את המקורות המשויכים במפות Google ולעדכן את המשתמשים לגבי הדברים הבאים:
- מקורות המידע של מפות Google צריכים להופיע מיד אחרי התוכן שנוצר, אם הם תומכים בו. התוכן שנוצר נקרא גם תוצאה מבוססת-קרקע ב-Google Maps.
- מקורות המידע במפות Google צריכים להיות גלויים במהלך אינטראקציה אחת של המשתמש.
הצגת מקורות של מפות Google עם קישורים למפות Google
לכל הערה למקור צריך ליצור תצוגה מקדימה של קישור בהתאם לדרישות הבאות:
- צריך לשייך כל מקור למפות Google בהתאם להנחיות לשיוך של מפות Google.
- הצגת שם המקור שסופק בתשובה.
- מקשרים למקור באמצעות
urlמההערה.
הנחיות לציון מקורות במפות Google
כשמציינים את המקורות במפות Google בטקסט, צריך לפעול לפי ההנחיות הבאות:
- אל תשנו את הטקסט 'מפות Google' בשום צורה:
- אל תשנו את האותיות הרישיות במפות Google.
- אל תעבירו את מפות Google לכמה שורות.
- לא לתרגם את מפות Google לשפה אחרת.
- כדי למנוע מדפדפנים לתרגם את מפות Google, משתמשים בתכונה translate="no" של HTML.
מידע נוסף על חלק מספקי הנתונים של מפות Google ועל תנאי הרישיון שלהם מופיע בהודעות המשפטיות של מפות Google ו-Google Earth.
שיטות מומלצות
- ציון מיקום המשתמש: כדי לקבל תשובות רלוונטיות ומותאמות אישית, תמיד צריך לכלול את
latitudeוlongitudeבהגדרת הכליgoogle_mapsכשמיקום המשתמש ידוע. - ליידע את משתמשי הקצה: חשוב ליידע את משתמשי הקצה בצורה ברורה שנתוני מפות Google משמשים למענה על השאילתות שלהם, במיוחד כשהכלי מופעל.
- השבתה כשלא צריך: עיגון בעזרת מפות Google מושבת כברירת מחדל. כדי לשפר את הביצועים ולצמצם את העלויות, מפעילים את האפשרות הזו (
"tools": [{"type": "google_maps"}]) רק כששאילתה כוללת הקשר גיאוגרפי ברור.
מגבלות
- נכון לעכשיו, עיגון בעזרת מפות Google תומך רק בהנחיות ובתשובות באנגלית.
- יכול להיות שהכלי לא יהיה זמין בכל האזורים.
- התוצאות עשויות להשתנות בהתאם לדיוק המיקום ולנתונים הזמינים במפות Google.
- היקף גיאוגרפי: עיגון בעזרת מפות Google זמין בכל העולם.
- מצב ברירת מחדל: הכלי 'עיגון בעזרת מפות Google' מושבת כברירת מחדל. צריך להפעיל אותו באופן מפורש בבקשות ל-API.
תמחור והגבלות על קצב יצירת הבקשות
התמחור של עיגון בעזרת מפות Google משתנה בהתאם לדור המודל:
- Gemini 3 ומודלים חדשים יותר: הפרויקט שלכם יחויב על כל שאילתת חיפוש שהמודל יחליט לבצע, עם 5,000 בקשות חינמיות בחודש שמשותפות לכל מודלי Gemini 3 ומודלים חדשים יותר, ולאחר מכן 14$לכל 1,000 שאילתות חיפוש. הנחיה אחת לחיפוש (בקשת ה-API שלכם למודל) עשויה לגרום למודל להריץ כמה שאילתות חיפוש כדי למצוא את המידע הדרוש. כל אחת מהשאילתות האלה נחשבת לשימוש בכלי שחייב בתשלום.
- Gemini 2.5 ומודלים ישנים יותר: החיוב על הפרויקט הוא לפי הנחיית חיפוש (25$ לכל 1,000 הנחיות מבוססות). חיוב על בקשה מתבצע רק אם ההנחיה מחזירה בהצלחה לפחות תוצאה אחת במפות Google, בלי קשר למספר שאילתות החיפוש שהמודל ביצע באופן פנימי כדי לקבל את התוצאה הזו.
המכסה לעיגון בעזרת מפות Google בדרך כלל תואמת למגבלות הקצב של מודל Gemini הבסיסי. מידע מפורט על התמחור זמין בדף התמחור של Gemini API.
מודלים נתמכים
המודלים הבאים תומכים בעיגון בעזרת מפות Google:
| מודל | עיגון בעזרת מפות Google |
|---|---|
| Gemini 3.8 Flash | ✔️ |
| Gemini 3.6 Flash | ✔️ |
| Gemini 3.5 Flash-Lite | ✔️ |
| Gemini 3.1 Pro Preview | ✔️ |
| Gemini 3.1 Flash-Lite | ✔️ |
| תצוגה מקדימה של Gemini 3 Flash | ✔️ |
| Gemini 2.5 Pro | ✔️ |
| Gemini 2.5 Flash | ✔️ |
| Gemini 2.5 Flash-Lite | ✔️ |
שילובים נתמכים של כלים
אתם יכולים להשתמש ב-עיגון בעזרת מפות Google עם כלים מובנים אחרים כמו עיגון באמצעות חיפוש Google (נתמך ב-Gemini 3.5 Flash-Lite ובמודלים מתקדמים יותר) כדי להפעיל תרחישי שימוש מורכבים יותר. מודלים של Gemini 3 תומכים גם בשילוב של הכלים המובנים האלה עם כלים מותאמים אישית (קריאה לפונקציות). מידע נוסף זמין בדף שילובים של כלים.
המאמרים הבאים
- מידע נוסף על כלים אחרים שזמינים
- כדי לקבל מידע נוסף על שיטות מומלצות לאתיקה של AI ועל מסנני הבטיחות של Gemini API, אפשר לעיין במדריך להגדרות הבטיחות.