Skip to main content

execute_async

AsyncMethod
This is a method of the Handoff class in the handoff module.
Execute handoff asynchronously with concurrency control.

Signature

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

Parameters

source_agent
Agent
required
The agent initiating the handoff
prompt
str
required
The task/prompt to pass to target agent
context
Optional
Optional additional context

Returns

Returns
HandoffResult
HandoffResult with response or error

Uses

  • asyncio.Semaphore
  • time.time
  • logger.info
  • achat
  • asyncio.get_event_loop
  • loop.run_in_executor
  • HandoffResult
  • asyncio.wait_for
  • HandoffTimeoutError

Used By

Source

View on GitHub

praisonaiagents/agent/handoff.py at line 453