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
Agent
required
No description available.
tool_name_override
Optional
No description available.
tool_description_override
Optional
No description available.
on_handoff
Optional
No description available.
input_type
Optional
No description available.
input_filter
Optional
No description available.
config
Optional
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 186

Handoffs Concept

Handoffs Feature