python -m google.adk.server.app_server 8080This is the correct way and will:
- Initialize the agent
- Set up the runner
- Register routes
- Start the server
python src/google/adk/server/app_server.py 8080Or from the project root:
cd /Users/arun.parmar/go/src/adk-python
PYTHONPATH=src python -m google.adk.server.app_server 8080Cause: You're trying to run:
uvicorn main:app # ❌ Wrong - "main" module doesn't existSolution: Use the Python module method instead:
python -m google.adk.server.app_server 8080 # ✅ CorrectThe routes are registered inside the main() function, which means:
- The
appvariable exists at module level - But routes are only added when
main()is called - Running
uvicorndirectly skips the initialization
- Press
F5 - Select "Python: App Server"
- Server will start in debug mode
Make sure these are set (if not using config.ini):
export DATABASE_URL="postgresql://user:pass@host:5432/db"
export ADURL="..."
export ADU="..."
export ADP="..."
export REDBUS_ADG_MODEL="40"Once running, test with:
# Health check
curl http://localhost:8080/health
# Chat endpoint
curl --location 'http://localhost:8080/chat' \
--header 'BUSINESS_UNIT: BUS' \
--header 'COUNTRY: IND' \
--header 'Content-Type: application/json' \
--header 'X-CLIENT: SELF_HELP' \
--data '{"message": "Hi", "orderItemUUID": "8dc29a95411be00600ec264701020100"}'-
Port already in use: Change port or kill existing process
lsof -ti:8080 | xargs kill -9
-
Database connection error: Check
config.inior environment variables -
Module not found: Make sure you're in the project root and PYTHONPATH is set
export PYTHONPATH="${PYTHONPATH}:$(pwd)/src"