> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Await For Completions • AI Agent SDK

> await_for_completions: Async, event-driven version of wait_for_completions.

# await\_for\_completions

<div className="flex items-center gap-2">
  <Badge color="blue">Async</Badge>
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**AgentTeam**](../classes/AgentTeam) class in the [**agents**](../modules/agents) module.

Async, event-driven version of wait\_for\_completions.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def await_for_completions(timeout: Optional[float], agent_ids: Optional[List[str]]) -> List[SubAgentCompletionEvent]
```

## Parameters

<ParamField query="timeout" type="Optional[float]" required={false}>
  No description available.
</ParamField>

<ParamField query="agent_ids" type="Optional" required={false}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="List[SubAgentCompletionEvent]">
  The result of the operation.
</ResponseField>

## Uses

* `asyncio.Lock`
* `asyncio.Event`
* `completed_agents.add`
* `asyncio.get_running_loop`
* `loop.call_soon_threadsafe`
* `check_completions`
* `completion_event.is_set`
* `subscribe`
* `asyncio.wait_for`
* `completion_event.wait`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agents/agents.py#L3508">
  `praisonaiagents/agents/agents.py` at line 3508
</Card>
