Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Agentic UI Toolkit - Python Agent

This is a sample Python agent that consumes the MAUI packages and provides a backend for the A2UI chat interface.

Prerequisites

Source code:

  • Download/clone the Agentic UI Toolkit source code from GitHub

Environment variables: This example requires the following environment variables to be set:

  • GEMINI_API_KEY: Your Gemini API key.
  • GOOGLE_MAPS_API_KEY: Your Google Maps API key (used by the agent for location-based queries).

Tools:

To run this sample project

  1. Open this directory in a terminal.

  2. Set the path to the MAUI package in pyproject.toml.

    You can either do this manually by replacing the $MAUI_PATH placeholder in pyproject.toml with the path to the MAUI package, or by running the setup.sh script:

    chmod +x setup.sh
    ./setup.sh <path_to_maui_package>
  3. Run the following command to start the server:

    uv run .

    This will automatically resolve dependencies, install them in a local virtual environment, and start the A2A server on port 10002.

To run the frontend, follow the instructions in ../../client/web/react/README.md

Google API Keys

Google Maps API Key

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.

Your API Key must have the following APIs enabled in the Google Cloud Console:

  • Geocoding API
  • Maps JavaScript API
  • Places UI Kit
  • Routes API

To use Grounding Lite MCP, you must also enable:

  • Maps Grounding Lite API

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.

Loading the Google Maps JavaScript API

Your API Key must also be included when loading the Google Maps JavaScript API code. See the Google Maps Platform Documentation for instructions on how to load the API, including configuring the API Key.

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.

Use of Agentic UI Toolkit requires several Maps JavaScript API libraries. When loading the Google Maps JavaScript API, you must include the following libraries:

  • maps
  • maps3d
  • marker
  • places
  • routes

Gemini API Key

Note: This API is variously referred to in Google Cloud as the Gemini API and the Generative Language API.

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.

To create a new Google Cloud API Key, follow the instructions here in the Google Cloud docs.

This key must be exported or contained within a .env file as GEMINI_API_KEY

Accessing Google Maps grounding data

Your agent can access Google Maps grounding data in two ways, depending on your project setup and needs:

  1. Grounding Lite MCP
  2. Grounding with Google Maps

Grounding Lite MCP

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.

Grounding with Google Maps

To use Grounding with Google Maps, there are additional steps you must take to configure your environment:

  1. Ensure you have the latest version of the genai python package.
pip install --upgrade google-genai
  1. Configure additional environment variables to connect to your project.
## Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values
## with appropriate values for your project.
export GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT
export GOOGLE_CLOUD_LOCATION=global
export GOOGLE_GENAI_USE_VERTEXAI=True
  1. Ensure you are authenticated to Google Cloud.
gcloud auth application-default login

See the documentation for more information.