458 Commits

Author SHA1 Message Date
Wei Sun (Jack) 22adbe12d6 ci(kokoro): install addlicense tool on pre-commit presubmits
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
PiperOrigin-RevId: 932061051
2026-06-14 11:44:13 -07:00
Wei (Jack) Sun d3c21d716e docs: Align Python version to 3.10+ and update README badges
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
2026-06-13 00:26:26 -07:00
Wei Sun (Jack) fa829296c0 docs: fix formatting in multi-agent sample READMEs
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
2026-06-12 19:11:07 -07:00
Bo Yang f84a5b5e20 docs: add unit guides for task mode
Added task mode doc, README and cross-linking samples.

Co-authored-by: Bo Yang <ybo@google.com>
PiperOrigin-RevId: 931386773
2026-06-12 16:19:07 -07:00
Kathy Wu fe497a4f5d feat: Migrate McpToolset to AsyncAuthorizedSession for mTLS support
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
2026-06-12 14:14:22 -07:00
Wei Sun (Jack) 0aca7bf65e fix: update model to gemini-3.5-flash in session_state_agent sample
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
PiperOrigin-RevId: 931241548
2026-06-12 11:16:49 -07:00
Google Team Member 57bdecfcb1 feat: Update gcp_auth client UI to support Remote Agents
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
2026-06-11 23:49:54 -07:00
Google Team Member fb19e1a155 feat: add GCS first party toolset to ADK integrations
GCS toolset supports basic operations to interact with GCS buckets and objects.

PiperOrigin-RevId: 930830041
2026-06-11 17:41:06 -07:00
George Weale ef395c7050 docs: fix triaging agent sample typo
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
2026-06-11 16:59:01 -07:00
Wei (Jack) Sun 4cb27fd42e feat(labs): add experimental Antigravity SDK agent wrapper
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
2026-06-11 13:42:11 -07:00
llalitkumarrr 3e9f3daec0 chore: Updating triaging bot
Merge https://github.com/google/adk-python/pull/6049

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6049 from llalitkumarrr:main 81421c661648f939e352d8e35e46d8b3aa957360
PiperOrigin-RevId: 930327899
2026-06-11 00:04:22 -07:00
Haran Rajkumar 4100a24021 chore: replace vertexai with enterprise in samples and docs
Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 930146494
2026-06-10 16:34:15 -07:00
Shangjie Chen 0c6974cbc4 fix: Set role='model' for request_input event Content
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
2026-06-09 19:19:51 -07:00
Wei (Jack) Sun 92d608f83e feat(integrations): Add E2BEnvironment for remote sandbox workspaces
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
2026-06-09 15:40:45 -07:00
Xuan Yang d72bb7d90d docs: Upgrade ADK release analyzer agent to use gemini-3.1-pro-preview model
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 929314765
2026-06-09 11:39:46 -07:00
Shangjie Chen 0337d19c47 chore: sync Google internal changes to GitHub (#6022) 2026-06-08 15:11:24 -07:00
George Weale aa51512587 chore: apply pre-commit formatting
Change-Id: Iec95a44368502706d814380881c8d10c4a7e8cd4
2026-05-28 16:05:50 -07:00
Bo Yang 6a533573db feat(api_server): Abort runs on client drops to avoid leaks
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
2026-05-28 14:11:39 -07:00
haranrk da1d8f1552 feat(interactions): update ADK to support Google GenAI SDK v2.0.0
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
2026-05-27 16:30:02 -07:00
Shangjie Chen afb0a64f96 feat(tools): Standardize request_input tool for proactive LLM clarification
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
2026-05-27 13:07:54 -07:00
Xuan Yang af8bfe08ac fix: Format the files to fix pre-commit failures
Change-Id: Ie86c42e4fa3f0c2acd1d73d399fbe6f4e0c54f02
2026-05-27 11:22:36 -07:00
George Weale 104edc8317 fix: convert Union[Pydantic, Pydantic] tool args at runtime
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
2026-05-22 16:21:58 -07:00
Emily Feng cbd14ebf99 feat: Add support for creating sandboxes from templates and snapshots
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
2026-05-22 15:47:41 -07:00
Han Cao db064160bf feat: Add chart generation and artifact loading to data agent
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
2026-05-22 15:38:02 -07:00
George Weale a4f394e139 chore: edit files
Change-Id: I4e3e3e9f1846520f3fda86cc83453b30bdd336ef
2026-05-22 10:47:37 -07:00
Xuan Yang 55cbc8c9e8 fix(ci): Prevent workflow failures in relocated adk_team samples
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
2026-05-20 14:37:22 -07:00
Shangjie Chen 3329ced0b9 fix(tests): Append trailing newline to JSON test outputs
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
2026-05-19 16:27:47 -07:00
Xuan Yang 7fc5b0efc4 test(samples): Verify behavior of parallel functions and Pydantic arguments with new tests
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
2026-05-19 13:36:37 +00:00
Sasha Sobran 162279358c chore: switch main to v2.0.0 GA (transition to v2)
Co-authored-by: Bo Yang <ybo@google.com>
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
Co-authored-by: George Weale <gweale@google.com>
Co-authored-by: Swapnil Agarwal <swapnilag@google.com>
Co-authored-by: Xuan Yang <xygoogle@google.com>
Co-authored-by: Shangjie Chen <deanchen@google.com>
Co-authored-by: Yifan Wang <wanyif@google.com>
Co-authored-by: Kathy Wu <wukathy@google.com>
2026-05-19 02:01:33 +00:00
Kathy Wu 88ebd426be feat: Implement GCPSkillRegistry in ADK
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
2026-05-14 14:47:42 -07:00
Xuan Yang 6d89d2194a fix: Update model to gemini-3-flash-preview in hello word agent sample
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 913891628
2026-05-11 14:47:54 -07:00
Xuan Yang 2d423e8355 fix: Update model to gemini-3-flash-preview in session state agent sample
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 913789974
2026-05-11 11:13:02 -07:00
Xuan Yang 192f19d824 fix: Update model name in hello_world agent
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 912743254
2026-05-08 16:11:29 -07:00
Kathy Wu 88421f80a0 fix: Filter out video events with inline data from being stored in session
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 912249311
2026-05-07 18:00:59 -07:00
Wei Sun (Jack) 3117e09136 chore: further fix header-check via 2025 --> 2026
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
PiperOrigin-RevId: 911737937
2026-05-06 22:16:55 -07:00
Google Team Member ed8b31ce5f chore: migrate from gemini-1.* and gemini-2.0* to gemini-2.5-*
`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
2026-04-29 10:34:22 -07:00
Shangjie Chen 599079b5a6 chore: Rename utils.py to gepa_utils.py to ensure consistent first-party module detection for sample scripts across different CI environments
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 905278958
2026-04-24 16:43:19 -07:00
Shangjie Chen 533776e005 chore: Switch to pre-commit and cleanup redundant tools
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 905187116
2026-04-24 13:13:42 -07:00
Shangjie Chen 9a0d2f70ba fix: Fix malformated skill.md
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 905152209
2026-04-24 12:00:28 -07:00
Sasha Sobran b848390904 fix(samples): Upgrade google-adk to 1.28.1 to fix vulnerability
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 905101547
2026-04-24 10:24:06 -07:00
Google Team Member 909a8c2ad4 feat: Add sample agent demonstrating 2LO, 3LO, and API Key auth via GcpAuthProvider
PiperOrigin-RevId: 904823303
2026-04-23 23:14:54 -07:00
Shangjie Chen c6d02c8198 chore: Format contributing folder using pre-commit
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 904672556
2026-04-23 15:44:03 -07:00
Kacper Jawoszek 2784217edc chore: Update telemetry owner
Co-authored-by: Kacper Jawoszek <jawoszek@google.com>
PiperOrigin-RevId: 901179890
2026-04-17 02:41:40 -07:00
Liang Wu 1af1b4aa26 chore: Remove adk_additional_tools and GetTimezone tool
These are not used in the example

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 900902777
2026-04-16 14:10:26 -07:00
Xiang (Sean) Zhou 5c6f6fe7b6 chore: Add sandbox computer use sample agent
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 900322196
2026-04-15 13:38:03 -07:00
Google Team Member 47fa7b743c docs: update MCP Toolbox branding, binary version, and asset references
## 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
2026-04-15 09:34:06 -07:00
Liang Wu d337ddfc3e chore: Update Live sample agents' models
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 899943556
2026-04-14 22:24:19 -07:00
Wei (Jack) Sun 2cbb523069 feat(samples): add sample for skill activation via environment tools
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
2026-04-09 11:58:35 -07:00
Google Team Member a60baca3dd docs: Update the MCP Toolbox docsite with the new URL
We recently overhauled our MCP Toolbox documentation and moved it to a new domain. This PR propagates that URL change here.

PiperOrigin-RevId: 896118946
2026-04-07 15:37:11 -07:00
llalitkumarrr 6a1c90bd9d docs: Auto-Assignment GitHub Action for Issues
Merge https://github.com/google/adk-python/pull/4966

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4966 from llalitkumarrr:main ff7a8465ae923b3990de2483c16f374f8193302b
PiperOrigin-RevId: 896062781
2026-04-07 13:33:19 -07:00