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
Implements the update_data_agent tool mimicking the MCP toolbox implementation,
allowing the updating of Gemini Data Agents.
PiperOrigin-RevId: 966070636
Implements the delete_data_agent tool mimicking the MCP toolbox implementation,
allowing the deletion of Gemini Data Agents.
PiperOrigin-RevId: 966052260
Implements the create_data_agent tool mimicking the MCP toolbox implementation,
allowing the creation of Gemini Data Agents.
PiperOrigin-RevId: 964346405
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
- 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