Skip to main content

Handoff

Defined in the handoff module.
AI Agent Represents a handoff configuration for delegating tasks to another agent. Handoffs are represented as tools to the LLM, allowing agents to transfer control to specialized agents for specific tasks. This is the unified mechanism for agent-to-agent task transfer, supporting:
  • LLM-driven handoffs (via tool calls)
  • Programmatic handoffs (direct Python API)
  • Async handoffs with concurrency control
  • Cycle detection and depth limiting
  • Configurable context policies

Constructor

Agent
required
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional[Callable]
No description available.
Optional[type]
No description available.
Optional
No description available.
Optional[HandoffConfig]
No description available.

Methods

tool_name()

Get the tool name for this handoff.

tool_description()

Get the tool description for this handoff.

default_tool_name()

Generate default tool name based on agent name.

default_tool_description()

Generate default tool description based on agent role and goal.

execute_programmatic()

Execute handoff programmatically (not via LLM tool call).

execute_async()

Execute handoff asynchronously with concurrency control.

to_tool_function()

Convert this handoff to a tool function that can be called by the LLM.

Source

View on GitHub

praisonaiagents/agent/handoff.py at line 297

Handoffs Concept

Handoffs Feature