Skip to content

Conversation

@tommyhutcheson
Copy link

@tommyhutcheson tommyhutcheson commented Sep 22, 2025

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_sequence from a tool
  • Practical example: Search → Analysis → Report pipeline
  • Cross-reference to LoopAgent's exit_loop for consistency

Corrected Implementation Details:

  • Clarified that exit_sequence is 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:

  1. Introduction and use cases
  2. Basic usage with code example
  3. Practical pipeline example
  4. Live mode support note
  5. Comparison to LoopAgent

Key Updates

  • Added import examples showing exit_sequence alongside 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant