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
- Decouple task-mode node execution from default output binding so standard text output does not prematurely finish the node.
- Enhance the runner to automatically resolve and reuse the invocation_id of active suspended task nodes.
- Route incoming plain text resume messages to the active task node by mapping to its isolation scope.
- Enforce strict concurrency serialization by suspending parallel branch execution when a task node is waiting for user input.
- Align schema validation helpers to cleanly handle Content wrapping and raw JSON strings.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 945423735
This change introduces logic to identify and execute tools that are non-blocking in a separate asyncio task. The function now returns immediately for these tools, and the tool's response is sent back through the LiveRequestQueue when the background task completes.
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 945327698
Point the basic and code-execution managed_agent sample READMEs at the common
ManagedAgent guide for setup, authentication, backends, and background, now that
that general content is consolidated in the guide.
Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 944601306
Add a runnable sample under contributing/samples/managed_agent/code_execution
showing how to use ManagedAgent with the server-side code execution tool. Since
ManagedAgent has no code_executor field, code execution is enabled by passing the
raw types.Tool(code_execution=types.ToolCodeExecution()) config in tools. The
sample exposes a root_agent in agent.py and ships a README plus a matching
single-turn live integration test that verifies a code-executed prime-sum
computation.
Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 943548907
Add a runnable sample under contributing/samples/managed_agent/basic showing how
to use ManagedAgent (backed by the Managed Agents API) with the server-side
google_search tool, mirroring the live integration test flow. The sample
exposes a root_agent in agent.py and ships a README covering the required
enterprise/ADC setup and example prompts (including a multi-turn follow-up that
reuses the recovered remote sandbox).
Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 943536117
Introduce NodeTool, allowing individual Nodes and entire Workflows to be wrapped and executed as standard ADK Tools.
This PR implements the core, single-turn execution capability:
- Support auto-wrapping of BaseNode (Workflows) directly in Agent.tools.
- Wrapping synchronous and asynchronous function nodes as NodeTools.
- Providing a complete sample workflow demonstrating how to run a workflow as a tool.
Resumption and multi-turn nested HITL support are skipped in this PR and will be fully enabled in the later PR.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 943499058
The instruction told the model to use a `log_query` tool that is not
registered on the agent, so when the model followed it the run failed
with "Tool 'log_query' not found". That made the integration_test
presubmit, which runs this sample, flaky. Reword the instruction to
just reply, matching the sample's documented output.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 943350141
The agent ran on a schedule with a write-scoped GitHub token while feeding
attacker-controlled issue title and body straight into its prompt, so a
crafted issue could steer its labeling and owner-assignment actions.
Removing the agent and its workflow removes that exposure.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 941289396
Add replay test fixtures covering the documented flows of the
contributing/samples/models/interactions_api sample (basic text, Google
Search grounding, multi-turn stateful recall, and a custom function
tool), so the sample is exercised by tests/unittests/test_samples.py.
Also fix the shared sample test harness (cli/agent_test_runner.py) to
support the Interactions API:
- Exclude the volatile interaction_id (a server-issued token) and
turn_complete fields from fixture comparison and from rebuilt
fixtures, matching how other non-reproducible fields (timestamps,
usage metadata, etc.) are already handled. The Interactions API
stamps these onto every model response and the replay MockModel
cannot reproduce them.
- Drive all turns of a fixture rebuild on a single persistent event
loop. The sync Runner.run() uses asyncio.run() per call, which closes
the loop the model's cached async api_client is bound to, so
subsequent turns fail with "Event loop is closed" and corrupt
multi-turn fixtures. Reusing one loop keeps the cached client valid
across the conversation.
Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 940691339
We gated the HTTP debug info behind debug level logging - this fixes the sample agent so that it returns the debug info
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 940676911
Move custom file compliance checks (logger pattern, future annotations,
cli imports, mTLS endpoints) from GHA inline bash scripts to a unified
python script (compliance_checks.py) and expose it as a local pre-commit hook.
Remove the compliance-check job from CI workflow.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 940081615