Python 88.3%
TypeScript 7.6%
Shell 4.1%
1#!/usr/bin/env python32"""Grounding with Google Maps (`tools: [{"googleMaps": {}}]` + `toolConfig.retrievalConfig.latLng`).3STATUS: LIVE_VERIFIED 2026-09-18 (gemini-3.5-flash-lite, tmp-live/gemini-tools/e_google_maps.json): HTTP 200,4groundingMetadata = {webSearchQueries, groundingChunks[{maps:{uri,title,text,placeId}}], groundingSupports}. With5googleMaps.enableWidget=true (e2_google_maps_widget.json) no googleMapsWidgetContextToken was returned on this model.6Run: .venv/bin/python examples/gemini/tools/google-maps/maps_grounding.py7"""8import json, sys9from pathlib import Path10sys.path.insert(0, str(Path(__file__).resolve().parents[4]))11from scripts.live import gemini_request12MODEL = "gemini-3.5-flash-lite"13st, r, _ = gemini_request("POST", f"/v1beta/models/{MODEL}:generateContent",14 {"contents": [{"parts": [{"text": "Name one cafe near me. 5 words."}]}], "tools": [{"googleMaps": {}}],15 "toolConfig": {"retrievalConfig": {"latLng": {"latitude": 43.6532, "longitude": -79.3832}}},16 "generationConfig": {"maxOutputTokens": 48}}, note="maps_grounding.py")17cand = r["candidates"][0]18gm = cand.get("groundingMetadata", {})19print("HTTP", st, "text:", "".join(p.get("text", "") for p in cand["content"]["parts"]))20print("groundingMetadata keys:", sorted(gm.keys()))21for c in gm.get("groundingChunks", [])[:3]:22 m = c.get("maps", {})23 print(" maps chunk:", m.get("title"), "| placeId", m.get("placeId"), "|", m.get("uri", "")[:50])24