Commit Graph

10 Commits

Author SHA1 Message Date
Bo Yang dd3fc8b0f4 feat: update nested workflow agent to pass year state to downstream agents and format aggregation output
Change-Id: I6924a0db6d9e71439b0da1e65d1759bfa476a402
2026-03-31 20:11:03 -07:00
Bo Yang dd88f9320d docs: update description of inline image from square to circle in agent workflow sample
Change-Id: I002617036f843460d7c1891da60dd16bd0db11a9
2026-03-31 20:10:54 -07:00
Bo Yang 2d5957eb3c docs(samples): add markdown table to streaming message sample
Change-Id: I77e6b5399bb2ca43f0dd0e7a957085c486920f5b
2026-03-28 16:27:10 -07:00
Bo Yang 1d59974cf4 docs(samples): Add streaming message example
Update message workflow sample to demonstrate streaming token chunks using Event(message=..., partial=True).

Change-Id: Iaa44a293dda1aec1a689b26997b83e4e17ae31ef
2026-03-28 16:25:22 -07:00
Shangjie Chen dc2adf9869 feat(workflow): Use SingleAgentReactNode for leaf single_turn agents in new Workflow
In the new _workflow_class.py Workflow, leaf single_turn LlmAgents now
run through SingleAgentReactNode instead of _SingleLlmAgent. This
enables proper event deduplication via _output_delegated — only the
LlmCallNode content event appears in the stream, not a duplicate
wrapper output event.

The old _workflow.py Workflow retains the original _SingleLlmAgent
path. Runtime detection uses event_queue presence on InvocationContext
to distinguish the two paths.

Also updates the use_as_output sample to use an LLM agent as the
delegated child node, and rewrites wrapper tests per adk-style
guidelines covering both old and new workflow paths.

Change-Id: I96aea3f12fe432d0449268eb75580c900fd047d7
2026-03-27 18:36:56 -07:00
Shangjie Chen d56e11ed68 feat(workflow): Add output_for field to Event for output delegation tracking
Add node_info.output_for to Event -- a list of node paths whose output
an event represents. For normal nodes it contains just the node own
path. When use_as_output=True delegation is used, it includes the full
ancestor chain (child path + all delegating parent paths).

Also adds a contributing sample demonstrating use_as_output with a
downstream edge in the new Workflow architecture.

Change-Id: I7e11276f894a3a2b396759dd146c221b487d4a7c
2026-03-27 10:11:19 -07:00
Shangjie Chen d93cdf35db feat(workflow): add FunctionNode auth_config
Add auth_config field to FunctionNode that pauses for user
authentication before running. The auth gate lives inside
FunctionNode.run(), keeping _node_runner generic.

Utility functions in _workflow_hitl_utils:
- create_auth_request_event: builds adk_request_credential FC event
  with user-facing message
- process_auth_resume: stores credentials with plain value fallback
- has_auth_credential: checks if credentials exist in state

Unwrap {"result":...} for auth responses in _process_resumptions,
consistent with request_input handling.

Includes sample agent and tests for auth flow and credential reuse.

Change-Id: Ib81bf9cf63b8282efd7898def17f6e47a95b2d05
2026-03-20 13:01:22 -07:00
Shangjie Chen fc90f364f9 fix(docs): add ctx param to retry sample README snippet
Change-Id: I4ad9994d95618ea1577951a856ce105db8411400
2026-03-19 13:57:42 -07:00
Shangjie Chen 4561d04ab3 feat(workflow): emit error events on node failure
When a node raises an exception, emit an Event with error_code and
error_message before propagating the error. This makes failures
visible in the event stream (web UI, CLI) without requiring nodes
to manually yield error messages.

Applies to all node types via _node_runner, covering both unhandled
exceptions and timeouts.

Update retry sample to remove manual error message yield.

Change-Id: I4598cd288f1201416086149f3af44f8c8c10c1a4
2026-03-19 13:34:42 -07:00
Wei (Jack) Sun 1c64a41b53 feat: ADK 2.0 alpha
Introduces two major capabilities:
- Workflow runtime: graph-based execution engine for composing
  deterministic execution flows for agentic apps, with support for
  routing, fan-out/fan-in, loops, retry, state management, dynamic
  nodes, human-in-the-loop, and nested workflows
- Task API: structured agent-to-agent delegation with multi-turn
  task mode, single-turn controlled output, mixed delegation
  patterns, human-in-the-loop, and task agents as workflow nodes

Co-Authored-By: Bo Yang <ybo@google.com>
Co-Authored-By: George Weale <gweale@google.com>
Co-Authored-By: Sean Zhou <seanzhougoogle@google.com>
Co-Authored-By: Shangjie Chen <deanchen@google.com>
Co-Authored-By: Swapnil Agarwal <swapnilag@google.com>
Co-Authored-By: Wei Sun <weisun@google.com>
Co-Authored-By: Xuan Yang <xygoogle@google.com>
Co-Authored-By: Yifan Wang <wanyif@google.com>
Change-Id: I35932c50cfe29ff68559e3781713dbb5eb7b3382
2026-03-17 23:24:58 -07:00