Skip to main content

handoff

Function
This function is defined in the handoff module.
Create a handoff configuration for delegating tasks to another agent. This is a convenience function that creates a Handoff instance with the specified configuration. It supports both the legacy API and the new unified HandoffConfig.

Signature

Parameters

agent
Agent
required
The target agent to hand off to
tool_name_override
Optional
Custom tool name (defaults to transfer_to_<agent_name>)
tool_description_override
Optional
Custom tool description
on_handoff
Optional
Callback function executed when handoff is invoked
input_type
Optional
Type of input expected by the handoff (for structured data)
input_filter
Optional
Function to filter/transform input before passing to target agent
config
Optional
HandoffConfig for advanced settings
context_policy
Optional
Shorthand for config.context_policy (“full”, “summary”, “none”, “last_n”)
timeout_seconds
Optional
Shorthand for config.timeout_seconds
max_concurrent
Optional
Shorthand for config.max_concurrent
detect_cycles
Optional
Shorthand for config.detect_cycles
max_depth
Optional
Shorthand for config.max_depth

Returns

Returns
Handoff
A configured Handoff instance

Usage

Uses

  • HandoffConfig
  • ContextPolicy
  • Handoff

Source

View on GitHub

praisonaiagents/agent/handoff.py at line 669

Handoffs Concept

Handoffs Feature