Agent Handoff • AI Agent SDK
agent_handoff: Emit agent handoff event for tracking agent-to-agent flow.
agent_handoff
Method
</div>
This is a method of the ContextTraceEmitter class in the context_events module.
Emit agent handoff event for tracking agent-to-agent flow.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
input["Input Data"] --> agent["Agent: agent_handoff"]
agent --> output["Output Result"]
style agent fill:#8B0000,color:#fff
style input fill:#8B0000,color:#fff
style output fill:#8B0000,color:#fffSignature
def agent_handoff(from_agent: str, to_agent: str, reason: Optional[str], context_passed: Optional[Dict[str, Any]], kind: str, node_id: Optional[str]) -> NoneParameters
ParamField
strNo description available.
ParamField
strNo description available.
ParamField
Optional[str]No description available.
ParamField
OptionalNo description available.
ParamField
str`handoff (agent hands over), delegate (the hierarchical manager assigns a task), route or spawn`.
ParamField
Optional[str]Graph node concerned; defaults to the receiving agent.
Uses
ContextEventtime.time
Source
View on GitHubpraisonaiagents/trace/context_events.py at line 1167