adk-docs
adk-docs copied to clipboard
feat: Add documentation for early exit mechanism to SequentialAgent using escalate action #2999
Summary
Adds documentation for the early exit mechanism in SequentialAgent using the exit_sequence tool.
Related Python PR: google/adk-python#2999
Changes
New Section: "Early Exit with exit_sequence"
- Explains when to use early exit (validation failures, empty results, blocking conditions)
- Usage example showing how to call
exit_sequencefrom a tool - Practical example: Search → Analysis → Report pipeline
- Cross-reference to LoopAgent's
exit_loopfor consistency
Corrected Implementation Details:
- Clarified that
exit_sequenceis supported in both async and live streaming modes - Documented that escalate action provides immediate termination in live mode
- Noted that
task_completed()remains available for natural completion signals
Documentation Structure
The new section is placed between "How it works" and "Full Example: Code Development Pipeline" to maintain logical flow:
- Introduction and use cases
- Basic usage with code example
- Practical pipeline example
- Live mode support note
- Comparison to LoopAgent
Key Updates
- Added import examples showing
exit_sequencealongside other tools - Included practical search pipeline demonstrating early exit on empty results
- Cross-referenced LoopAgent documentation for consistent patterns
- Clarified behaviour in both async and live modes
Fixes documentation gap for feature introduced in google/adk-python#2999