546 Commits

Author SHA1 Message Date
Liang Wu 98896eb2aa feat(live): let a live streaming tool send messages to the user directly
A streaming tool used to only talk to the model: every value it yielded came
back as a FunctionResponse. Therefore it costs model context and could derail the model's reasoning.

An Event with message yielded by a streaming tool is now addressed to the user instead. It is enqueued on the invocation's event queue, so the runner appends it to the session and streams it to the client, and it is never sent over the live model
connection. Plain values are still sent to the model as FunctionResponse. A tool can mix and match any number of each, in any order.

Runner's run_live also now initializes the invocation's event queue and merges it with the live agent's own event stream. Without a queue, anything running under
the live agent that enqueues an event -- a streaming tool, or a node -- fails
with "_event_queue is not set".

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 968533249
2026-08-21 09:15:04 -07:00
Soumili Nandi c6bba8dcc8 feat: add nvidia nim integration sample
Merge https://github.com/google/adk-python/pull/3433

Adds a sample demonstrating how to integrate NVIDIA NIM models with ADK using LiteLLM.

PiperOrigin-RevId: 966677064
2026-08-18 10:37:41 -07:00
Koichi73 93841270bc feat: add sample for skill state injection via adk_inject_state
Merge https://github.com/google/adk-python/pull/6219

Adds a runnable sample for the `adk_inject_state` feature.

PiperOrigin-RevId: 966108376
2026-08-17 12:13:13 -07:00
Google Team Member 92d00aa937 feat: add update_data_agent tool to data_agent toolset
Implements the update_data_agent tool mimicking the MCP toolbox implementation,
allowing the updating of Gemini Data Agents.

PiperOrigin-RevId: 966070636
2026-08-17 11:06:04 -07:00
Google Team Member 9b451fca3b feat: add delete_data_agent tool to data_agent toolset
Implements the delete_data_agent tool mimicking the MCP toolbox implementation,
allowing the deletion of Gemini Data Agents.

PiperOrigin-RevId: 966052260
2026-08-17 10:33:46 -07:00
George Weale 0c67410a66 fix(samples): widen numeric tool parameters to match their docstrings
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 965383656
2026-08-15 21:02:06 -07:00
weiguangli-io 8963a04846 fix: filter thought parts from A2A client user-facing response
Merge https://github.com/google/adk-python/pull/4686

Fixes #4676

PiperOrigin-RevId: 964433048
2026-08-13 19:52:28 -07:00
George Weale 4148f852aa chore: stop auto-labeling pull requests
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 964363281
2026-08-13 16:41:29 -07:00
Google Team Member 5cd38a0b3d feat: add create_data_agent tool to data_agent toolset
Implements the create_data_agent tool mimicking the MCP toolbox implementation,
allowing the creation of Gemini Data Agents.

PiperOrigin-RevId: 964346405
2026-08-13 16:07:36 -07:00
Milen Kovachev a3bd11152d feat(eventarc): Support Context callables and correct OMIT behavior
Merge https://github.com/google/adk-python/pull/6600

**1\. Link to an existing issue (if applicable):**

- Related: google/adk-docs\#2045 (Addresses technical verification feedback in [https://github.com/google/adk-docs/pull/2045\#issuecomment-5184438669](https://github.com/google/adk-docs/pull/2045#issuecomment-5184438669))

**2\. Or, if no issue exists, describe the change:**

**Problem:**

1. Callable attribute bindings in `CloudEventAttributesBinding` were always evaluated against the event `payload`. This prevented developers from correlating CloudEvents with ADK runtime telemetry (such as session IDs or invocation IDs from `Context`).
2. Setting `time=OMIT` or `datacontenttype=OMIT` in `CloudEventAttributesBinding` skipped adding keyword arguments when calling `publish_message`. Because `publish_message` auto-generates default UTC timestamps and content types when arguments are `None` or omitted, `time=OMIT` generated a timestamp instead of omitting the header.
3. Sample READMEs omitted the required `pip install "google-adk[gcp]"` prerequisite step needed for Eventarc publishing.

**Solution:**

1. Added automatic signature inspection (`0-arg`, `1-arg`, and `2-arg` callables) to `CloudEventAttributesBinding` so callables can receive the event `payload`, the runtime `Context` (`tool_context`), or both, while preserving full backward compatibility with existing payload callbacks.
2. Setting `time=OMIT` or `datacontenttype=OMIT` now explicitly passes empty string (`""`) to `publish_message` so attributes are omitted from published CloudEvents. Explicitly setting required CloudEvent specification headers (`id=OMIT`, `specversion=OMIT`) now raises a `TypeError` at tool build time.
3. Updated sample agents and sample READMEs (`domain_specific_agent` and `generic_agent`) to demonstrate `Context` callables, `time=OMIT`, and GCP extra prerequisites.

### Testing Plan

**Unit Tests:**

- I have added or updated unit tests for my change.
- All unit tests pass locally.

Summary of passed `pytest` results:

```
uv run --all-extras pytest tests/unittests/integrations/eventarc -v

======================== 63 passed, 4 warnings, 13 subtests passed in 3.14s ========================
```

- Added `test_runtime_execution_with_context_and_payload_lambdas` to verify 1-parameter (`payload` or `Context`) and 2-parameter callables.
- Added `test_time_and_datacontenttype_omit_pass_empty_string` to verify omission of `time` and `datacontenttype`.
- Added `test_id_and_specversion_omit_raise_typeerror` to verify static validation against omitting mandatory CloudEvent specification headers.

**Manual End-to-End (E2E) Tests:**

- Verified that sample agent tools in `contributing/samples/integrations/eventarc/domain_specific_agent/agent.py` build and run correctly.
- Confirmed that `complete_outreach_lambda_tool` correctly injects `Context.session_id` into the event source and that `ping_system_tool` emits events without a timestamp header when configured with `time=OMIT`.

### 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 added tests that prove my fix is effective or that my feature works.
- [x] New and existing unit tests pass locally with my changes.
- [x] I have manually tested my changes end-to-end.
- [x] Any dependent changes have been merged and published in downstream modules.

Additional context

Addresses the technical verification report on google/adk-docs#2045 comment.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6600 from milenvk:main 647744f65452358842982b4d88cd1401d4143c42
PiperOrigin-RevId: 964084439
2026-08-13 07:55:56 -07:00
George Weale cf42e866cd fix(samples): fail the maintenance run when issue discovery dies mid-page
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963672754
2026-08-12 14:49:15 -07:00
George Weale 64dddf2bf3 fix(samples): repair integrations samples that no longer run against the current API
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963642287
2026-08-12 13:53:54 -07:00
Shangjie Chen 1ad05439e0 fix(adk): share a single component-owner map between the triaging agents
The PR and issue triaging agents each kept their own copy of the component
-> owner map and they had drifted: the PR agent was missing several
components (skills, auth, bq, cli, integrations, workflow), and its
ALLOWED_LABELS gate -- which controls what the agent may apply -- was also
stale, so those labels could be neither applied nor assigned (a skills PR
was labeled "core" and assigned to the wrong owner).

Move the map into component_owners.py as the single source of truth and
import it verbatim as LABEL_TO_OWNER in both agents, so the two are always
identical and cannot drift. Derive the PR agent's ALLOWED_LABELS from
LABEL_TO_OWNER so a newly-owned component is allowed automatically.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 963611217
2026-08-12 12:57:22 -07:00
George Weale d8d8a6ef16 fix(samples): separate skipped from failed issues in the monitoring agent
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963583295
2026-08-12 12:02:55 -07:00
George Weale c840dbe991 fix(samples): make the MCP auth sample actually enforce auth, move MCP samples off the deprecated toolset name, and correct code execution claims
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963555685
2026-08-12 11:17:12 -07:00
George Weale 5418b73156 fix(samples): report failed stale agent audits and exit non-zero
Close #6520

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 963539924
2026-08-12 10:50:19 -07:00
Google Team Member 6f18257117 ADK changes
Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6544 from allen-stephen:feat/live-workflow-evals 1f4a15fe22cf7a9231fd808ca4835e7d30dce155
PiperOrigin-RevId: 963504694
2026-08-12 09:56:00 -07:00
Kathy Wu a61d8ecf29 fix(mcp): reject stdio MCP servers declared in agent configs by default
Loading an agent config that declared a stdio MCP server launched the
config-supplied `command` as a local process, before the model was ever
contacted. `McpToolset.from_config()` now rejects `stdio_server_params` and
`stdio_connection_params` unless the operator opts in by setting
`ADK_ALLOW_CONFIG_STDIO_MCP_SERVERS=1`. Remote transports
(`sse_connection_params`, `streamable_http_connection_params`) and toolsets
constructed in Python code are unaffected.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 962401277
2026-08-10 15:28:04 -07:00
George Weale 161f2b32b4 fix(samples): repair the session database migration recipe
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 962286520
2026-08-10 12:00:52 -07:00
George Weale a308848969 fix(samples): repair the workflow samples that produce the wrong output
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 962282749
2026-08-10 11:54:13 -07:00
Jason Zhang 6930be4305 fix: remove invalid event from 10_burgers sample test trace
Fix 10_burgers.json sample test replay by removing an erroneous premature function response event (e-4) that referenced tool call fc-3 before fc-3 was emitted by the model.

Co-authored-by: Jason Zhang <jasoncz@google.com>
PiperOrigin-RevId: 962270570
2026-08-10 11:32:40 -07:00
Cho Chung Hei 423434aa9d fix: fix inconsistencies in sample paper content and naming
Merge https://github.com/google/adk-python/pull/6654

Add a second paper for contrasting purposes and update references and display names to Gemini instead of Gemma.

Fixes #6651

PiperOrigin-RevId: 962264486
2026-08-10 11:22:30 -07:00
George Weale c620a7347c fix(samples): repair the core, tools, plugins and skills samples
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 962244200
2026-08-10 10:48:35 -07:00
George Weale 41ec5926ab fix(samples): repair the adk_team samples against the current API
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 961131471
2026-08-07 14:48:51 -07:00
George Weale d92bb42ccf fix(samples): make the human-in-the-loop sample respect the human's decision
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 960963424
2026-08-07 09:14:45 -07:00
George Weale 13168602af chore: remove stale internal references from samples and docs
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 960573273
2026-08-06 16:47:05 -07:00
George Weale 06111f127b docs: fix broken README links and publish the constraints files
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 960406496
2026-08-06 11:16:23 -07:00
Google Team Member 6ccb83734e fix: Use official SDK for credential finalization in GCP auth sample
PiperOrigin-RevId: 960164313
2026-08-06 02:17:47 -07:00
Jason Zhang 0c79d1a8da refactor(samples): Rename plugin folder to plugins for consistency
Rename `contributing/samples/plugin/` to `contributing/samples/plugins/` so the
samples directory matches the `plugins/` naming already used everywhere else in
the repository for this feature area: the `google.adk.plugins` source package
(`src/google/adk/plugins/`), the guide at `docs/guides/plugins/`, and the unit
tests at `tests/unittests/plugins/`. It also matches the plural naming used by
every sibling sample group (`tools/`, `models/`, `workflows/`, `patterns/`, and
others). The moved files themselves are unchanged.

Also update the paths that pointed into the renamed directory:

- Repoint the two "Related samples" links in the reflect-and-retry tool plugin
  guide, which the move would otherwise break.
- Fix the run commands in the two sample READMEs and in the debug logging agent
  docstring. These already omitted the grouping directory and so did not work
  before the rename either; they now refer to paths that exist.

Co-authored-by: Jason Zhang <jasoncz@google.com>
PiperOrigin-RevId: 960009471
2026-08-05 19:52:21 -07:00
Google Team Member ad9c113f6e refactor: move get_bucket tool to GCS admin toolset
Move get_bucket (get bucket metadata) from standard GCS toolset to GCS admin toolset, as retrieving bucket metadata is an administrative task. Maintain a deprecated stub in storage_tool.py for backward compatibility. Update tests and samples accordingly.

PiperOrigin-RevId: 958673216
2026-08-03 17:50:01 -07:00
Google Team Member eebdf22c07 refactor: update gcp_auth client to support dynamic agent selection
Refactor the `client/` directory within the `gcp_auth` sample to support dynamic agent selection. The client now scans the parent directory for available Python agents for local testing.

PiperOrigin-RevId: 956851269
2026-07-30 18:31:59 -07:00
Liang Wu fa31b6ca98 feat(environment): Add support for executing skill scripts within an Environment
The SkillToolset can now be initialized with a BaseEnvironment.
- If an Environment is provided to run skill script, materializes the skill resources within the environment's filesystem if they don't already exist. The script is then executed using the environment's execute method.
- Fallback to CodeExecutor if environment is not provided as default behavior.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 956565665
2026-07-30 09:21:08 -07:00
zhangzherui 95feafa3b2 fix: isolate delegated task branches
Merge https://github.com/google/adk-python/pull/6495

Fixes #6457

PiperOrigin-RevId: 954877821
2026-07-27 15:58:00 -07:00
George Weale f4979b5c78 fix: treat GitHub content as untrusted in the adk_team sample agents
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 954770777
2026-07-27 12:34:13 -07:00
Haran Rajkumar d86ae20c6a feat(samples): add ManagedAgent create-and-use custom-agent sample
Add a self-contained ManagedAgent sample that provisions a custom managed-agent
resource (custom persona + server-side google_search) via `--create` / `--delete`
CLI flags, reusing the genai client on `ManagedAgent.api_client`, then drives it
with `adk web` / `adk run`.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 954729930
2026-07-27 11:16:08 -07:00
Stephen Allen 5091f0a65a feat(eval): Make live and audio evals reachable via public entrypoints
Merge https://github.com/google/adk-python/pull/6458

Live/audio agent eval was only exercisable through private internal service imports; the public surface (CLI, dev-server, AgentEvaluator) always ran non-live text inference, so users had no supported path to evaluate Live API agents with a simulated audio user.

This threads `use_live` through all three public entrypoints, fixes the live-send path so native-audio models accept simulated user audio, and lets the dev-server select an audio (`llm_audio`) user simulator over HTTP. Live transcriptions are consolidated to text, with the text response preferred as the gradable output for turns carrying both audio and a transcript.

Adds a runnable sample (`live_non_blocking_tool_agent` evalset + `test_config` with `use_live: true` and a Gemini TTS audio simulator) plus unit tests covering `use_live` propagation, request validation, resampling, and the realtime-audio send path.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6458 from allen-stephen:feat/live-eval-parity 3fc33a2616d1515c822387deb8d70c27d5bc6244
PiperOrigin-RevId: 954725627
2026-07-27 11:08:51 -07:00
Ankit Ranjan 096ecfcf56 docs: fix broken relative links in documentation
Merge https://github.com/google/adk-python/pull/6489

Fixes four broken relative links in the documentation.

PiperOrigin-RevId: 954428272
2026-07-26 23:20:50 -07:00
Haran Rajkumar 481fe21cff feat: Add user_simulation ADK eval sample
Add contributing/samples/evaluation/user_simulation/, demonstrating
hallucinations_v1 and per_turn_user_simulator_quality_v1 with a dynamically
simulated user, run via `adk eval` over the shared home-automation agent.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 952613097
2026-07-23 02:01:05 -07:00
Haran Rajkumar 852a66ad62 feat: Add rubric_criteria ADK eval sample
Add contributing/samples/evaluation/rubric_criteria/, demonstrating
rubric_based_final_response_quality_v1 and rubric_based_tool_use_quality_v1
run via `adk eval` over the shared home-automation agent.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 952612418
2026-07-23 01:59:46 -07:00
Haran Rajkumar 0f0fa6bb4a feat: Add llm_judge_match ADK eval sample
Add contributing/samples/evaluation/llm_judge_match/, demonstrating
final_response_match_v2 (LLM-judged semantic response match) run via
`adk eval` over the shared home-automation agent.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 952611733
2026-07-23 01:58:23 -07:00
Haran Rajkumar f71d9df917 feat: Add custom_metric ADK eval sample
Add contributing/samples/evaluation/custom_metric/, demonstrating a
user-defined temperature_safety_score metric plugged into `adk eval` over the
shared home-automation agent.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 952602145
2026-07-23 01:36:06 -07:00
Haran Rajkumar 57a34ba77a feat: Add test_file_vs_evalset ADK eval sample
Add contributing/samples/evaluation/test_file_vs_evalset/, showing that
.test.json and .evalset.json share the same EvalSet schema and both run via
`adk eval`: a single-turn .test.json and a multi-session .evalset.json over
the shared home-automation agent.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 952586726
2026-07-23 01:01:36 -07:00
Haran Rajkumar fdebd9d563 feat: Add basic_criteria ADK eval sample
Add contributing/samples/evaluation/basic_criteria/, demonstrating the
deterministic built-in metrics tool_trajectory_avg_score and
response_match_score against the shared home-automation agent, run via
`adk eval`.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 952586163
2026-07-23 01:00:00 -07:00
Haran Rajkumar 6ba41ef35e feat: Add ADK evaluation samples: shared home-automation agent
Start contributing/samples/evaluation/, a family of single-concept samples that
demonstrate ADK evaluation through the `adk eval` CLI over one shared agent.

This first change adds the foundation shared by every sub-sample:

- home_automation_agent/: the shared agent (device-control tools) that all
  sub-samples evaluate.
- README.md: an overview of the family and how each sub-sample is run.

Subsequent changes each add one single-concept sub-sample folder.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 952558506
2026-07-22 23:53:04 -07:00
Anas Khan 13e311b0e4 chore: add codespell pre-commit hook to catch typos
Merge https://github.com/google/adk-python/pull/6406

Add a codespell hook to catch typos automatically.
Fix existing typos flagged by codespell.

PiperOrigin-RevId: 952416492
2026-07-22 17:13:05 -07:00
Google Team Member 217a90a2e6 feat(eventarc): add Eventarc Advanced toolset for ADK
This adds a new integration for Google Cloud Eventarc Advanced.
Provides `eventarc_toolset` which allows LLM agents to publish structured
CloudEvents. It strictly validates and sanitizes attributes according to the
CloudEvents 1.0 specification and supports dynamically resolving fields like `time`
and `id` at runtime using lambdas.

Includes comprehensive testing and documentation.

PiperOrigin-RevId: 952384562
2026-07-22 16:04:53 -07:00
Google Team Member d4f157d2ed feat(eventarc): add Eventarc Advanced toolset for ADK
PiperOrigin-RevId: 952241614
2026-07-22 11:39:34 -07:00
Haran Rajkumar 597fac3a4f docs(agents): add system-instruction sample and guide section
Add a runnable sample under
contributing/samples/managed_agent/system_instruction demonstrating the new
ManagedAgent.instruction field, and document the field in the ManagedAgent
guide.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 951709300
2026-07-21 14:46:43 -07:00
dependabot[bot] 9cf295d452 chore: bump pyjwt from 2.10.1 to 2.13.0
Merge https://github.com/google/adk-python/pull/6414

PiperOrigin-RevId: 949209003
2026-07-16 17:02:52 -07:00
Shangjie Chen 00760f8455 feat: Support HITL resumption for standalone nodes and NodeTool
- Enable resumability and add Human-in-the-Loop (HITL) step to `node_as_tool` sample workflow.
- Update `node_as_tool` README to document the HITL multi-turn flow.
- Fix `agent_test_runner.py` to preserve the `branch` field when replaying user events in tests.
- Implement lazy rehydration of `resume_inputs` from `session.events` in `NodeRunner` for standalone nodes (e.g. nodes run as tools of an Agent). This allows standalone nodes to resume correctly.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 948503030
2026-07-15 13:07:08 -07:00