Google マップによるグラウンディング

Google Mapsによるグラウンディングは、Geminiモデルを地理空間 Google Mapsのデータに接続して、位置情報を認識する機能 をアプリに組み込むことができるようにします。

Google Maps によるグラウンディングには次のようなメリットがあります。

  • 事実の正確性を高める: 2 億 5,000 万件を超える実世界の場所やビジネスの Google データベースに基づいて回答することで、モデルのハルシネーションを減らします。
  • リアルタイムの情報にアクセスする: 現在の営業時間や EV 充電ステーションのリアルタイムのステータスなど、 ライブデータを使用して質問に回答します。
  • 視覚的なコンテキストを提供する: モデルの位置情報に基づく主張とともに、インタラクティブなマップ ウィジェット、写真、ストリートビューを直接統合することで、ユーザーの信頼を高めます。

サポートされているモデル

  • gemini-3.1-pro-preview
  • gemini-3.5-flash
  • gemini-3.1-flash-lite
  • gemini-2.5-pro
  • gemini-2.5-flash
  • gemini-2.5-flash-lite

サポートされている言語

サポートされている言語 Gemini モデルでご覧ください。

Google Maps でモデルをグラウンディングする

Gemini API プロバイダをクリックして、このページでプロバイダ固有のコンテンツとコードを表示します。

GenerativeModel インスタンスを作成するときに、モデルが回答の生成に使用できる tool として GoogleMaps を指定します。

Swift


import FirebaseAILogic

// Initialize the Gemini Developer API backend service.
let ai = FirebaseAI.firebaseAI(backend: .googleAI())

// Example: Coordinates for New York City
let latAndLong = CLLocationCoordinate2D(latitude: 40.7128, longitude: -74.0060)

// (Optional) Define a RetrievalConfig to configure the Grounding with Google Maps tool.
// You can optionally provide a location's coordinates and/or a language code
// for more relevant and personalized Google Maps results.
let retrievalConfig = RetrievalConfig(
    location: latAndLong,
    // Example: Language code for English (US).
    languageCode: "en_US"
)

// Wrap the RetrievalConfig inside a ToolConfig.
let toolConfig = ToolConfig(retrievalConfig: retrievalConfig)

// Create a `GenerativeModel` instance with a model that supports your use case.
let model = ai.generativeModel(
    modelName: "GEMINI_MODEL_NAME",
    // Provide Google Maps as a tool that the model can use to generate its response.
    tools: [Tool.googleMaps()],
    // Add the configuration for the Grounding with Google Maps tool
    // (if this optional config was defined above).
    toolConfig: toolConfig
)

let response = try await model.generateContent("restaurants near me?")
print(response.text ?? "No text in response.")

// Make sure to comply with the "Grounding with Google Maps" usage requirements,
// which includes how you meet service usage requirements

Kotlin


// (Optional) Define a RetrievalConfig to configure the Grounding with Google Maps tool.
// You can optionally provide a location's coordinates and/or a language code
// for more relevant and personalized Google Maps results.
val retrievalConfig = RetrievalConfig(
    // Example: Coordinates for New York City
    latLng = LatLng(latitude = 40.7128, longitude = -74.0060),
    // Example: Language code for English (US)
    languageCode = "en_US"
)

// Wrap the RetrievalConfig inside a ToolConfig.
val toolConfig = ToolConfig(
    retrievalConfig = retrievalConfig
)

// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
val model = Firebase.ai(backend = GenerativeBackend.googleAI()).generativeModel(
    modelName = "GEMINI_MODEL_NAME",
    // Add the configuration for the Grounding with Google Maps tool
    // (if this optional config was defined above).
    toolConfig = toolConfig,
    // Provide Google Maps as a tool that the model can use to generate its response.
    tools = listOf(Tool.googleMaps())
)

val response = model.generateContent("restaurants near me?")
print(response.text)

// Make sure to comply with the "Grounding with Google Maps" usage requirements,
// which includes how you meet service usage requirements

Java


// (Optional) Define a ToolConfig to configure the Grounding with Google Maps tool.
// You can optionally provide a location's coordinates and/or a language code
// for more relevant and personalized Google Maps results.
ToolConfig toolConfig = new ToolConfig(
    null,
    new RetrievalConfig(
        // Example: Coordinates for New York City.
        new LatLng(40.7128, -74.0060),
        // Example: Language code for English (US).
       "en_US"
    )
);

// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.googleAI())
                .generativeModel("GEMINI_MODEL_NAME",
                        null,
                        null,
                        // Provide Google Maps as a tool that the model can use to generate its response.
                        List.of(Tool.googleMaps()),
                        // Add the configuration for the Grounding with Google Maps tool
                        // (if this optional config was defined above).
                        toolConfig);

// Use the GenerativeModelFutures Java compatibility layer which offers
// support for ListenableFuture and Publisher APIs.
GenerativeModelFutures model = GenerativeModelFutures.from(ai);

ListenableFuture response = model.generateContent("restaurants near me?");
  Futures.addCallback(response, new FutureCallback() {
      @Override
      public void onSuccess(GenerateContentResponse result) {
          String resultText = result.getText();
          System.out.println(resultText);
      }

      @Override
      public void onFailure(Throwable t) {
          t.printStackTrace();
      }
  }, executor);

// Make sure to comply with the "Grounding with Google Maps" usage requirements,
// which includes how you meet service usage requirements

Web


import { initializeApp } from "firebase/app";
import { getAI, getGenerativeModel, GoogleAIBackend } from "firebase/ai";

// TODO(developer) Replace the following with your app's Firebase configuration
// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
  // ...
};

// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);

// Initialize the Gemini Developer API backend service.
const ai = getAI(firebaseApp, { backend: new GoogleAIBackend() });

// (Optional) Define a toolConfig to configure the Grounding with Google Maps tool.
// You can optionally provide a location's coordinates and/or a language code
// for more relevant and personalized Google Maps results.
const toolConfig = {
  retrievalConfig: {
    // Example: Coordinates for New York City
    latLng: {
      latitude: 40.7128,
      longitude: -74.0060
    },
    // Example: Language code for English (US)
    languageCode: 'en-US'
  }
};

// Create a `GenerativeModel` instance with a model that supports your use case
const model = getGenerativeModel(
  ai,
  {
    model: "GEMINI_MODEL_NAME",
    // Provide Google Maps as a tool that the model can use to generate its response.
    // (Optional) Set `enableWidget` to control whether the response contains a `googleMapsWidgetContextToken`.
    tools: [ { googleMaps: { enableWidget: true } } ],
    // Add the configuration for the Grounding with Google Maps tool
    // (if this optional config was defined above).
    toolConfig
  }
);

const result = await model.generateContent("restaurants near me?");

console.log(result.response.text());

// Make sure to comply with the "Grounding with Google Maps" usage requirements,
// which includes how you meet service usage requirements

Dart


import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_ai/firebase_ai.dart';
import 'firebase_options.dart';

// Initialize FirebaseApp.
await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,
);

// (Optional) Define a ToolConfig to configure the Grounding with Google Maps tool.
// You can optionally provide a location's coordinates and/or a language code
// for more relevant and personalized Google Maps results.
final toolConfig = ToolConfig(
  retrievalConfig: RetrievalConfig(
    // Example: Coordinates for New York City.
    latLng: LatLng(latitude: 40.712728, longitude: -74.006015),
    // Example: Language code for English (US).
    languageCode: 'en',
  ),
);

// Initialize the Gemini Developer API backend service.
// Create a `GenerativeModel` instance with a model that supports your use case.
final model = FirebaseAI.googleAI().generativeModel(
  model: 'GEMINI_MODEL_NAME',
  // Provide Google Maps as a tool that the model can use to generate its response.
  tools: [
    Tool.googleMaps(),
  ],
  // Add the configuration for the Grounding with Google Maps tool
  // (if this optional config was defined above).
  toolConfig: toolConfig,
);

final response = await model.generateContent([Content.text("restaurants near me?")]);
print(response.text);

// Make sure to comply with the "Grounding with Google Maps" usage requirements,
// which includes how you meet service usage requirements

Unity


using Firebase;
using Firebase.AI;

// Initialize the Gemini Developer API backend service.
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI());

// Example: Coordinates for New York City
var latLng = new LatLng(40.7128, -74.0060);

// (Optional) Define a RetrievalConfig to configure the Grounding with Google Maps tool.
// You can optionally provide a location's coordinates and/or a language code
// for more relevant and personalized Google Maps results.
var retrievalConfig = new RetrievalConfig(latLng, languageCode: "en");

// Wrap the RetrievalConfig inside a ToolConfig.
var toolConfig = new ToolConfig(retrievalConfig: retrievalConfig);

// Create a `GenerativeModel` instance with a model that supports your use case
var model = ai.GetGenerativeModel(
  modelName: "GEMINI_MODEL_NAME",
  // Provide Google Maps as a tool that the model can use to generate its response.
  tools: new[] { new Tool(new GoogleMaps()) },
  // Add the configuration for the Grounding with Google Maps tool
  // (if this optional config was defined above).
  toolConfig: toolConfig
);

var response = await model.GenerateContentAsync("restaurants near me?");
UnityEngine.Debug.Log(response.Text ?? "No text in response.");

// Make sure to comply with the "Grounding with Google Maps" usage requirements,
// which includes how you meet service usage requirements

ユースケースとアプリに適したモデル を選択する方法をご覧ください。

結果を改善するためのベスト プラクティスとヒント

このセクションでは、グラウンディングと Google Mapsを併用する際の一般的なベスト プラクティスと、場所のプロパティを活用して 結果を改善する方法について説明します。

一般的なベスト プラクティス

  • 必要な場合にのみツールを提供する: パフォーマンスと費用を最適化するには、 ユースケースに明確な地理的コンテキストがある場合にのみ、Google Maps によるグラウンディング ツールへのアクセス権をモデルに付与します。

  • ユーザーの位置情報を提供する: 最も関連性の高いパーソナライズされた回答を得るには (ユーザーの位置情報がわかっている場合)、グラウンディング ツールの構成にユーザーの位置情報( 緯度と経度を latLng で使用)を含めます。Google Maps

  • エンドユーザーに通知する: Google Mapsデータ がクエリの回答に使用されていることをエンドユーザーに明確に通知します。エンドユーザーにソース をGoogle Mapsから提供することは、 サービス使用要件 で、Google Mapsによるグラウンディング ツールのものです。

  • (Web SDK のみ) Google Maps コンテキスト ウィジェットをレンダリアングする: コンテキスト ウィジェットは、Gemini API レスポンスで返されるコンテキスト トークン googleMapsWidgetContextToken を使用してレンダリングされます。このトークンを使用して、Google Maps のビジュアル コンテンツをレンダリングできます。コンテキスト ウィジェットについて詳しくは、 Google Maps ウィジェット のドキュメントをご覧ください。Google Maps

プロンプトで場所のプロパティを使用する

このセクションでは、場所の説明に使用され、グラウンディングでレスポンスの生成に使用される 場所のプロパティについて説明します。Google Mapsこれらのプロパティ は、グラウンディングで回答できる質問のタイプを特定するために使用されます。Google Maps

場所のプロパティの例

このリストは、モデルがレスポンスの生成に使用できる場所に関するプロパティのアルファベット順のサンプルです。

  • 住所
  • ピックアップ
  • デビットカード
  • 距離
  • 無料駐車場
  • 生演奏が楽しめるお店
  • 子供向けメニュー
  • 営業時間
  • お支払い方法(現金、クレジット カードなど)
  • 場所に関する回答
  • ペット OK
  • ビールを出すお店
  • ベジタリアン料理の提供
  • 車椅子対応
  • Wi-Fi

場所の回答 は、Google Maps によるグラウンディングから、ユーザーのクチコミから得られた 情報に基づいて得られた回答です。

場所のプロパティを使用するプロンプトの例

次の例では、 場所のプロパティ をさまざまな種類の場所に関するプロンプトで使用しています。Google Mapsでのグラウンディングでは、 プロパティを使用してユーザーの意図を理解し、 場所に関連付けられたデータに基づいて関連性の高い回答を提供します。Google Maps

  • 家族での夕食を計画する: レストランが 家族連れに適しているかどうか、便利なサービスを提供しているかどうかの判断に役立ちます。

    • プロンプトの例: 「イタリアン プレイス」は子供連れでも大丈夫ですか? テイクアウトはできますか?評価はどのくらいですか?
  • 友人のアクセシビリティを確認する: 場所が 特定のアクセシビリティのニーズを満たしているかどうかを確認します。

    • プロンプトの例: 「車椅子対応の入り口があるレストランを探して」
  • 夜食を食べられる場所を探す: 特定の時間に特定の食事を提供する営業中の店舗 を探します。

    • プロンプトの例: 「Burger Joint」は今営業していますか?ディナーは提供していますか? 金曜日の営業時間は何時から何時までですか?
  • クライアントとコーヒーを飲む: アメニティ、提供内容、お支払い方法に基づいて、 ビジネス ミーティングに適したカフェかどうかを評価します。

    • プロンプトの例: 「カフェ セントラル」に Wi-Fi はありますか?コーヒーは飲めますか? 価格帯とクレジット カードの利用可否を教えてください。

Google Mapsグラウンディングされた検索結果の情報は、道路の実際の状況と異なる場合があります。

グラウンディングの仕組みGoogle Maps

モデルに GoogleMaps ツールを提供すると、モデルは情報の検索、処理、引用のワークフロー全体を自動的に処理します。

モデルのワークフローは次のとおりです。

  1. プロンプトを受信する: アプリは、Gemini モデルに GoogleMaps ツールが有効になっているプロンプトを送信します。

  2. プロンプトを分析する: モデルはプロンプトを分析し、 Google Mapsで回答を改善できるかどうかを判断します。たとえば、プロンプトに地理的コンテキスト(「近くのコーヒー ショップ」、「 サンフランシスコの美術館」など)が含まれている場合です。

  3. ツールを呼び出す: モデルは地理的な意図を認識し、 Google Maps ツールによるグラウンディングを呼び出します。

  4. にクエリを送信するGoogle Maps: によるグラウンディング サービスは、関連情報(場所、レビュー、写真、住所、営業時間など)について Google Maps にクエリを実行します。Google Maps

    必要に応じて、ツールの構成に緯度と経度を含める(またはプロンプトに直接含める)ことで、より関連性の高いパーソナライズされた結果を得ることができます。Google Mapsこのツールはテキスト検索ツールであり、 Google Mapsでの検索と同様に動作します。つまり、ローカル クエリ(「近くの」) では座標が使用されますが、特定のクエリやローカル以外のクエリは明示的な位置情報の影響を受けにくいです。

  5. 結果を処理する: モデルは Google Maps結果を処理し、元のプロンプトに対する回答を作成します。Google Maps

  6. グラウンディングされた検索結果を返す: モデルは、Google Maps の結果に基づいてグラウンディングされた、最終的な ユーザーフレンドリーな回答を返します。Google Mapsこのレスポンスの内容は、次のとおりです。

    • モデルのテキスト回答。
    • groundingMetadata オブジェクトと Google Maps 結果と ソース。
    • (Web SDK のみ) 必要に応じて、アプリでコンテキスト Google Maps ウィジェットをレンダリングして視覚的な操作を行うことができる googleMapsWidgetContextToken。コンテキスト ウィジェットについて詳しくは、 グラウンディング ウィジェット ドキュメントをご覧ください。Google MapsGoogle Maps

モデルに Google Maps をツールとして提供しても、モデルが回答の生成に常に Google Maps ツールを使用する必要はありません。このような場合、回答には groundingMetadata オブジェクトが含まれないため、not a Google Maps Grounded Result ではありません。

グラウンディングされた検索結果について

モデルが Google Maps の結果に基づいて回答をグラウンディングする場合、回答 には groundingMetadata オブジェクトが含まれます。このオブジェクトには、主張を検証し、アプリで豊富なソース エクスペリエンスを構築するために 不可欠な構造化データが含まれています。

groundingMetadata オブジェクトには、Google Maps Grounded Result に含まれる 次の情報が含まれます。

groundingMetadata オブジェクトを含むレスポンスの例を次に示します。

{
  "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"
            }
          }
        ],
        "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]
          }
        ],
        "googleMapsWidgetContextToken": "widgetcontent/..."
      }
    }
  ]
}

サービスの使用要件

このセクションでは、選択した Gemini API プロバイダ(Gemini Developer API または Vertex AI Gemini API)の Google Maps によるグラウンディングのサービス使用要件について説明します(サービス固有規約のサービス規約 セクションをご覧ください)。

ソースをユーザーに通知するGoogle Maps

Google Mapsグラウンディングされた検索結果ごとに、各レスポンスをサポートするソースが groundingChunksで提供されます。次のメタデータも返されます。

  • ソースの URI
  • タイトル
  • ID

アプリで Google Maps によるグラウンディングの結果を表示する場合は、関連する Google Maps のソースを指定し、ユーザーに次の情報を通知する必要があります。

  • Google Maps ソースは、ソースがサポートする生成コンテンツ の直後に示す必要があります。この生成されたコンテンツは、 Google Mapsグラウンディングの結果ともいいます。

  • Google Maps のソースは、1 回のユーザー操作で表示できる必要があります。

Google Mapsグラウンディングされた検索結果からソースを表示する値を取得する方法は次のとおりです。

Swift

// ...

// Get the model's response
let text = response.text

// Get the grounding metadata
if let candidate = response.candidates.first,
   let groundingMetadata = candidate.groundingMetadata {

  // Get sources
  let groundingChunks = groundingMetadata.groundingChunks
  for chunk in groundingChunks {
    if let maps = chunk.maps {
      let title = maps.title  // for example, "Heaven on 7th Marketplace"
      let url = maps.url  // for example, "https://maps.google.com/?cid=13100894621228039586"
      let placeId = maps.placeId  // for example, "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
      // TODO(developer): show source in the UI
    }
  }
}

Kotlin

// ...

// Get the model's response
val text = response.text

// Get the grounding metadata
val groundingMetadata = response.candidates.firstOrNull()?.groundingMetadata

// Get sources
val groundingChunks = groundingMetadata?.groundingChunks
groundingChunks?.let { chunks ->
  for (chunk in chunks) {
    val title = chunk.maps?.title  // for example, "Heaven on 7th Marketplace"
    val uri = chunk.maps?.uri  // for example, "https://maps.google.com/?cid=13100894621228039586"
    val placeId = chunk.maps?.placeId  // for example, "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
    // TODO(developer): show source in the UI
  }
}

Java

// ...

Futures.addCallback(response, new FutureCallback() {
  @Override
  public void onSuccess(GenerateContentResponse result) {
    // Get the model's response
    String text = result.getText();

    // Get the grounding metadata
    GroundingMetadata groundingMetadata =
        result.getCandidates()[0].getGroundingMetadata();

    if (groundingMetadata != null) {
      // Get sources
      List chunks = groundingMetadata.getGroundingChunks();
      if (chunks != null) {
        for(GroundingChunk chunk : chunks) {
          GoogleMapsGroundingChunk maps = chunk.getMaps();
          if (maps != null) {
            String title = maps.getTitle();  // for example, "Heaven on 7th Marketplace"
            String uri = maps.getUri();  // for example, "https://maps.google.com/?cid=13100894621228039586"
            String placeId = maps.getPlaceId();  // for example, "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
            // TODO(developer): show sources in the UI
          }
        }
      }
    }
  }

  @Override
  public void onFailure(Throwable t) {
    t.printStackTrace();
  }
}, executor);

Web

// ...

// Get the model's text response
const text = result.response.text();

// Get the grounding metadata
const groundingMetadata = result.response.candidates?.[0]?.groundingMetadata;

// Get sources
const groundingChunks = groundingMetadata?.groundingChunks;
if (groundingChunks) {
  for (const chunk of groundingChunks) {
    const title = chunk.maps?.title;  // for example, "Heaven on 7th Marketplace"
    const uri = chunk.maps?.uri;  // for example, "https://maps.google.com/?cid=13100894621228039586"
    const placeId = chunk.maps?.placeId;  // for example, "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
    // TODO(developer): show sources in the UI
  }
}

Dart

// ...

// Get the model's response
final text = response.text;

// Get the grounding metadata
final groundingMetadata = response.candidates.first.groundingMetadata;

// Get sources
final groundingChunks = groundingMetadata?.groundingChunks;
if (groundingChunks != null) {
  for (var chunk in groundingChunks) {
    final title = chunk.maps?.title;  // for example, "Heaven on 7th Marketplace"
    final uri = chunk.maps?.uri;  // for example, "https://maps.google.com/?cid=13100894621228039586"
    final placeId = chunk.maps?.placeId;  // for example, "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
    // TODO(developer): show sources in the UI
  }
}

Unity

// ...

// Get the model's response
var text = response.Text;

// Get the grounding metadata
var groundingMetadata = response.Candidates.First().GroundingMetadata;

// Get sources
if (groundingMetadata != null) {
  foreach(GroundingChunk chunk in groundingMetadata?.GroundingChunks) {
    if (chunk.Maps != null) {
      var title = chunk.Maps?.Title;  // for example, "Heaven on 7th Marketplace"
      var uri = chunk.Maps?.Uri;  // for example, "https://maps.google.com/?cid=13100894621228039586"
      var placeId = chunk.Maps?.PlaceId;  // for example, "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
      // TODO(developer): show sources in the UI
    }
  }
}

groundingChunks の各ソースについて、次の要件に沿ってリンクのプレビューを生成する必要があります。

ソースが表示された回答を含むプロンプト

ソースのビューは折りたたむことができます。

プロンプトと回答、ソースが折りたたまれた状態

必要に応じて、リンクのプレビューを次のような追加コンテンツで強化できます。

Google Maps データ プロバイダとその ライセンス条項について詳しくは、 Google マップと Google Earth の法的通知をご覧ください。

Google Maps テキスト帰属ガイドライン

テキスト内でソースを Google Maps に帰属させる場合は、次の ガイドラインに従ってください。

  • Google Maps というテキストは一切変更しないでください。

    • Google Maps というテキストの大文字と小文字を変更しないでください。
    • Google Maps というテキストを複数行に折り返さないでください。
    • Google Maps というテキストを他の言語にローカライズしないでください。
    • HTML 属性 translate="no" を使用して、ブラウザが Google Maps というテキストを翻訳しないようにします。
  • 次の表の説明に従って、Google Maps というテキストのスタイルを設定します。

    プロパティ スタイル
    フォント ファミリー Roboto。フォントの読み込みは任意です。
    代替フォント ファミリー プロダクトですでに使用されている Sans Serif の本文フォント、またはデフォルトのシステム フォントを呼び出すための "Sans-Serif"
    フォント スタイル 標準
    フォントの太さ 400
    フォントの色 白、黒(#1F1F1F)、グレー(#5E5E5E)。 背景に対してアクセシビリティの高い(4.5:1)コントラストを維持します。
    フォントサイズ 最小フォントサイズ: 12sp
    最大フォントサイズ: 16sp
    sp について詳しくは、 マテリアル デザインのウェブサイトでフォントサイズの単位をご覧ください。
    間隔 標準

CSS の例

次の CSS は、白または明るい背景に適切なタイポグラフィ スタイルと色で Google Maps というテキストをレンダリングします。

@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;
}

コンテキスト トークンと場所 ID のキャッシュ保存

Google Mapsグラウンディングされた検索結果には、コンテキスト トークンと場所 ID が含まれる場合があります。次のレスポンス データをキャッシュに保存してエクスポートできます。

  • (Web SDK のみ) googleMapsWidgetContextToken
  • placeId

Google マップによるグラウンディングの利用規約に定められているキャッシュ保存の制限は、このデータには適用されません。

禁止されているアクティビティと地域

Google Maps でのグラウンディングには、安全で信頼性の高いプラットフォームを維持するため、特定のコンテンツ とアクティビティに対する追加の制限があります。選択した Gemini API プロバイダの利用規約に定められている使用制限に加えて(Gemini Developer API または Vertex AI Gemini APIサービス規約セクションをサービス固有規約でご確認ください)。

  • 緊急対応サービスなど、高リスクな活動に Google Maps によるグラウンディングを使用することはできません。

  • 禁止されている地域でグラウンディング をGoogle Maps提供するアプリを配布または販売することはできません。詳しくは、 Google Maps Platform で禁止されている地域をご覧ください。 禁止されている地域のリストは随時更新される可能性があります。

Firebase コンソールでのグラウンディングされた検索結果と AI モニタリング

Firebase コンソールで AI モニタリングを有効にすると、レスポンスは Cloud Logging に保存されます。FirebaseCloud Loggingデフォルトでは、このデータの保持期間は 30 日間です。

この保持期間、または設定したカスタム 期間が、特定のユースケースと、選択した Gemini API プロバイダ(Gemini Developer API または Vertex AI Gemini API)の追加の コンプライアンス要件(サービス固有規約の サービス規約 セクションをご覧ください)に完全に準拠していることを確認する必要があります。これらの要件を満たすために、Cloud Logging の保持期間を 調整する 必要がある場合があります。

料金とレート制限

Google Maps によるグラウンディングの料金はクエリに基づいています。プロンプトが少なくとも 1 つの Google Maps グラウンディングされた検索結果を正常に返した場合(つまり、レスポンスに少なくとも 1 つの Google Maps ソースが含まれている場合)にのみ、リクエストは Google Maps 割り当てに カウントされます。1 つのリクエストから複数のクエリが Google Mapsに送信された場合、 レート制限に対して 1 つのリクエストとしてカウントされます。

選択した Gemini API プロバイダのドキュメント(Gemini Developer API | Vertex AI Gemini API)で、 Grounding with Google Maps の料金、モデルの可用性、上限の詳細を確認してください。