Add a new sample 'auth_oauth' demonstrating how to request a GitHub OAuth token in a workflow and use it to list repositories. Also rename the 'auth_config' sample to 'auth_api_key' for consistency.
Change-Id: I014b2f46f74b3017be89efc092380087179cf533
Add alias_generator and populate_by_name to RequestInput model_config to match frontend naming conventions and other event models.
Change-Id: I5eb4a55185d0113d86407c119050bb9885a7962b
These are not used in the example
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 900902777
Change-Id: Iadaaf9b03499d969f18e03eafb9fc21d79d94d87
When from __future__ import annotations is used, type hints are stored as strings. This caused is_list_of_basemodel to fail in FunctionTool, preventing dictionaries from being automatically converted back to Pydantic models when passed to tools. Used get_type_hints to evaluate them.
Also updated 10_burgers.json test trace to reflect the successful execution after this fix.
Change-Id: I92a708dd17ef76fc222779cd28e4a2d551325ce8
Use a FIFO queue for function name lookups to handle multiple calls in a trace, and remove hardcoded agent names to support all task agents. Also extract duplicate post-processing logic into a shared function.
Change-Id: Ia1062c6a6ba87a0d49c3982936121ac02f2bb352
Moved the stateful aggregation logic from JoinNode to the Workflow orchestrator to simplify node implementation and prevent state leaks in loops. Removed in_nodes from Context as it is no longer needed.
Change-Id: If0677f65c735ee3bce985478f7990b4a3335b7df
## 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
Change-Id: I1d490f139ff78a1020dce9b88e9497d576e60882
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
Change-Id: If077549a1285593108e3764aa4a3fe967f31b412
Compare events using raw dicts instead of constructing AdkEvent objects to avoid validation overhead and potential issues. Also sort longRunningToolIds to ensure order-independent comparison.
Change-Id: Ia17ea5bd0caaa1dd1b38cbef66e10d38d5666893
The is_parallel flag was ignored in Context.run_node when falling back to non-workflow mode. Now it propagates to NodeRunner so that events generated by the node correctly create a sub-branch.
Change-Id: I4f58a7fb58f998a831c48b3c0b39f18dbb828bae
Sort keys when saving rebuilt JSON test files and re-assign sequential event IDs to avoid gaps from filtered events. Also applied these changes to all existing test files in the contributing folder.
Change-Id: Ib126228f016db1d28030eee4f7d9d8cbc604e038
Only add branch segments when parallelism occurs. Handle joins by using the common prefix of incoming branches.
Change-Id: If75f57e2dd69f2ddf71ade818e9c19d2a6e32c53
Demonstrates dynamic node orchestration with ctx.run_node() and asyncio.gather. Uses sub_branch for event isolation to prevent context pollution.
Change-Id: I00b98fe135b5f2a4d671580054d3aa4ad2901d50
- Removed obsolete TODOs and mode='single_turn' from dynamic nodes sample.
- Fixed line lengths exceeding 80 characters in several samples.
- Removed unused imports and arguments.
Change-Id: Ie03871a258d02eadae9f2ae73f6d2982b755eae5
Running all tests caused the global random state to diverge, failing samples that rely on specific random sequences (like retry and loop_self). Moving mock values to JSON files allows deterministic replay without hardcoding sample paths in the runner.
Change-Id: I8e8b14cc54baa47da96aecdbaacb391868d528bb
This commit refactors the workflow engine's retry mechanics to use a 1-based `attempt_count` instead of the ambiguous `retry_count`. This eliminates off-by-one complexities and aligns the implementation with documented behavior.
Key Changes:
- Replaced `retry_count` with `attempt_count` across `_node_runner_class.py`, `_node_runner.py`, `_workflow.py`, and `_retry_utils.py`.
- Updated `Context` in `agents/context.py` to use `attempt_count` as primary, removing `retry_count` entirely.
- Updated `NodeState` in `_node_state.py` to store `attempt_count` (1-based) instead of `retry_count`.
- Fixed the off-by-one bug in `max_attempts` check: now simply `attempt_count >= max_attempts`.
- Updated the `retry` sample and its README to use `attempt_count` and `max_attempts`.
- Updated unit tests in `test_node_runner_class_failure.py` and `test_workflow_failures.py` to use `attempt_count` and `attempt_counts` in assertions.
Change-Id: I0809c345cae2b62a00170e45e5c3cb6b648823f1
We recently overhauled our MCP Toolbox documentation and moved it to a new domain. This PR propagates that URL change here.
PiperOrigin-RevId: 896118946
Change-Id: I77d474b8d120263f7d025b3cad900ae8b84cf0d8
We changed skills to use kebab case and created weather-skill, but forgot to get rid of weather_skill in the sample
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 893597141
Change-Id: Ic4e85a67f01c678fe0d87759e8f7b758211dff44
The `receive` method now accumulates function calls from multiple `LiveServerMessage` instances. These accumulated tool calls are yielded as a single `LlmResponse` containing all function call parts only when a turn_complete message is received.
Without the change, the tool_1's response is sent to the model as soon as it's generated, triggering a second call for tool_2. Upon receiving two consecutive tool_2's responses, the model utters the same message twice.
Fixes issue #4902
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 893197482
Change-Id: I7898cbbb385d2c1af52d030d20e6361594f488cf
This change introduces the LocalEnvironment class, which allows agents to execute shell commands and perform file operations using asyncio subprocesses on the local machine. It includes support for a working directory and custom environment variables. A sample agent configuration is also added to demonstrate its usage.
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 890685517
Change-Id: Ibe948643077fc606cb2a5cf395b67c65af32d7f7
This PR updates the `toolbox-adk` package version in the `pyproject.toml` and also updates the MCP Toolbox server version to the latest in the docs.
PiperOrigin-RevId: 890633573
Change-Id: I4ca2e0d1b1d9a76b62c46ec688e729f49bdf1d01
This change introduces a new `SpannerAdminToolset` with tools for managing Google Cloud Spanner resources. The toolset includes functions to list and get details of Spanner instances and instance configurations, and to create, list databases. The new toolset is marked as experimental. Unit tests for the new admin tools are also added
PiperOrigin-RevId: 885116111
Change-Id: Id588cc26937c937886f7bccc6a019ceb52dfc263
this sample can be used to test the latest gemini embedding model
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 884574396
Change-Id: Id77891315da72f51a1aee0e4839be08781768a29
The AgentEngineSandboxCodeExecutor now has three initialization modes:
1. Create both an Agent Engine and sandbox if neither resource name is provided.
2. Creating a new sandbox within a provided agent_engine_resource_name.
3. Using a provided sandbox_resource_name.
PiperOrigin-RevId: 884088248
Change-Id: I85580a3028392347e11fe4993d0c854bb3be0201