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
Drop the comment-posting tool so the sample bot only labels PRs and
assigns the component owner, instead of writing free-text responses.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 948086786
- Fix TypeError by adding required model parameter to generate_content call.
- Support Vertex AI (GCP) authentication via gcloud credentials by allowing Client configuration via environment variables.
- Fix deadlock by yielding correct type (string count) instead of full GenerateContentResponse from monitor_video_stream.
- Clean up duplicate imports.
- Update agent system instruction with CRITICAL warning to restrict calling monitor tools to at most once per request and explain the background streaming behavior.
- Improve monitor tools (video and stock) docstrings with CRITICAL warnings to instruct the model to call them only once and wait for background updates.
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 947835801
Merge https://github.com/google/adk-python/pull/6113
## Summary
- Configure the discussion answering agents through `LLM_MODEL_NAME` instead of
hardcoding `gemini-3.5-flash`.
- Let the GitHub workflow override both the answering model and Vertex location
with repository variables.
- Downgrade the default model from `gemini-3.5-flash` to `gemini-2.5-flash` because
`gemini-3.5-flash` 404s on Vertex AI Search (#6104).
- Document the new knobs.
Fixes#6104
## Testing
- `git diff --check`
- `python3.12 -m py_compile contributing/samples/adk_team/adk_answering_agent/settings.py contributing/samples/adk_team/adk_answering_agent/agent.py contributing/samples/adk_team/adk_answering_agent/gemini_assistant/agent.py`
Co-authored-by: Kathy Wu <wukathy@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6113 from Haihan-Jiang:codex/adk-python-answering-model-config aea24eab14eaf479b7d42f59f25a94e0baa713a5
PiperOrigin-RevId: 947224603
Merge https://github.com/google/adk-python/pull/5996
The `adk_documentation` sample tools (`read_local_git_repo_file_content`,
`list_directory_contents`, `search_local_git_repo`, and the file-writing
step of `create_pull_request_from_changes`) are invoked by autonomous
agents (`adk_docs_updater`, `adk_release_analyzer`) that run non-interactively
in GitHub Actions and process untrusted input — GitHub issue bodies and
release diffs.
This change keeps the tools within their intended sandbox by resolving
symlinks and `..` segments, then requiring results to stay inside the
managed repositories directory.
PiperOrigin-RevId: 947146756
Add a runnable sample wiring `ManagedAgent` to the Maps Grounding Lite MCP
server via `RemoteMcpServer`, with a `header_provider` callback that reads
`GOOGLE_MAPS_API_KEY` and sends it as the `X-Goog-Api-Key` header. Demonstrates
server-side remote MCP execution with runtime header minting.
Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 947137422
Add a runnable sample under contributing/samples/managed_agent/single_turn
showing a local LlmAgent coordinator that calls two server-backed ManagedAgent
specialists (server-side google_search and code execution) as single-turn
sub-agents (mode='single_turn'). ADK auto-wraps each single-turn sub-agent as an
inline tool, so the coordinator stays in control and can call both specialists
within one turn; unlike AgentTool, the specialists' internal events are
preserved in the shared session. The sample exposes a root_agent in agent.py and
ships a README covering setup and example prompts.
Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 945969891
jira_agent passed tool_name to ApplicationIntegrationToolset, which only
accepts tool_name_prefix. hello_world_litellm_add_function_to_prompt
failed at import because langchain-core 1.x no longer auto-imports
langchain_core.tools, which convert_to_openai_function relies on.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 945809141