Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/07_loop_agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def exit_loop(tool_context: ToolContext):
Called by the refiner when critic approves the essay.
"""
print(f" [Exit Loop] Called by {tool_context.agent_name} - Essay approved!")
tool_context.actions.end_of_agent = True # Signal to stop looping
tool_context.actions.escalate = True # Signal to stop looping
# Return a minimal valid content part so the backend always produces a valid LlmResponse
return {"text": "Loop exited successfully. The agent has determined the task is complete."}

Expand Down
4 changes: 2 additions & 2 deletions tutorial_implementation/tutorial07/essay_refiner/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def exit_loop(tool_context: ToolContext):
Called by the refiner when critic approves the essay.
"""
print(f" [Exit Loop] Called by {tool_context.agent_name} - Essay approved!")
tool_context.actions.end_of_agent = True # Signal to stop looping
tool_context.actions.escalate = True # Signal to stop looping
# Return a minimal valid content part so the backend always produces a valid LlmResponse
return {"text": "Loop exited successfully. The agent has determined the task is complete."}

Expand Down Expand Up @@ -126,4 +126,4 @@ def exit_loop(tool_context: ToolContext):
)

# MUST be named root_agent for ADK
root_agent = essay_refinement_system
root_agent = essay_refinement_system