Documentation
¶
Overview ¶
Package controltool provides control flow tools for agent reasoning loops.
These tools allow agents to explicitly control the reasoning loop:
- exit_loop: Signal task completion and exit the loop
- escalate: Escalate to a parent agent when stuck or needing help
- transfer_to: Transfer control to another agent
Following adk-go patterns, these tools work by setting EventActions flags that are checked by the termination conditions in the reasoning loop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Escalate ¶
func Escalate() tool.CallableTool
Escalate creates a tool that allows the agent to escalate to a parent agent. When called, it sets Escalate=true and SkipSummarization=true which triggers the escalate termination condition.
Usage in YAML config:
tools: - escalate
Usage in instruction:
Call `escalate` if you need help, are stuck, or the task is outside your capabilities.
func ExitLoop ¶
func ExitLoop() tool.CallableTool
ExitLoop creates a tool that allows the agent to explicitly exit the reasoning loop. When called, it sets SkipSummarization=true which triggers the skip_summarization termination condition.
Usage in YAML config:
tools: - exit_loop
Usage in instruction:
Call `exit_loop` when your task is complete and you have a final answer.
func TransferTo ¶
func TransferTo(agentName, description string) tool.CallableTool
TransferTo creates a tool that transfers control to a specific agent. When called, it sets TransferToAgent and SkipSummarization which triggers the transfer termination condition.
Parameters:
- agentName: The name of the agent to transfer to
- description: Description of what this agent does (for LLM context)
Usage in YAML config (typically auto-generated for sub-agents):
tools: - transfer_to_researcher
Usage in instruction:
Transfer to the researcher agent for information gathering tasks.
Types ¶
This section is empty.