Google Maps की मदद से ग्राउंडिंग करना

Grounding with Google Maps की मदद से, Gemini की जनरेटिव क्षमताओं को Google Maps के सटीक, अप-टू-डेट, और ज़्यादा जानकारी वाले डेटा से जोड़ा जा सकता है. इस सुविधा की मदद से, डेवलपर अपने ऐप्लिकेशन में जगह की जानकारी के आधार पर काम करने वाली सुविधाएं आसानी से जोड़ सकते हैं. जब किसी उपयोगकर्ता की क्वेरी, Maps के डेटा से जुड़ी होती है, तब Gemini मॉडल, Google Maps का इस्तेमाल करके सटीक और अप-टू-डेट जवाब देता है. ये जवाब, उपयोगकर्ता की बताई गई जगह या सामान्य इलाके के हिसाब से होते हैं.

  • जगह की जानकारी के आधार पर सटीक जवाब: भौगोलिक तौर पर खास क्वेरी के लिए, Google Maps के मौजूदा और ज़्यादा डेटा का इस्तेमाल करें.
  • बेहतर तरीके से मनमुताबिक अनुभव देना: उपयोगकर्ता की बताई गई जगहों के आधार पर, सुझाव और जानकारी दें.
  • कॉन्टेक्स्ट के हिसाब से जानकारी और विजेट: जनरेट किए गए कॉन्टेंट के साथ, इंटरैक्टिव Google Maps विजेट दिखाने के लिए, कॉन्टेक्स्ट टोकन का इस्तेमाल करें.

शुरू करें

इस उदाहरण में, Grounding with Google Maps को अपने ऐप्लिकेशन में इंटिग्रेट करने का तरीका बताया गया है. इससे उपयोगकर्ता की क्वेरी के जवाब, जगह की जानकारी के आधार पर सटीक तरीके से दिए जा सकते हैं. प्रॉम्प्ट में, स्थानीय सुझाव मांगे जाते हैं. इसमें उपयोगकर्ता की जगह की जानकारी देना ज़रूरी नहीं है. इससे Gemini मॉडल, Google Maps के डेटा का इस्तेमाल कर पाता है.

Python

from google import genai
from google.genai import types

client = genai.Client()

prompt = "What are the best Italian restaurants within a 15-minute walk from here?"

response = client.models.generate_content(
    model='gemini-3-flash-preview',
    contents=prompt,
    config=types.GenerateContentConfig(
        # Turn on grounding with Google Maps
        tools=[types.Tool(google_maps=types.GoogleMaps())],
        # Optionally provide the relevant location context (this is in Los Angeles)
        tool_config=types.ToolConfig(retrieval_config=types.RetrievalConfig(
            lat_lng=types.LatLng(
                latitude=34.050481, longitude=-118.248526))),
    ),
)

print("Generated Response:")
print(response.text)

if grounding := response.candidates[0].grounding_metadata:
  if grounding.grounding_chunks:
    print('-' * 40)
    print("Sources:")
    for chunk in grounding.grounding_chunks:
      print(f'- [{chunk.maps.title}]({chunk.maps.uri})')

JavaScript

import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({});

async function generateContentWithMapsGrounding() {
  const response = await ai.models.generateContent({
    model: "gemini-3-flash-preview",
    contents: "What are the best Italian restaurants within a 15-minute walk from here?",
    config: {
      // Turn on grounding with Google Maps
      tools: [{ googleMaps: {} }],
      toolConfig: {
        retrievalConfig: {
          // Optionally provide the relevant location context (this is in Los Angeles)
          latLng: {
            latitude: 34.050481,
            longitude: -118.248526,
          },
        },
      },
    },
  });

  console.log("Generated Response:");
  console.log(response.text);

  const grounding = response.candidates[0]?.groundingMetadata;
  if (grounding?.groundingChunks) {
    console.log("-".repeat(40));
    console.log("Sources:");
    for (const chunk of grounding.groundingChunks) {
      if (chunk.maps) {
        console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
      }
    }
  }
}

generateContentWithMapsGrounding();

REST

curl -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent' \
  -H 'Content-Type: application/json' \
  -H "x-goog-api-key: ${GEMINI_API_KEY}" \
  -d '{
  "contents": [{
    "role": "user",
    "parts": [{
      "text": "What are the best Italian restaurants within a 15-minute walk from here?"
    }]
  }],
  "tools": [{"googleMaps": {}}],
  "toolConfig": {
    "retrievalConfig": {
      "latLng": {"latitude": 34.050481, "longitude": -118.248526}
    }
  }
}'

Google Maps से जानकारी लेने की सुविधा कैसे काम करती है

Grounding with Google Maps, Gemini API को Google Geo इकोसिस्टम के साथ इंटिग्रेट करता है. इसके लिए, Maps API को सोर्स के तौर पर इस्तेमाल किया जाता है. जब किसी उपयोगकर्ता की क्वेरी में भौगोलिक कॉन्टेक्स्ट शामिल होता है, तब Gemini मॉडल, Grounding with Google Maps टूल को कॉल कर सकता है. इसके बाद, मॉडल, दी गई जगह के हिसाब से Google Maps के डेटा के आधार पर जवाब जनरेट कर सकता है.

आम तौर पर, इसमें ये चरण शामिल होते हैं:

  1. उपयोगकर्ता की क्वेरी: कोई उपयोगकर्ता आपके ऐप्लिकेशन में क्वेरी सबमिट करता है.इसमें भौगोलिक कॉन्टेक्स्ट शामिल हो सकता है. जैसे, "मेरे आस-पास की कॉफ़ी शॉप," "सैन फ़्रांसिस्को में मौजूद म्यूज़ियम".
  2. टूल को कॉल करना: Gemini मॉडल, भौगोलिक इरादे को पहचानकर, Grounding with Google Maps टूल को कॉल करता है. इस टूल को, उपयोगकर्ता के latitude और longitude की जानकारी भी दी जा सकती है. यह टूल, टेक्स्ट के आधार पर खोज करने वाला टूल है. यह Maps पर खोज करने की तरह ही काम करता है. जैसे, स्थानीय क्वेरी ("मेरे आस-पास") के लिए, निर्देशांकों का इस्तेमाल किया जाएगा. वहीं, खास या गैर-स्थानीय क्वेरी पर, साफ़ तौर पर बताई गई जगह का असर नहीं पड़ेगा.
  3. डेटा वापस पाना: Grounding with Google Maps सेवा, Google Maps से काम की जानकारी (जैसे, जगहें, समीक्षाएं, फ़ोटो, पते, खुलने का समय) के लिए क्वेरी करती है.
  4. भरोसेमंद स्रोतों से जवाब जनरेट करना: वापस पाए गए Maps के डेटा का इस्तेमाल, Gemini मॉडल के जवाब के लिए किया जाता है. इससे यह पक्का किया जाता है कि जवाब में दी गई जानकारी सटीक हो और वह क्वेरी के हिसाब से हो.
  5. जवाब और विजेट टोकन: मॉडल, टेक्स्ट में जवाब देता है. इसमें Google Maps के सोर्स के लिए, साइटेशन शामिल होते हैं. ज़रूरी नहीं है कि एपीआई के जवाब में, google_maps_widget_context_token भी शामिल हो. हालांकि, इसकी मदद से डेवलपर, विज़ुअल इंटरैक्शन के लिए अपने ऐप्लिकेशन में, कॉन्टेक्स्ट के हिसाब से Google Maps विजेट दिखा सकते हैं.

Google Maps से जानकारी लेने की सुविधा का इस्तेमाल कब और क्यों करना चाहिए

Grounding with Google Maps, उन ऐप्लिकेशन के लिए सबसे सही है जिनमें सटीक, अप-टू-डेट, और जगह के हिसाब से जानकारी की ज़रूरत होती है. यह उपयोगकर्ता अनुभव को बेहतर बनाता है. इसके लिए, Google Maps के 25 करोड़ से ज़्यादा जगहों के डेटाबेस से, काम का और मनमुताबिक कॉन्टेंट दिया जाता है.

Grounding with Google Maps का इस्तेमाल तब करें, जब आपके ऐप्लिकेशन को:

  • जगह के हिसाब से पूछे गए सवालों के सटीक और पूरे जवाब देने हों.
  • बातचीत के ज़रिए यात्रा की योजना बनाने वाले टूल और स्थानीय गाइड बनाने हों.
  • जगह और उपयोगकर्ता की प्राथमिकताओं (जैसे, रेस्टोरेंट या दुकानें) के आधार पर, दिलचस्पी की जगहों के सुझाव देने हों.
  • सोशल, खुदरा या फ़ूड डिलीवरी सेवाओं के लिए, जगह की जानकारी के आधार पर काम करने वाले अनुभव बनाने हों.

Grounding with Google Maps, उन मामलों में सबसे अच्छा काम करता है जहां आस-पास की जगहों और मौजूदा सटीक डेटा की ज़रूरत होती है. जैसे, "मेरे आस-पास की सबसे अच्छी कॉफ़ी शॉप" ढूंढना या दिशा-निर्देश पाना.

एपीआई के तरीके और पैरामीटर

Grounding with Google Maps, Gemini API के ज़रिए एक टूल के तौर पर generateContent तरीके में उपलब्ध है. Grounding with Google Maps को चालू और कॉन्फ़िगर करने के लिए, अपने अनुरोध के tools पैरामीटर में googleMaps ऑब्जेक्ट शामिल करें.

JSON

{
  "contents": [{
    "parts": [
      {"text": "Restaurants near Times Square."}
    ]
  }],
  "tools":  { "googleMaps": {} }
}

googleMaps टूल, बूलियन enableWidget पैरामीटर को भी स्वीकार कर सकता है. इसका इस्तेमाल, यह कंट्रोल करने के लिए किया जाता है कि जवाब में googleMapsWidgetContextToken फ़ील्ड दिखाया जाए या नहीं. इसका इस्तेमाल, कॉन्टेक्स्ट के हिसाब से Places विजेट दिखाने के लिए किया जा सकता है.

JSON

{
"contents": [{
    "parts": [
      {"text": "Restaurants near Times Square."}
    ]
  }],
  "tools":  { "googleMaps": { "enableWidget": true } }
}

इसके अलावा, यह टूल, कॉन्टेक्स्ट के हिसाब से जगह की जानकारी को toolConfig के तौर पर पास करने की सुविधा देता है.

JSON

{
  "contents": [{
    "parts": [
      {"text": "Restaurants near here."}
    ]
  }],
  "tools":  { "googleMaps": {} },
  "toolConfig":  {
    "retrievalConfig": {
      "latLng": {
        "latitude": 40.758896,
        "longitude": -73.985130
      }
    }
  }
}

भरोसेमंद स्रोतों से मिले जवाब को समझना

जब किसी जवाब को Google Maps के डेटा के आधार पर जनरेट किया जाता है, तब जवाब में groundingMetadata फ़ील्ड शामिल होता है. यह स्ट्रक्चर्ड डेटा, दावों की पुष्टि करने और अपने ऐप्लिकेशन में बेहतर साइटेशन अनुभव बनाने के साथ-साथ, सेवा के इस्तेमाल की ज़रूरी शर्तें पूरी करने के लिए ज़रूरी है.

JSON

{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "CanteenM is an American restaurant with..."
          }
        ],
        "role": "model"
      },
      "groundingMetadata": {
        "groundingChunks": [
          {
            "maps": {
              "uri": "https://maps.google.com/?cid=13100894621228039586",
              "title": "Heaven on 7th Marketplace",
              "placeId": "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
            },
            // repeated ...
          }
        ],
        "groundingSupports": [
          {
            "segment": {
              "startIndex": 0,
              "endIndex": 79,
              "text": "CanteenM is an American restaurant with a 4.6-star rating and is open 24 hours."
            },
            "groundingChunkIndices": [0]
          },
          // repeated ...
        ],
        "webSearchQueries": [
          "restaurants near me"
        ],
        "googleMapsWidgetContextToken": "widgetcontent/..."
      }
    }
  ]
}

Gemini API, groundingMetadata के साथ यह जानकारी दिखाता है:

  • groundingChunks: ऑब्जेक्ट का कलेक्शन. इसमें maps सोर्स (uri, placeId, और title) शामिल होते हैं.
  • groundingSupports: मॉडल के जवाब के टेक्स्ट को groundingChunks में मौजूद सोर्स से कनेक्ट करने के लिए, चंक का कलेक्शन. हर चंक, टेक्स्ट स्पैन (startIndex और endIndex से तय) को एक या उससे ज़्यादा groundingChunkIndices से लिंक करता है. इनलाइन साइटेशन बनाने के लिए, यह ज़रूरी है.
  • googleMapsWidgetContextToken: टेक्स्ट टोकन. इसका इस्तेमाल, कॉन्टेक्स्ट के हिसाब से Places विजेट दिखाने के लिए किया जा सकता है .

टेक्स्ट में इनलाइन साइटेशन दिखाने के तरीके के बारे में जानने के लिए, Grounding with Google Search के दस्तावेज़ों में दिया गया उदाहरण देखें.

कॉन्टेक्स्ट के हिसाब से Google Maps विजेट दिखाना

वापस पाए गए googleMapsWidgetContextToken का इस्तेमाल करने के लिए, आपको Google Maps JavaScript API लोड करना होगा.

इस्तेमाल के उदाहरण

Grounding with Google Maps, जगह की जानकारी के आधार पर काम करने वाले कई मामलों में इस्तेमाल किया जा सकता है. यहां दिए गए उदाहरणों से पता चलता है कि अलग-अलग प्रॉम्प्ट और पैरामीटर, Grounding with Google Maps का इस्तेमाल कैसे कर सकते हैं. Google Maps के भरोसेमंद स्रोतों से मिले नतीजों में मौजूद जानकारी, असल हालात से अलग हो सकती है.

जगह के हिसाब से पूछे गए सवालों को मैनेज करना

किसी खास जगह के बारे में ज़्यादा जानकारी वाले सवाल पूछें, ताकि Google पर मौजूद उपयोगकर्ता की समीक्षाओं और Maps के अन्य डेटा के आधार पर जवाब मिल सकें.

Python

from google import genai
from google.genai import types

client = genai.Client()

prompt = "Is there a cafe near the corner of 1st and Main that has outdoor seating?"

response = client.models.generate_content(
    model='gemini-3-flash-preview',
    contents=prompt,
    config=types.GenerateContentConfig(
        # Turn on the Maps tool
        tools=[types.Tool(google_maps=types.GoogleMaps())],

        # Provide the relevant location context (this is in Los Angeles)
        tool_config=types.ToolConfig(retrieval_config=types.RetrievalConfig(
            lat_lng=types.LatLng(
                latitude=34.050481, longitude=-118.248526))),
    ),
)

print("Generated Response:")
print(response.text)

if grounding := response.candidates[0].grounding_metadata:
  if chunks := grounding.grounding_chunks:
    print('-' * 40)
    print("Sources:")
    for chunk in chunks:
      print(f'- [{chunk.maps.title}]({chunk.maps.uri})')
  ```

Javascript

import { GoogleGenAI } from '@google/genai';

const ai = new GoogleGenAI({});

async function run() {
  const prompt = "Is there a cafe near the corner of 1st and Main that has outdoor seating?";

  const response = await ai.models.generateContent({
    model: 'gemini-3-flash-preview',
    contents: prompt,
    config: {
      // Turn on the Maps tool
      tools: [{googleMaps: {}}],
      // Provide the relevant location context (this is in Los Angeles)
      toolConfig: {
        retrievalConfig: {
          latLng: {
            latitude: 34.050481,
            longitude: -118.248526
          }
        }
      }
    },
  });

  console.log("Generated Response:");
  console.log(response.text);

  const chunks = response.candidates[0].groundingMetadata?.groundingChunks;
  if (chunks) {
    console.log('-'.repeat(40));
    console.log("Sources:");
    for (const chunk of chunks) {
      if (chunk.maps) {
        console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
      }
    }
  }
}

run();

REST

curl -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent' \
  -H 'Content-Type: application/json' \
  -H "x-goog-api-key: ${GEMINI_API_KEY}" \
  -d '{
  "contents": [{
    "role": "user",
    "parts": [{
      "text": "Is there a cafe near the corner of 1st and Main that has outdoor seating?"
    }]
  }],
  "tools": [{"googleMaps": {}}],
  "toolConfig": {
    "retrievalConfig": {
      "latLng": {"latitude": 34.050481, "longitude": -118.248526}
    }
  }
}'

जगह के हिसाब से मनमुताबिक अनुभव देना

किसी उपयोगकर्ता की प्राथमिकताओं और किसी खास इलाके के हिसाब से सुझाव पाएं.

Python

from google import genai
from google.genai import types

client = genai.Client()

prompt = "Which family-friendly restaurants near here have the best playground reviews?"

response = client.models.generate_content(
    model='gemini-3-flash-preview',
    contents=prompt,
    config=types.GenerateContentConfig(
      tools=[types.Tool(google_maps=types.GoogleMaps())],
      tool_config=types.ToolConfig(retrieval_config=types.RetrievalConfig(
          # Provide the location as context; this is Austin, TX.
          lat_lng=types.LatLng(
              latitude=30.2672, longitude=-97.7431))),
    ),
)

print("Generated Response:")
print(response.text)

if grounding := response.candidates[0].grounding_metadata:
  if chunks := grounding.grounding_chunks:
    print('-' * 40)
    print("Sources:")
    for chunk in chunks:
      print(f'- [{chunk.maps.title}]({chunk.maps.uri})')

Javascript

import { GoogleGenAI } from '@google/genai';

const ai = new GoogleGenAI({});

async function run() {
  const prompt = "Which family-friendly restaurants near here have the best playground reviews?";

  const response = await ai.models.generateContent({
    model: 'gemini-3-flash-preview',
    contents: prompt,
    config: {
      tools: [{googleMaps: {}}],
      toolConfig: {
        retrievalConfig: {
          // Provide the location as context; this is Austin, TX.
          latLng: {
            latitude: 30.2672,
            longitude: -97.7431
          }
        }
      }
    },
  });

  console.log("Generated Response:");
  console.log(response.text);

  const chunks = response.candidates[0].groundingMetadata?.groundingChunks;
  if (chunks) {
    console.log('-'.repeat(40));
    console.log("Sources:");
    for (const chunk of chunks) {
      if (chunk.maps) {
        console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
      }
    }
  }
}

run();

REST

curl -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent' \
  -H 'Content-Type: application/json' \
  -H "x-goog-api-key: ${GEMINI_API_KEY}" \
  -d '{
  "contents": [{
    "role": "user",
    "parts": [{
      "text": "Which family-friendly restaurants near here have the best playground reviews?"
    }],
  }],
  "tools": [{"googleMaps": {}}],
  "toolConfig": {
    "retrievalConfig": {
      "latLng": {"latitude": 30.2672, "longitude": -97.7431}
    }
  }
}'

यात्रा की योजना बनाने में मदद करना

कई दिनों की यात्रा की योजनाएं जनरेट करें. इनमें दिशा-निर्देश और अलग-अलग जगहों के बारे में जानकारी शामिल होती है. यह यात्रा से जुड़े ऐप्लिकेशन के लिए सबसे सही है.

इस उदाहरण में, Google Maps टूल में विजेट को चालू करके, googleMapsWidgetContextToken का अनुरोध किया गया है. चालू होने पर, वापस पाए गए टोकन का इस्तेमाल, Google Maps JavaScript API के <gmp-places-contextual> component का इस्तेमाल करके, कॉन्टेक्स्ट के हिसाब से Places विजेट दिखाने के लिए किया जा सकता है.

Python

from google import genai
from google.genai import types

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."

response = client.models.generate_content(
    model='gemini-3-flash-preview',
    contents=prompt,
    config=types.GenerateContentConfig(
      tools=[types.Tool(google_maps=types.GoogleMaps(enable_widget=True))],
      tool_config=types.ToolConfig(retrieval_config=types.RetrievalConfig(
          # Provide the location as context, this is in San Francisco.
          lat_lng=types.LatLng(
              latitude=37.78193, longitude=-122.40476))),
    ),
)

print("Generated Response:")
print(response.text)

if grounding := response.candidates[0].grounding_metadata:
  if grounding.grounding_chunks:
    print('-' * 40)
    print("Sources:")
    for chunk in grounding.grounding_chunks:
      print(f'- [{chunk.maps.title}]({chunk.maps.uri})')

  if widget_token := grounding.google_maps_widget_context_token:
    print('-' * 40)
    print(f'<gmp-place-contextual context-token="{widget_token}"></gmp-place-contextual>')

Javascript

import { GoogleGenAI } from '@google/genai';

const ai = new GoogleGenAI({});

async function run() {
  const 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.";

  const response = await ai.models.generateContent({
    model: 'gemini-3-flash-preview',
    contents: prompt,
    config: {
      tools: [{googleMaps: {enableWidget: true}}],
      toolConfig: {
        retrievalConfig: {
          // Provide the location as context, this is in San Francisco.
          latLng: {
            latitude: 37.78193,
            longitude: -122.40476
          }
        }
      }
    },
  });

  console.log("Generated Response:");
  console.log(response.text);

  const groundingMetadata = response.candidates[0]?.groundingMetadata;
  if (groundingMetadata) {
    if (groundingMetadata.groundingChunks) {
      console.log('-'.repeat(40));
      console.log("Sources:");
      for (const chunk of groundingMetadata.groundingChunks) {
        if (chunk.maps) {
          console.log(`- [${chunk.maps.title}](${chunk.maps.uri})`);
        }
      }
    }

    if (groundingMetadata.googleMapsWidgetContextToken) {
      console.log('-'.repeat(40));
      document.body.insertAdjacentHTML('beforeend', `<gmp-place-contextual context-token="${groundingMetadata.googleMapsWidgetContextToken}`"></gmp-place-contextual>`);
    }
  }
}

run();

REST

curl -X POST 'https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent' \
  -H 'Content-Type: application/json' \
  -H "x-goog-api-key: ${GEMINI_API_KEY}" \
  -d '{
  "contents": [{
    "role": "user",
    "parts": [{
      "text": "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": [{"googleMaps": {"enableWidget":"true"}}],
  "toolConfig": {
    "retrievalConfig": {
    "latLng": {"latitude": 37.78193, "longitude": -122.40476}
  }
  }
}'

विजेट दिखने पर, वह कुछ इस तरह दिखेगा:

रेंडर किए जाने पर, Maps विजेट का उदाहरण

सेवा के इस्तेमाल की ज़रूरी शर्तें

इस सेक्शन में, Grounding with Google Maps के इस्तेमाल की ज़रूरी शर्तों के बारे में बताया गया है.

Google Maps के सोर्स के इस्तेमाल के बारे में उपयोगकर्ता को बताना

Google Maps के भरोसेमंद स्रोतों से मिले हर नतीजे के साथ, आपको groundingChunks में सोर्स मिलेंगे. ये सोर्स, हर जवाब के लिए काम करते हैं. इसके अलावा, यह मेटाडेटा भी वापस मिलता है:

  • सोर्स यूआरआई
  • title
  • आईडी

Grounding with Google Maps से मिले नतीजे दिखाते समय, आपको Google Maps के सोर्स की जानकारी देनी होगी. साथ ही, अपने उपयोगकर्ताओं को यह जानकारी देनी होगी:

  • Google Maps के सोर्स, जनरेट किए गए उस कॉन्टेंट के तुरंत बाद दिखने चाहिए जिसके लिए सोर्स काम करते हैं. जनरेट किए गए इस कॉन्टेंट को, Google Maps के भरोसेमंद स्रोतों से मिले नतीजे भी कहा जाता है.
  • Google Maps के सोर्स, उपयोगकर्ता के एक इंटरैक्शन में दिखने चाहिए.

Google Maps के लिंक के साथ, Google Maps के सोर्स दिखाना

groundingChunks और grounding_chunks.maps.placeAnswerSources.reviewSnippets में मौजूद हर सोर्स के लिए, इन ज़रूरी शर्तों के मुताबिक लिंक की झलक जनरेट करनी होगी:

इन इमेज में, सोर्स और Google Maps के लिंक दिखाने के लिए ज़रूरी शर्तें दिखाई गई हैं.

जवाब के सोर्स दिखाने वाला प्रॉम्प्ट

आपके पास सोर्स के व्यू को छोटा करने का विकल्प होता है.

जवाब और सोर्स को छोटा करके दिखाया गया प्रॉम्प्ट

ज़रूरी नहीं: लिंक की झलक को अन्य कॉन्टेंट के साथ बेहतर बनाएं. जैसे:

  • Google Maps के टेक्स्ट एट्रिब्यूशन से पहले, Google Maps का फ़ेविकॉन डाला जाता है.
  • सोर्स यूआरएल (og:image) से कोई फ़ोटो.

Google Maps के कुछ डेटा देने वाले पार्टनर और उनकी लाइसेंस की शर्तों के बारे में ज़्यादा जानने के लिए, Google Maps और Google Earth के कानूनी नोटिस देखें.

Google Maps के टेक्स्ट एट्रिब्यूशन के दिशा-निर्देश

टेक्स्ट में सोर्स को Google Maps से एट्रिब्यूट करते समय, इन दिशा-निर्देशों का पालन करें:

  • Google Maps के टेक्स्ट में किसी भी तरह का बदलाव न करें:
    • Google Maps के केस में बदलाव न करें.
    • Google Maps को एक से ज़्यादा लाइनों में न दिखाएं.
    • Google Maps को किसी दूसरी भाषा में स्थानीय भाषा में अनुवाद न करें.
    • ब्राउज़र को Google Maps का अनुवाद करने से रोकने के लिए, HTML एट्रिब्यूट translate="no" का इस्तेमाल करें.
  • Google Maps के टेक्स्ट को, यहां दी गई टेबल के मुताबिक स्टाइल करें:
प्रॉपर्टी शैली
Font family Roboto. फ़ॉन्ट लोड करना ज़रूरी नहीं है.
Fallback font family आपके प्रॉडक्ट में पहले से इस्तेमाल किया जा रहा कोई भी sans serif बॉडी फ़ॉन्ट या डिफ़ॉल्ट सिस्टम फ़ॉन्ट को कॉल करने के लिए "Sans-Serif"
Font style सामान्य
Font weight 400
Font color सफ़ेद, काला (#1F1F1F) या ग्रे (#5E5E5E). बैकग्राउंड के मुकाबले, 4.5:1 का कंट्रास्ट बनाए रखें.
Font size
  • कम से कम फ़ॉन्ट साइज़: 12sp
  • ज़्यादा से ज़्यादा फ़ॉन्ट साइज़: 16sp
  • sp के बारे में जानने के लिए, Material Design की वेबसाइट पर फ़ॉन्ट साइज़ की इकाइयां देखें.
Spacing सामान्य

सीएसएस का उदाहरण

नीचे दिया गया सीएसएस, Google Maps को सफ़ेद या हल्के बैकग्राउंड पर, सही टाइपोग्राफ़िक स्टाइल और रंग के साथ दिखाता है.

CSS

@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

.GMP-attribution {

font-family: Roboto, Sans-Serif;
font-style: normal;
font-weight: 400;
font-size: 1rem;
letter-spacing: normal;
white-space: nowrap;
color: #5e5e5e;
}

कॉन्टेक्स्ट टोकन, जगह का आईडी, और समीक्षा का आईडी

Google Maps के डेटा में, कॉन्टेक्स्ट टोकन, जगह का आईडी, और समीक्षा का आईडी शामिल होता है. जवाब के इस डेटा को कैश मेमोरी में सेव किया जा सकता है, स्टोर किया जा सकता है, और एक्सपोर्ट किया जा सकता है:

  • googleMapsWidgetContextToken
  • placeId
  • reviewId

Grounding with Google Maps की शर्तों में, कैश मेमोरी में सेव करने पर लगी पाबंदियां लागू नहीं होती हैं.

रोकी गई गतिविधि और इलाका

Grounding with Google Maps के लिए, कुछ कॉन्टेंट और गतिविधियों पर अतिरिक्त पाबंदियां हैं, ताकि प्लैटफ़ॉर्म को सुरक्षित और भरोसेमंद बनाए रखा जा सके. शर्तों में इस्तेमाल की पाबंदियों के अलावा शर्तों:

  • Grounding with Google Maps का इस्तेमाल, ज़्यादा जोखिम वाली गतिविधियों के लिए नहीं किया जाएगा. इनमें, आपातकालीन सेवाओं के लिए जवाब देने वाली सेवाएं भी शामिल हैं.
  • आप अपने उस ऐप्लिकेशन को किसी ऐसे इलाके में डिस्ट्रिब्यूट या उसकी मार्केटिंग नहीं करेंगे जहां Grounding with Google Maps की सुविधा उपलब्ध नहीं है. फ़िलहाल, ये इलाके ऐसे हैं जहां Grounding with Google Maps की सुविधा उपलब्ध नहीं है:

    • चीन
    • क्रीमिया
    • क्यूबा
    • डनेत्स्क पीपल्स रिपब्लिक
    • ईरान
    • लुहैंस्क पीपल्स रिपब्लिक
    • उत्तर कोरिया
    • सीरिया
    • वियतनाम

    इस सूची को समय-समय पर अपडेट किया जा सकता है.

सबसे सही तरीके

  • उपयोगकर्ता की जगह की जानकारी देना: सबसे काम के और मनमुताबिक जवाब पाने के लिए, googleMapsGrounding कॉन्फ़िगरेशन में हमेशा user_location (अक्षांश और देशांतर) शामिल करें. ऐसा तब करें, जब उपयोगकर्ता की जगह की जानकारी उपलब्ध हो.
  • कॉन्टेक्स्ट के हिसाब से Google Maps विजेट दिखाना: कॉन्टेक्स्ट के हिसाब से विजेट, कॉन्टेक्स्ट टोकन googleMapsWidgetContextToken का इस्तेमाल करके दिखाया जाता है. यह टोकन, Gemini API के जवाब में मिलता है. इसका इस्तेमाल, Google Maps से विज़ुअल कॉन्टेंट दिखाने के लिए किया जा सकता है. कॉन्टेक्स्ट के हिसाब से विजेट के बारे में ज़्यादा जानने के लिए, Google Developers की गाइड में Grounding with Google Maps विजेट देखें.
  • आखिरी उपयोगकर्ताओं को जानकारी देना: अपने आखिरी उपयोगकर्ताओं को साफ़ तौर पर बताएं कि उनकी क्वेरी के जवाब देने के लिए, Google Maps के डेटा का इस्तेमाल किया जा रहा है. ऐसा तब करें, जब टूल चालू हो.
  • लेटेंसी की निगरानी करना: बातचीत वाले ऐप्लिकेशन के लिए, पक्का करें कि भरोसेमंद स्रोतों से मिले जवाबों के लिए P95 लेटेंसी, स्वीकार की जा सकने वाली सीमा के अंदर हो. इससे उपयोगकर्ता को बेहतर अनुभव मिलता है.
  • ज़रूरत न होने पर बंद करना: Grounding with Google Maps, डिफ़ॉल्ट रूप से बंद होता है. इसे सिर्फ़ तब चालू करें ("tools": [{"googleMaps": {}}]), जब किसी क्वेरी में भौगोलिक कॉन्टेक्स्ट शामिल हो. इससे परफ़ॉर्मेंस और लागत को ऑप्टिमाइज़ किया जा सकता है.

सीमाएं

  • भौगोलिक दायरा: Grounding with Google Maps, दुनिया भर में उपलब्ध है
  • मॉडल के साथ काम करने की सुविधा: काम करने वाले मॉडल सेक्शन देखें.
  • मल्टीमॉडल इनपुट/आउटपुट: फ़िलहाल, Grounding with Google Maps, टेक्स्ट और कॉन्टेक्स्ट के हिसाब से मैप विजेट के अलावा, मल्टीमॉडल इनपुट या आउटपुट के साथ काम नहीं करता है.
  • डिफ़ॉल्ट स्थिति: Grounding with Google Maps टूल, डिफ़ॉल्ट रूप से बंद होता है. आपको एपीआई के अनुरोधों में इसे साफ़ तौर पर चालू करना होगा.

कीमत और दर की सीमाएं

Grounding with Google Maps की कीमत, क्वेरी के आधार पर तय की जाती है. फ़िलहाल, इसकी दर 25 डॉलर / 1,000 भरोसेमंद स्रोतों से मिले प्रॉम्प्ट है. मुफ़्त टियर में, हर दिन 500 अनुरोध किए जा सकते हैं. किसी अनुरोध को, कोटा में सिर्फ़ तब गिना जाता है, जब कोई प्रॉम्प्ट, Google Maps के भरोसेमंद स्रोतों से मिले कम से कम एक नतीजे को वापस करता है. इसका मतलब है कि नतीजों में, Google Maps का कम से कम एक सोर्स शामिल होना चाहिए. अगर एक अनुरोध से Google Maps को कई क्वेरी भेजी जाती हैं, तो इसे दर की सीमा के हिसाब से एक अनुरोध के तौर पर गिना जाता है.

कीमत के बारे में ज़्यादा जानकारी के लिए, Gemini API की कीमत वाला पेज देखें.

काम करने वाले मॉडल

ये मॉडल, Grounding with Google Maps के साथ काम करते हैं:

मॉडल Grounding with Google Maps
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 मॉडल, बिल्ट-इन टूल (जैसे, Grounding with Google Maps) को कस्टम टूल (फ़ंक्शन कॉलिंग) के साथ इस्तेमाल करने की सुविधा देते हैं. ज़्यादा जानने के लिए, टूल के कॉम्बिनेशन वाला पेज देखें.

आगे क्या करना है