|
9 | 9 |
|
10 | 10 | Welcome to the **Google Maps Agentic UI Toolkit Samples**! 🎉 |
11 | 11 |
|
12 | | -This repository (`a2ui-samples`) contains the reference demonstration for the Google Maps Agentic UI Toolkit. It provides a fully working, interactive sample application implementing the Agent-to-User Interface (A2UI) standard, allowing AI agents to present rich, dynamic map interfaces directly in your web browser. |
| 12 | +This repository (`a2ui-samples`) contains reference samples for the Google Maps Agentic UI Toolkit. It provides a fully working, interactive sample application implementing the Agent-to-User Interface (A2UI) standard, allowing AI agents to present rich, dynamic map interfaces directly in your web browser. |
13 | 13 |
|
14 | 14 | This project is intended for demonstration purposes to help you get up and running quickly! |
15 | 15 |
|
@@ -174,6 +174,85 @@ To create a new Google Cloud API Key, follow the instructions here in the [Googl |
174 | 174 |
|
175 | 175 | This key must be exported or contained within a `.env` file as `GEMINI_API_KEY` |
176 | 176 |
|
| 177 | +## Google API Keys |
| 178 | + |
| 179 | +### Google Maps API Key |
| 180 | + |
| 181 | +Agentic UI Toolkit requires an API Key to use Google Maps Platform products. To create a Google Maps API Key, follow the instructions in the [Google Maps Platform documentation](https://developers.google.com/maps/documentation/javascript/get-api-key). |
| 182 | + |
| 183 | +Your API Key must have the following APIs enabled in the [Google Cloud Console](https://console.cloud.google.com/apis/credentials): |
| 184 | + |
| 185 | +* Geocoding API |
| 186 | +* Maps JavaScript API |
| 187 | +* Places UI Kit |
| 188 | +* Routes API |
| 189 | + |
| 190 | +To use Grounding Lite MCP, you must also enable: |
| 191 | + |
| 192 | +* Maps Grounding Lite API |
| 193 | + |
| 194 | +To support the use of Grounding Lite within the Python ADK backend, this API Key must be exported or contained within a `.env` file as `GOOGLE_MAPS_API_KEY`. |
| 195 | + |
| 196 | +**Loading the Google Maps JavaScript API** |
| 197 | + |
| 198 | +Your API Key must also be included when loading the Google Maps JavaScript API code. See the [Google Maps Platform Documentation](https://developers.google.com/maps/documentation/javascript/load-maps-js-api) for instructions on how to load the API, including configuring the API Key. |
| 199 | + |
| 200 | +Agentic UI Toolkit requires features available in the Alpha channel. You must use `v=alpha` when loading the Maps JavaScript API. Learn more about versions in the [Google Maps Platform Documentation](https://developers.google.com/maps/documentation/javascript/versions). |
| 201 | + |
| 202 | +Use of Agentic UI Toolkit requires several [Maps JavaScript API libraries](https://developers.google.com/maps/documentation/javascript/libraries). When loading the Google Maps JavaScript API, you must include the following libraries: |
| 203 | + |
| 204 | +* maps |
| 205 | +* maps3d |
| 206 | +* marker |
| 207 | +* places |
| 208 | +* routes |
| 209 | + |
| 210 | +### Gemini API Key |
| 211 | + |
| 212 | +*Note: This API is variously referred to in Google Cloud as the* Gemini API *and the* Generative Language API. |
| 213 | + |
| 214 | +If you are using Gemini as your LLM, you will also need a Google Cloud API Key with the *Generative Language API* enabled. In order to enable this API for your API Key, the *Gemini API* must be enabled for your Google Cloud project. You can enable this API in the [API Library](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com). |
| 215 | + |
| 216 | +To create a new Google Cloud API Key, follow the instructions here in the [Google Cloud docs](https://docs.cloud.google.com/docs/authentication/api-keys#create). |
| 217 | + |
| 218 | +This key must be exported or contained within a `.env` file as `GEMINI_API_KEY` |
| 219 | + |
| 220 | +## Accessing Google Maps grounding data |
| 221 | + |
| 222 | +Your agent can access Google Maps grounding data in two ways, depending on your project setup and needs: |
| 223 | + |
| 224 | +1. [Grounding Lite MCP](https://developers.google.com/maps/ai/grounding-lite) |
| 225 | +2. [Grounding with Google Maps](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps) |
| 226 | + |
| 227 | +### Grounding Lite MCP |
| 228 | + |
| 229 | +To use Grounding Lite MCP, you must first enable the Maps Grounding Lite API and create or update an API Key to support the required APIs following the [documentation](https://developers.google.com/maps/ai/grounding-lite#configure_llms_to_use_the_mcp_server). |
| 230 | + |
| 231 | +### Grounding with Google Maps |
| 232 | + |
| 233 | +To use Grounding with Google Maps, there are additional steps you must take to configure your environment: |
| 234 | + |
| 235 | +1. Ensure you have the latest version of the genai python package. |
| 236 | +```bash |
| 237 | +pip install --upgrade google-genai |
| 238 | +``` |
| 239 | + |
| 240 | +2. Configure additional environment variables to connect to your project. |
| 241 | +```bash |
| 242 | +## Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values |
| 243 | +## with appropriate values for your project. |
| 244 | +export GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT |
| 245 | +export GOOGLE_CLOUD_LOCATION=global |
| 246 | +export GOOGLE_GENAI_USE_VERTEXAI=True |
| 247 | +``` |
| 248 | + |
| 249 | +3. Ensure you are authenticated to Google Cloud. |
| 250 | +```bash |
| 251 | +gcloud auth application-default login |
| 252 | +``` |
| 253 | + |
| 254 | +See the [documentation](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps#googlegenaisdk_tools_google_maps_with_txt-python_genai_sdk) for more information. |
| 255 | + |
177 | 256 | ## Contributing |
178 | 257 |
|
179 | 258 | External contributions are not accepted for this repository. See [contributing guide] for more info. |
|
0 commit comments