API reference for the agent handoff system
Handoff
class for creating custom handoff tools and the handoff
function for standard handoff operations.
Handoff
Tool
that provides handoff-specific functionality.
run()
message
(str): Message to pass to the target agentstr
: Handoff prompt with instructionsHandoffInputData
input_model
.
handoff()
Handoff
: When creating a tool (no message provided)str
: When executing directly (message provided)prompt_with_handoff_instructions()
str
: Formatted handoff prompthandoff_filters()
"all"
- Accept handoffs from any agent"none"
- Reject all handoffs"self"
- Only accept from same agent"other"
- Accept from any agent except self"team:<name>"
- Only accept from agents in specified teamDEFAULT_TEMPLATE
DEFAULT_DESCRIPTION