This sample uses the Agent Development Kit (ADK) to create a simple fun facts generator which communicates using A2A.
- Python 3.10 or higher
- Access to an LLM and API Key
-
Navigate to the samples directory:
cd samples/python/agents/adk_facts -
Install Requirements
pip install -r requirements.txt
-
Create a
.envfile with your Gemini API Key:echo "GOOGLE_API_KEY=your_api_key_here" > .env
-
Run the A2A agent:
uvicorn agent:a2a_app --host localhost --port 8001
-
Run the ADK Web Server
# In a separate terminal, run the adk web server adk web samples/python/agents/
In the Web UI, select the adk_facts agent.
gcloud run deploy sample-a2a-agent \
--port=8080 \
--source=. \
--allow-unauthenticated \
--region="us-central1" \
--project=$GOOGLE_CLOUD_PROJECT \
--set-env-vars=GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=us-central1,GOOGLE_GENAI_USE_VERTEXAI=true