Production-ready text summarization agent built with Google ADK and Gemini, exposed through FastAPI, containerized with Docker, stored in Artifact Registry, and deployed on Cloud Run.
This project implements a single AI agent named adk-agent that:
- uses Google ADK for agent orchestration
- uses Gemini for summarization
- accepts JSON input over HTTP
- returns structured JSON output
- is designed for Cloud Shell, Docker, Artifact Registry, and Cloud Run
POST /summarize
{
"text": "Cloud Run is a serverless platform for running containerized applications. It automatically scales and integrates with Google Cloud services."
}{
"original_text": "Cloud Run is a serverless platform for running containerized applications. It automatically scales and integrates with Google Cloud services.",
"summary": "Cloud Run is a serverless platform for containerized applications that automatically scales and integrates with Google Cloud services.",
"status": "success"
}.
|-- adk_agent/
| |-- __init__.py
| `-- agent.py
|-- docs/
| |-- PROJECT_GUIDE.txt
| `-- service_sab.txt
|-- main.py
|-- requirements.txt
|-- Dockerfile
|-- .dockerignore
|-- .gitignore
`-- README.md
- [adk_agent/agent.py](C:\Users\saias\OneDrive\Pictures\Documents\New project\adk-agent-project\adk_agent\agent.py)
- [main.py](C:\Users\saias\OneDrive\Pictures\Documents\New project\adk-agent-project\main.py)
- [requirements.txt](C:\Users\saias\OneDrive\Pictures\Documents\New project\adk-agent-project\requirements.txt)
- [Dockerfile](C:\Users\saias\OneDrive\Pictures\Documents\New project\adk-agent-project\Dockerfile)
- [PROJECT_GUIDE.txt](C:\Users\saias\OneDrive\Pictures\Documents\New project\adk-agent-project\docs\PROJECT_GUIDE.txt)
python3 -m venv .venv
source .venv/bin/activate
pip install --no-cache-dir -r requirements.txt
export GOOGLE_API_KEY="YOUR_REAL_GEMINI_API_KEY"
uvicorn main:app --host 0.0.0.0 --port 8080 --log-level debugcurl -X POST http://127.0.0.1:8080/summarize \
-H "Content-Type: application/json" \
-d '{
"text": "Cloud Run is a serverless platform for running containerized applications. It automatically scales and integrates with Google Cloud services."
}'- Enable required APIs.
- Build the image with Cloud Build.
- Push to Artifact Registry.
- Store
GOOGLE_API_KEYin Secret Manager. - Deploy the container to Cloud Run.
Detailed instructions are in [PROJECT_GUIDE.txt](C:\Users\saias\OneDrive\Pictures\Documents\New project\adk-agent-project\docs\PROJECT_GUIDE.txt).
Cloud Run service URL:
EX-https://adk-agent-197228016542.us-central1.run.app
Working endpoint:
EX-https://adk-agent-197228016542.us-central1.run.app/summarize
- Internal ADK agent name must be
adk_agent. - Final working Gemini model is
gemini-2.5-flash. - If deployment looks stale, use a fresh timestamped image tag instead of reusing
latest.