A quick playground for AI agents development.
This project is currently a minimal Google ADK-based "weather agent" example.
agent_playground/— package code (agent factory, tools, runtime, conversation loop)agent_playground/guardrails/— model/tool guardrails (callbacks for validation)agent_playground/warnings_suppression.py— optional suppression of noisy Pydantic serializer warnings__main__.py— root shim entrypoint (kept for convenience)tools.py— compatibility shim (re-exportsagent_playground.tools)
- Python 3.11+
- A configured environment with Google ADK + dependencies installed
Pick one of the following:
conda env create -f environment.yml
conda activate agent-playground
python -m agent_playgroundpython -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python -m agent_playgroundOPENAI_MODEL(required): model name used byLiteLlm(example:gpt-4o-mini)OPENAI_API_KEY(may be required depending on your LiteLLM/provider setup)AGENT_PLAYGROUND_SUPPRESS_PYDANTIC_SERIALIZER_WARNINGS(default:true): suppresses noisy Pydantic serializer warnings
Tip: you can set these in PowerShell for the current session:
$env:OPENAI_MODEL = "gpt-4o-mini"
$env:OPENAI_API_KEY = "..."Alternatively, copy .env.example to .env and fill in your values.
This repo includes simple guardrails implemented using ADK callbacks:
agent_playground/guardrails/model_callback.py:before_model_callbackvalidationsagent_playground/guardrails/tool_callback.py:before_tool_callbackvalidations
The weather_agent has these guardrails enabled (see before_model_callback and before_tool_callback in the agent factory).
agent_playground/warnings_suppression.py implements check_pydantic_warnings_suppression(), which reads
AGENT_PLAYGROUND_SUPPRESS_PYDANTIC_SERIALIZER_WARNINGS from .env/environment and suppresses only the noisy
Pydantic serializer warnings.
This suppression is called during startup in agent_playground/__main__.py.
Why it exists: in some runs we observed the warning spam could make agent execution appear “stuck” (logs flood / noisy stdout), even though it’s not a fatal error.
Recommended:
python -m agent_playgroundAlternative (kept for backwards compatibility):
python __main__.pyOnce running, type messages into the terminal. Use exit or quit to stop.
The ADK CLI discovers agents by scanning subfolders for an agent.py that exports a top-level root_agent.
This repo provides that entrypoint at agent_playground/agent.py.
From the repo root (the parent folder that contains agent_playground/), run:
adk web --port 8000Then open http://localhost:8000 and select agent_playground.
This project was created using these tutorials as references: