'Google Maps के डेटा का इस्तेमाल करके जवाब देना' सुविधा, Gemini की जनरेटिव क्षमताओं को Google Maps के सटीक, तथ्यों पर आधारित, और अप-टू-डेट डेटा से कनेक्ट करती है. इस सुविधा की मदद से डेवलपर, अपने ऐप्लिकेशन में जगह की जानकारी का इस्तेमाल करने वाली सुविधा को आसानी से शामिल कर सकते हैं. जब किसी उपयोगकर्ता की क्वेरी में Maps के डेटा से जुड़ा कॉन्टेक्स्ट होता है, तो Gemini मॉडल, Google Maps का इस्तेमाल करता है. इससे वह उपयोगकर्ता को सही और नई जानकारी दे पाता है. यह जानकारी, उपयोगकर्ता की बताई गई जगह या सामान्य इलाके के हिसाब से होती है.
- सटीक जवाब, जो जगह के हिसाब से हों: भौगोलिक रूप से खास क्वेरी के लिए, Google Maps के बड़े और मौजूदा डेटा का इस्तेमाल करें.
- बेहतर तरीके से मनमुताबिक अनुभव: उपयोगकर्ता की दी गई जगहों की जानकारी के आधार पर, सुझाव और जानकारी को मनमुताबिक बनाना.
- कॉन्टेक्स्ट के हिसाब से जानकारी और विजेट: जनरेट किए गए कॉन्टेंट के साथ-साथ इंटरैक्टिव Google Maps विजेट रेंडर करने के लिए कॉन्टेक्स्ट टोकन.
अपनी प्रोफ़ाइल बनाना शुरू करें
इस उदाहरण में, Google Maps के साथ ग्राउंडिंग को अपने ऐप्लिकेशन में इंटिग्रेट करने का तरीका बताया गया है. इससे उपयोगकर्ता की क्वेरी के जवाब, सटीक और जगह के हिसाब से दिए जा सकते हैं. इस प्रॉम्प्ट में, स्थानीय सुझावों के बारे में पूछा गया है. इसमें उपयोगकर्ता की जगह की जानकारी देने का विकल्प भी है. इससे Gemini मॉडल को 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.5-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.5-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();
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' \
-H "Api-Revision: 2026-05-20" \
-d '{
"model": "gemini-3.5-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 Maps से जानकारी लेने की सुविधा कैसे काम करती है
Google Maps के साथ ग्राउंडिंग की सुविधा, Gemini API को Google Geo के साथ इंटिग्रेट करती है. इसके लिए, Maps API को ग्राउंडिंग सोर्स के तौर पर इस्तेमाल किया जाता है. जब किसी उपयोगकर्ता की क्वेरी में भौगोलिक कॉन्टेक्स्ट शामिल होता है, तो Gemini मॉडल, Google Maps से जानकारी लेने की सुविधा को चालू कर सकता है. इसके बाद, मॉडल, दी गई जगह से जुड़े Google Maps के डेटा के आधार पर जवाब जनरेट कर सकता है.
आम तौर पर, इस प्रोसेस में ये शामिल होते हैं:
- उपयोगकर्ता की क्वेरी: कोई उपयोगकर्ता आपके ऐप्लिकेशन में क्वेरी सबमिट करता है.इसमें भौगोलिक जानकारी भी शामिल हो सकती है. जैसे, "मेरे आस-पास की कॉफ़ी शॉप", "सैन फ़्रांसिस्को के म्यूज़ियम".
- टूल को चालू करना: Gemini मॉडल, भौगोलिक जानकारी से जुड़े इंटेंट को पहचानकर, Google Maps के साथ ग्राउंडिंग टूल को चालू करता है. इस टूल को उपयोगकर्ता के
latitudeऔरlongitudeके साथ भी इस्तेमाल किया जा सकता है. यह टूल, टेक्स्ट के आधार पर खोज करने वाला टूल है. यह Maps पर खोज करने की सुविधा की तरह काम करता है. इसमें स्थानीय क्वेरी ("मेरे आस-पास") के लिए निर्देशांकों का इस्तेमाल किया जाएगा. वहीं, खास या गैर-स्थानीय क्वेरी पर जगह की जानकारी का असर नहीं पड़ेगा. - डेटा वापस पाना: 'Google Maps के साथ ग्राउंडिंग' सेवा, Google Maps से काम की जानकारी (जैसे, जगहें, समीक्षाएं, फ़ोटो, पते, खुलने का समय) के बारे में क्वेरी करती है.
- भरोसेमंद सोर्स से जानकारी लेकर जवाब जनरेट करना: Maps से मिले डेटा का इस्तेमाल, Gemini मॉडल के जवाब में किया जाता है. इससे यह पक्का किया जाता है कि जवाब में दी गई जानकारी सही और काम की हो.
- जवाब और एनोटेशन: मॉडल, Google Maps के सोर्स से लिंक करने वाले इनलाइन एनोटेशन के साथ टेक्स्ट वाला जवाब देता है. इससे डेवलपर, उद्धरण दिखा सकते हैं. साथ ही, वे चाहें, तो कॉन्टेक्स्ट के हिसाब से Google Maps का विजेट रेंडर कर सकते हैं.
Google Maps से जानकारी लेने की सुविधा का इस्तेमाल कब और क्यों करना चाहिए
Google Maps के साथ ग्राउंडिंग की सुविधा उन ऐप्लिकेशन के लिए सबसे सही है जिन्हें सटीक, अप-टू-डेट, और जगह के हिसाब से जानकारी चाहिए. यह लोगों को काम का और उनके हिसाब से कॉन्टेंट उपलब्ध कराता है. इससे लोगों को बेहतर अनुभव मिलता है. यह कॉन्टेंट, Google Maps के विशाल डेटाबेस से लिया जाता है. इस डेटाबेस में दुनिया भर की 25 करोड़ से ज़्यादा जगहों की जानकारी मौजूद है.
आपको Google Maps से जानकारी लेने की सुविधा का इस्तेमाल तब करना चाहिए, जब आपके ऐप्लिकेशन को:
- जगह के हिसाब से पूछे गए सवालों के पूरे और सटीक जवाब दें.
- बातचीत करके यात्रा की योजना बनाने वाले टूल और स्थानीय गाइड बनाएं.
- जगह और उपयोगकर्ता की प्राथमिकताओं के आधार पर, लोकप्रिय जगहों के सुझाव देना. जैसे, रेस्टोरेंट या दुकानें.
- सामाजिक, खुदरा या खाना डिलीवर करने वाली सेवाओं के लिए, जगह की जानकारी के हिसाब से अनुभव बनाएं.
Google Maps के साथ इंटिग्रेट करके, ऐसे मामलों में बेहतर नतीजे पाए जा सकते हैं जहां आस-पास की जगहों और मौजूदा तथ्यों से जुड़े डेटा की ज़रूरत होती है. जैसे, "मेरे आस-पास सबसे अच्छी कॉफ़ी शॉप ढूंढो" या दिशा-निर्देश पाना.
उपयोग के उदाहरण
Google Maps से जानकारी लेने की सुविधा, जगह की जानकारी के हिसाब से कई तरह के कामों में मदद करती है.
किसी जगह के बारे में पूछे गए सवालों के जवाब देना
किसी जगह के बारे में ज़्यादा जानकारी वाले सवाल पूछें, ताकि आपको 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.5-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.5-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();
जगह के हिसाब से मनमुताबिक अनुभव देने की सुविधा उपलब्ध कराना
किसी उपयोगकर्ता की प्राथमिकताओं और किसी खास इलाके के हिसाब से सुझाव पाएं.
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.5-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.5-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();
यात्रा का प्लान बनाने में मदद करना
कई दिनों की यात्रा के प्लान जनरेट करें. इनमें अलग-अलग जगहों के बारे में जानकारी और वहाँ जाने का रास्ता शामिल हो. यह सुविधा, यात्रा से जुड़े ऐप्लिकेशन के लिए सबसे सही है.
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.5-flash",
input=prompt,
tools=[{
"type": "google_maps",
"latitude": 37.78193,
"longitude": -122.40476,
"enable_widget": True
}]
)
# ... code to process response and widget token
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.5-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,
enable_widget: true
}]
});
}
main();
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' \
-H "Api-Revision: 2026-05-20" \
-d '{
"model": "gemini-3.5-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,
"enable_widget": true
}]
}'
सेवा के इस्तेमाल से जुड़ी ज़रूरी शर्तें
इस सेक्शन में, Google Maps के साथ Grounding की सुविधा इस्तेमाल करने की ज़रूरी शर्तों के बारे में बताया गया है.
उपयोगकर्ता को Google Maps के सोर्स के इस्तेमाल के बारे में जानकारी देना
Google Maps के हर भरोसेमंद नतीजे के साथ, आपको model_output चरण के कॉन्टेंट ब्लॉक पर सोर्स के एनोटेशन मिलेंगे. ये एनोटेशन, हर जवाब के साथ मौजूद होते हैं. यह मेटाडेटा दिखता है:
- सोर्स यूआरएल
- नाम
Google Maps से जानकारी लेने की सुविधा के ज़रिए मिले नतीजों को दिखाते समय, आपको Google Maps से जुड़े सोर्स के बारे में बताना होगा. साथ ही, अपने उपयोगकर्ताओं को यह जानकारी देनी होगी:
- Google Maps के सोर्स, जनरेट किए गए कॉन्टेंट के ठीक बाद होने चाहिए. साथ ही, सोर्स में मौजूद कॉन्टेंट, जनरेट किए गए कॉन्टेंट से मिलता-जुलता होना चाहिए. जनरेट किए गए इस कॉन्टेंट को Google Maps के भरोसेमंद नतीजे भी कहा जाता है.
- Google Maps के सोर्स, उपयोगकर्ता के एक इंटरैक्शन में दिखने चाहिए.
Google Maps के लिंक के साथ Google Maps के सोर्स दिखाना
हर सोर्स एनोटेशन के लिए, लिंक की झलक इन ज़रूरी शर्तों के मुताबिक जनरेट की जानी चाहिए:
- Google Maps के टेक्स्ट एट्रिब्यूशन के दिशा-निर्देशों के मुताबिक, हर सोर्स को Google Maps से एट्रिब्यूट करें.
- जवाब में दिए गए सोर्स का नाम दिखाएं.
- एनोटेशन में मौजूद
urlका इस्तेमाल करके, सोर्स से लिंक करें.
Google Maps में टेक्स्ट एट्रिब्यूशन के दिशा-निर्देश
टेक्स्ट में Google Maps को सोर्स के तौर पर एट्रिब्यूट करते समय, इन दिशा-निर्देशों का पालन करें:
- Google Maps के टेक्स्ट में किसी भी तरह का बदलाव न करें:
- Google Maps के कैपिटल लेटर में लिखे गए अक्षरों में बदलाव न करें.
- Google Maps को एक से ज़्यादा लाइनों में न लिखें.
- Google Maps को किसी दूसरी भाषा में स्थानीयकृत न करें.
- ब्राउज़र को Google Maps का अनुवाद करने से रोकने के लिए, HTML एट्रिब्यूट translate="no" का इस्तेमाल करें.
Google Maps के लिए डेटा उपलब्ध कराने वाली कुछ कंपनियों और उनके लाइसेंस की शर्तों के बारे में ज़्यादा जानने के लिए, Google Maps और Google Earth की कानूनी सूचनाएं देखें.
सबसे सही तरीके
- उपयोगकर्ता की जगह की जानकारी दें: सबसे काम के और उपयोगकर्ता की दिलचस्पी के हिसाब से जवाब पाने के लिए,
google_mapsटूल को कॉन्फ़िगर करते समय हमेशाlatitudeऔरlongitudeको शामिल करें. ऐसा तब करें, जब आपको उपयोगकर्ता की जगह की जानकारी हो. - Google Maps के कॉन्टेक्स्ट के हिसाब से विजेट रेंडर करना: कॉन्टेक्स्ट के हिसाब से विजेट, कॉन्टेक्स्ट टोकन
google_maps_widget_context_tokenका इस्तेमाल करके रेंडर किया जाता है. यह Gemini API के जवाब में मिलता है. इसका इस्तेमाल, Google Maps से विज़ुअल कॉन्टेंट रेंडर करने के लिए किया जा सकता है. - आखिरी उपयोगकर्ताओं को जानकारी दें: अपने आखिरी उपयोगकर्ताओं को साफ़ तौर पर बताएँ कि उनकी क्वेरी के जवाब देने के लिए, Google Maps के डेटा का इस्तेमाल किया जा रहा है. ऐसा खास तौर पर तब करें, जब टूल चालू हो.
- ज़रूरत न होने पर टॉगल बंद करें: Google Maps के साथ ग्राउंडिंग की सुविधा डिफ़ॉल्ट रूप से बंद होती है. इसे सिर्फ़ तब चालू करें (
"tools": [{"type": "google_maps"}]), जब किसी क्वेरी में जगह की जानकारी साफ़ तौर पर दी गई हो. इससे परफ़ॉर्मेंस और लागत को ऑप्टिमाइज़ किया जा सकेगा.
सीमाएं
- फ़िलहाल, Google Maps के साथ इंटिग्रेट करके जवाब पाने की सुविधा सिर्फ़ अंग्रेज़ी भाषा में उपलब्ध है.
- ऐसा हो सकता है कि यह टूल सभी देशों/इलाकों में उपलब्ध न हो.
- नतीजे, जगह की सटीक जानकारी और Maps पर उपलब्ध डेटा के हिसाब से अलग-अलग हो सकते हैं.
- भौगोलिक दायरा: Google Maps के साथ ग्राउंडिंग की सुविधा दुनिया भर में उपलब्ध है.
- डिफ़ॉल्ट स्थिति: 'Google Maps की मदद से जानकारी पाना' टूल डिफ़ॉल्ट रूप से बंद होता है. आपको इसे एपीआई अनुरोधों में साफ़ तौर पर चालू करना होगा.
कीमत और दर की सीमाएं
Google Maps से जानकारी लेने की सुविधा की कीमत, क्वेरी के आधार पर तय की जाती है. मौजूदा दर 25 डॉलर / 1,000 भरोसेमंद प्रॉम्प्ट है. फ़्री टियर में, हर दिन ज़्यादा से ज़्यादा 500 अनुरोध किए जा सकते हैं. किसी अनुरोध को सिर्फ़ तब कोटे में गिना जाता है, जब प्रॉम्प्ट से कम से कम एक Google Maps का भरोसेमंद नतीजा मिलता है. इसका मतलब है कि नतीजों में कम से कम एक Google Maps का सोर्स शामिल हो. अगर एक ही अनुरोध से Google Maps पर कई क्वेरी भेजी जाती हैं, तो इसे दर सीमा के हिसाब से एक अनुरोध माना जाता है.
शुल्क के बारे में ज़्यादा जानकारी के लिए, Gemini API के शुल्क वाला पेज देखें.
इन मॉडल के साथ काम करता है
Google Maps से जानकारी लेने की सुविधा, इन मॉडल पर काम करती है:
| मॉडल | Google Maps से जानकारी लेने की सुविधा |
|---|---|
| Gemini 3.5 Flash | ✔️ |
| Gemini 3.1 Pro की झलक | ✔️ |
| Gemini 3.1 Flash-Lite | ✔️ |
| Gemini 3 Flash की झलक | ✔️ |
| Gemini 2.5 Pro | ✔️ |
| Gemini 2.5 Flash | ✔️ |
| Gemini 2.5 Flash-Lite | ✔️ |
| Gemini 2.0 Flash | ✔️ |
इस्तेमाल किए जा सकने वाले टूल कॉम्बिनेशन
Gemini 3 मॉडल, बिल्ट-इन टूल (जैसे, Google Maps के साथ ग्राउंडिंग) को कस्टम टूल (फ़ंक्शन कॉलिंग) के साथ इस्तेमाल करने की सुविधा देते हैं. टूल के कॉम्बिनेशन पेज पर जाकर, इस बारे में ज़्यादा जानें.
आगे क्या करना है
- उपलब्ध अन्य टूल के बारे में जानें.
- ज़िम्मेदारी से एआई का इस्तेमाल करने के सबसे सही तरीकों और Gemini API के सुरक्षा फ़िल्टर के बारे में ज़्यादा जानने के लिए, सुरक्षा सेटिंग की गाइड देखें.