11 Commits

Author SHA1 Message Date
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
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
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
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
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
Shangjie Chen f3f602f1fa docs(samples): Remove NOT WORKING YET comments from workflow samples
Confirmed that all 4 workflow samples work correctly.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 945814768
2026-07-10 11:38:08 -07:00
Shangjie Chen 9d306f5d32 feat(workflow): Support state-based resumption for task-mode agent workflow nodes
- 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
2026-07-09 18:40:44 -07:00
Shangjie Chen 1263ed64e3 feat: Implement Workflow as Tool core feature
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
2026-07-06 14:32:39 -07:00
Milen Kovachev 3cbcefce9f chore: add missing Apache 2.0 license headers
Merge https://github.com/google/adk-python/pull/6155

**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**

### Link to Issue or Description of Change

**1. Link to an existing issue (if applicable):**
N/A

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

**Problem:**
The repository is missing Apache 2.0 license headers across 155 files. This is required by Google OSPO.

**Solution:**
Prepended the standard Apache 2.0 open-source license header to all flagged files. The copyright year was dynamically assigned based on each file's first commit year in git history.

### Testing Plan

_Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes._

**Unit Tests:**

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

_Please include a summary of passed `pytest` results._
N/A - This PR only adds comments (license headers) to the top of files and contains zero functional code changes. No new tests are needed, and existing tests should pass as-is.

**Manual End-to-End (E2E) Tests:**
N/A - No functional code was changed.

### 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.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] 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.
- [ ] I have manually tested my changes end-to-end.
- [ ] Any dependent changes have been merged and published in downstream modules.

### Additional context

Co-authored-by: Shangjie Chen <deanchen@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6155 from milenvk:fix-missing-licenses d2a264b9a812fd997daf975ec37996e6b4b7a042
PiperOrigin-RevId: 936165783
2026-06-22 11:37:57 -07:00
Shangjie Chen 0c6974cbc4 fix: Set role='model' for request_input event Content
Set role='model' in the Content object generated by create_request_input_event()
to ensure proper role attribution when returning function call events to the client.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 929538818
2026-06-09 19:19:51 -07:00
Sasha Sobran 162279358c chore: switch main to v2.0.0 GA (transition to v2)
Co-authored-by: Bo Yang <ybo@google.com>
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
Co-authored-by: George Weale <gweale@google.com>
Co-authored-by: Swapnil Agarwal <swapnilag@google.com>
Co-authored-by: Xuan Yang <xygoogle@google.com>
Co-authored-by: Shangjie Chen <deanchen@google.com>
Co-authored-by: Yifan Wang <wanyif@google.com>
Co-authored-by: Kathy Wu <wukathy@google.com>
2026-05-19 02:01:33 +00:00