Merge https://github.com/google/adk-python/pull/6107
## Summary
- Fix README claiming Python 3.11+ while the package requires `>=3.10`; sync all docs (README, AGENTS.md, adk-setup skill, two sample READMEs) to 3.10+
- Swap the rate-limited shields.io PyPI downloads badge for a pepy.tech one (the old badge rendered "rate limited by upstream service")
- Add a Python Unit Tests CI status badge
## Test plan
- [ ] Confirm README badges render correctly on GitHub (downloads + unit test status)
- [ ] Verify Python version wording matches `requires-python = ">=3.10"` in pyproject.toml
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6107 from google:docs/readme-badges-python-310 bdfa1c125375abe94c343389702994cbc8857e7d
PiperOrigin-RevId: 931539712
Fixes minor indentation and bullet formatting issues in the multi-agent samples README files.
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
PiperOrigin-RevId: 931446655
Use Google's official async client to support mTLS for GCP API calls. This resolves the issue where we were failing mTLS policy due to unbound tokens.
Note: This CL also removes the legacy bound-token patch from mcp_tool.py and mcp_toolset.py, which constitutes a behavior change beyond the mTLS feature.
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 931326860
Enhance the `client/` directory within the `gcp_auth` sample to support interaction with remote agents. The client can now discover and communicate with agents hosted on remote endpoints.
Key updates:
- Implemented functionality to list and select remote agents, replacing local filesystem scanning.
- Added client-side logic to communicate with remote agents.
- The Material 3-based "Agent Playground" interface is adapted for remote agent selection and interaction.
- Updated `README.md` with new setup instructions.
- Revised `requirements.txt` to include new dependencies required for remote agent communication.
PiperOrigin-RevId: 930965837
Merge https://github.com/google/adk-python/pull/5785
## Summary
- fix a misspelled word in the ADK team triaging-agent sample instructions
- keep the change limited to sample prompt prose
## Validation
- Confirmed no open upstream PR already targets this exact typo context:
- -> []
- -> []
- -> []
- 192: issues will be separated in two categories: issues with type "Bug" and issues
-
-
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 930813570
Merge https://github.com/google/adk-python/pull/6040
## Summary
Introduces `google.adk.labs.antigravity` with `AntigravityAgent`, a `BaseAgent` that runs a Google Antigravity SDK agent (described by an `AgentConfig`) as a native ADK root agent. Lives under `labs/` as an experimental feature.
- Delegates each turn to a fresh SDK `Agent` and maps trajectory steps to ADK events: model text, function calls/responses, and SSE-gated partial thinking/text deltas.
- Folder-based session resumption via `config.save_dir`: renames the harness trajectory to a deterministic per-session name and skips replayed steps using a persisted resume step index.
- Restricted to standalone root use (local mode only) with construction-time guards (cannot be a sub-agent or have sub-agents).
- `serialize_agent` now honors `Field(exclude=True)` so the non-serializable `config` does not break the `build_graph` endpoint.
- Adds the `[antigravity]` optional extra (in both the extra and `test` groups, with `uv.lock` updated), a game-developer sample, package README, and unit tests.
## Test plan
- [ ] `pytest tests/unittests/labs/antigravity/` (22 unit tests pass)
- [ ] `pytest tests/unittests/cli/utils/test_graph_serialization.py`
- [ ] Manual: run the sample via `adk web` with `GEMINI_API_KEY` and a `[antigravity]` install, confirm multi-turn resumption and no duplicate events.
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6040 from google:feat/antigravity-agent 304f6ad4d1e9edc414a28aa01eb77028519de11a
PiperOrigin-RevId: 930712984
Set role='model' in the Content object generated by create_request_input_event()
to ensure proper role attribution when returning function call events to the client.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 929538818
Merge https://github.com/google/adk-python/pull/6031
> **Stacked on #6030** (`fix/experimental-typing`). This PR targets that branch; please review/merge #6030 first, after which this will be retargeted to `main`.
## Summary
Adds `E2BEnvironment`, a `BaseEnvironment` backed by an [E2B](https://e2b.dev) sandbox. It gives agents a persistent remote workspace for shell execution, file CRUD, and on-demand installs (`pip`/`apt`) without touching the host machine.
- The sandbox TTL is bounded to cap credit usage and is extended on each operation; an expired idle sandbox is transparently recreated.
- Lazy-imports the SDK behind a new `e2b` extra, so the base package stays lean.
- Includes a data-analysis sample that downloads a public (GCS-hosted) dataset and analyzes it inside the sandbox.
## Usage
```python
from google.adk.integrations.e2b import E2BEnvironment
from google.adk.tools.environment import EnvironmentToolset
toolset = EnvironmentToolset(environment=E2BEnvironment())
```
## Test plan
- [x] `pytest tests/unittests/integrations/e2b/` (14 passed)
- [x] `pyright src/google/adk/integrations/e2b/_e2b_environment.py` — 0 errors
- [x] Sample agent loads (`contributing/samples/environment_and_skills/e2b_environment`)
- [ ] Manual run against a live E2B sandbox (requires `E2B_API_KEY`)
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6031 from google:feat/e2b f2b5584e28c71e7110e9d98e1d0839f575183368
PiperOrigin-RevId: 929443164
Standard REST, SSE, and WebSocket endpoints now actively monitor client disconnections. When a connection drop is intercepted, the executing worker task tree is aborted mid-run to prevent background task leaks, API token burn, and resource wastage.
Includes:
1. REST `/run` connection drop monitor blocking on raw ASGI receive events with 0% CPU consumption.
2. Graceful `499 Client Closed Request` status response on REST disconnections to suppress server-side exceptions.
3. Unit and integration tests validating REST task cancellations and generator finalizations.
4. Comprehensive architectural design documents and user guide under `/docs`.
5. An invocation-focused cooperative counting agent sandbox under `/contributing/samples/core/abort`.
Change-Id: I50fcba7a8bb56cf28b0a3bb8fa66b85732062a67
Update ADK to support the new Interactions API. See: https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026
Key changes include:
* Updated `interactions_utils.py` to parse new v2 interaction events such as
`InteractionCreatedEvent`, `InteractionCompletedEvent`, and explicit step
types (`ModelOutputStep`, `FunctionCallStep`, etc.).
* Transitioned from "turns" to "steps" terminology, including renaming
`convert_contents_to_turns` to `convert_contents_to_steps`.
* Updated `contributing/samples/interactions_api`
Breaking Changes in interactions_utils.py:
- Renamed "turn" functions to "step" equivalents:
- `convert_content_to_turn` -> `_convert_content_to_step`
- `convert_contents_to_turns` -> `_convert_contents_to_steps`
- `convert_interaction_output_to_part` -> `_convert_interaction_step_to_parts`
- Updated `build_interactions_request_log` to use required `input_steps` instead of `input_turns`.
- Deprecated `convert_part_to_interaction_content`
Change-Id: I962724321342ba0192251896ce51832b214d60d9
Add RequestInputTool to allow single LLM agents to pause, request user input, and resume seamlessly mid-loop without workflow graphs.
Also add comprehensive unit tests, integration tests, and a new official sample with automated session replay tests.
Change-Id: Ifb50cc2e644aeb5ffb2be797255608d0d5a37234
FunctionTool._preprocess_args only converted dict args to a Pydantic
model for single-model and Optional[Model] annotations. A
Union[ModelA, ModelB] parameter was left as a raw dict, so
isinstance checks inside the tool failed with "Unexpected entity
type: <class 'dict'>"
Use pydantic.TypeAdapter to validate against the full Union so
pydantic picks the matching member. None and instances of any
declared union member pass through unchanged; instances of
unrelated BaseModels fall back to the existing graceful-failure
warning path.
Close#5799
Change-Id: Ie69f8efc8395162eac375a0eaad0c77ed2097cec
This change allows AgentEngineSandboxComputer to create new sandboxes
using either a specified sandbox template or a sandbox snapshot. The
environment variables VMAAS_SANDBOX_TEMPLATE_NAME and
VMAAS_SANDBOX_SNAPSHOT_NAME are introduced to configure this behavior.
Co-authored-by: Emily Feng <emilyfeng@google.com>
Change-Id: Iebdd980a16966ba765cacbce6d63d0d5b691650a
Introduces a generate_chart tool to the Data Agent sample, leveraging
Altair and vl-convert to render Vega-Lite specifications into charts.
Co-authored-by: Han Cao <huanc@google.com>
Change-Id: I5765487406d511e650091f5dc884102c43568fd4
Workflows failed because the gemini-2.5-pro model is not available for our projects and the CONTRIBUTING.md relative path resolved incorrectly after relocation. Updated the model to gemini-3.5-flash and adjusted the path resolver depth.
Change-Id: Iffc8a2b0044f3d73b0cb0b364db220d2bd055683
JSON test files generated by the agent test runner were missing trailing newlines, causing the pre-commit end-of-file-fixer hook to fail. Added an explicit newline write on serialization.
Change-Id: Idaffc4f2c23fa213f595ddef2188b0050aeb431d
Generated test JSON files for parallel_functions and pydantic_argument samples to verify their behavior.
Also fixed a test replay issue by ignoring timestamps in state (in agent_test_runner.py) to prevent false failures due to dynamic data.
Note: Some sample agents could not have tests generated successfully due to:
1. agent_tool_with_grounding_metadata: Fails on replay because AgentTool hides sub-agent events, causing mock LLM to get out of sync.
2. hello_world_stream_fc_args: Fails on rebuild because streaming function calls are not supported in the Unary API used by the test recorder.
3. output_schema_with_tools: Has external dependencies (Wikipedia/Google Search), making it unsuitable for automated regression tests without proper mocking.
Change-Id: I69df7daf49d175905dcbd85cf70914e460717915
This CL implements the class in the integrations folder, used specifically for the Skill Registry API.
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 915627057
`gemini-1.*` and `gemini-2.0*` models are respectively deprecated and scheduled for shutdown on June 1, 2026. `gemini-2.5*` models are their successors.
No regressions in unit tests:
```
========================================================================================== 5583 passed, 2237 warnings in 84.91s (0:01:24) ===========================================================================================
```
PiperOrigin-RevId: 907663315
## Overview
This PR updates internal tutorials and demonstration guidance following the renaming of the database connectivity tools (`genai-toolbox` -> `mcp-toolbox`) and aligns resource downloads with the newly scoped artifact destinations.
## Changes
* Removed references to legacy `googleapis.github.io/genai-toolbox` pages.
* Updated download commands to pull binaries directly from the rebranded bucket.
* Bumped the embedded curl instruction default payload target to the newly stable `v1.1.0` release tier.
PiperOrigin-RevId: 900207615
Merge https://github.com/google/adk-python/pull/5218
### Link to Issue or Description of Change
**1. Link to an existing issue (if applicable):**
(None, this is a new sample)
**2. Or, if no issue exists, describe the change:**
**Problem:**
There was no sample demonstrating how to use `LocalEnvironment` with `EnvironmentToolset` for manual skill activation (discovering and loading skills by reading files) instead of using the pre-configured `SkillToolset`.
**Solution:**
Created a new sample `local_environment_skill` that demonstrates this pattern:
- Agent is instructed to find skills in `skills/` folder using the `find` command.
- Agent loads skills by reading `SKILL.md` using the `ReadFile` tool.
- Added a weather skill sample and reference data to demonstrate usage.
### Testing Plan
**Unit Tests:**
*(This is a sample/demonstration, so no new unit tests were added for the framework itself.)*
**Manual End-to-End (E2E) Tests:**
1. Ran `adk web contributing/samples`.
2. Interacted with the agent in the Web UI.
3. Prompt: "Can you check the weather in Sunnyvale?"
4. Verified that the agent successfully used `find` to locate the skill, read `SKILL.md`, read `weather_info.md`, and answered correctly.
### Checklist
- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have manually tested my changes end-to-end.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5218 from google:samples/local_env_skill 39404309e8b9237a279ecd6ed14bb87eb84098f0
PiperOrigin-RevId: 897229752
We recently overhauled our MCP Toolbox documentation and moved it to a new domain. This PR propagates that URL change here.
PiperOrigin-RevId: 896118946