Execute Programmatic • AI Agent SDK
execute_programmatic: Execute handoff programmatically (not via LLM tool call).
execute_programmatic
Method
</div>
This is a method of the Handoff class in the handoff module.
Execute handoff programmatically (not via LLM tool call).
This is the unified programmatic handoff API that replaces Agent.delegate().
Signature
def execute_programmatic(source_agent: 'Agent', prompt: str, context: Optional[Dict[str, Any]]) -> HandoffResultParameters
ParamField
AgentThe agent initiating the handoff
ParamField
strThe task/prompt to pass to target agent
ParamField
OptionalOptional additional context
Returns
ResponseField
HandoffResultHandoffResult with response or error
Uses
time.timelogger.infoHandoffResulton_delegationlogger.warninglogger.error
Used By
Source
View on GitHubpraisonaiagents/agent/handoff.py at line 805