Execute Async • AI Agent SDK

execute_async: Execute handoff asynchronously with concurrency control.

execute_async

Async

Method

</div>

This is a method of the Handoff class in the handoff module.

Execute handoff asynchronously with concurrency control.

Signature

python
async def execute_async(source_agent: 'Agent', prompt: str, context: Optional[Dict[str, Any]]) -> HandoffResult

Parameters

ParamField Agent

The agent initiating the handoff

ParamField str

The task/prompt to pass to target agent

ParamField Optional

Optional additional context

Returns

ResponseField HandoffResult

HandoffResult with response or error

Uses

  • time.time
  • logger.info
  • HandoffResult
  • on_delegation
  • logger.warning
  • asyncio.wait_for
  • HandoffTimeoutError

Used By

Source

View on GitHub

praisonaiagents/agent/handoff.py at line 916


Related Documentation