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

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

Google Maps を使用したグラウンディングには、次の利点があります。

  • 事実に基づく精度を高める: 2 億 5,000 万を超える実世界の場所やビジネスに関する Google のデータベースに基づいて回答することで、モデルのハルシネーションを減らします。
  • リアルタイムの情報にアクセスする: 現在の営業時間や EV 充電スタンドのリアルタイムのステータスなど、ライブデータを使用して質問に回答します。
  • ソースを提供する: Google Maps の場所のソースとリンクをモデルの位置情報に基づく主張の横に直接表示することで、ユーザーの信頼を高めます。

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

  • gemini-3.1-pro-preview
  • gemini-3.8-flash(および以前の gemini-3.7-flash、gemini-3.6-flash、gemini-3.5-flash)
  • gemini-3.5-flash-lite(および古い gemini-3.1-flash-lite)

汎用 Gemini 2.5 モデルはこの機能をサポートしていますが、すべて非推奨になっています。

サポートされている言語

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.
    tools: [ { googleMaps: {} } ],
    // 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-US',
  ),
);

// 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 ツールを使用したグラウンディングへのアクセス権をモデルに付与します。

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

  • エンドユーザーに通知する: 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. プロンプトを受信: アプリが GoogleMaps ツールを有効にして、Gemini モデルにプロンプトを送信します。

  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 の結果に基づいてグラウンディングされた、最終的なユーザー フレンドリーなレスポンスを返します。このレスポンスの内容は、次のとおりです。

    • モデルのテキスト回答。
    • Google Maps の結果とソースを含む groundingMetadata オブジェクト。

Google Maps をモデルのツールとして提供しても、モデルが常に Google Maps ツールを使用してレスポンスを生成する必要はありません。このような場合、レスポンスに groundingMetadata オブジェクトは含まれないため、Google Maps グラウンディングされた結果にはなりません。

グラウンディングされた結果を理解する

モデルが Google Maps の結果に基づいてレスポンスを生成する場合、レスポンスには groundingMetadata オブジェクトが含まれます。このオブジェクトには、クレームの検証とアプリケーションでのリッチなソース エクスペリエンスの構築に不可欠な構造化データが含まれています。

Google Maps グラウンディングされた結果の groundingMetadata オブジェクトには、次の情報が含まれます。

  • groundingChunks: maps ソース(uri、placeId、title)を含むオブジェクトの配列。
  • groundingSupports: モデルのレスポンス text を groundingChunks のソースに接続するチャンクの配列。各チャンクは、テキスト segment(startIndex と endIndex で定義)を 1 つ以上の groundingChunkIndices にリンクします。このフィールドは、インラインのソースリンクを作成する際に役立ちます。このページの後半で、サービス使用量の要件を満たす方法について説明します。

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]
          }
        ]
      }
    }
  ]
}

サービスの使用要件

このセクションでは、選択した Gemini API プロバイダ(Gemini Developer API または Agent Platform Gemini API (formerly Vertex AI))の 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 Maps ファビコン。
  • ソース URL(og:image)の写真。

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 が含まれる場合があります。次のレスポンス データをキャッシュに保存してエクスポートできます。

  • placeId

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

禁止されている行為と地域

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

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

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

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

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

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

料金とレート制限

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

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