> ## 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.

# aembedding • AI Agent SDK

> aembedding: Async: Generate embeddings for text using LiteLLM.

# aembedding

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

> This function is defined in the [**embed**](../modules/embed) module.

Async: Generate embeddings for text using LiteLLM.

This is the async version of embedding() for use in async contexts.
See embedding() for full documentation.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def aembedding(input: Union[str, List[str]], model: str, dimensions: Optional[int], encoding_format: str, timeout: float, api_key: Optional[str], api_base: Optional[str], metadata: Optional[Dict[str, Any]]) -> EmbeddingResult
```

## Parameters

<ParamField query="input" type="Union" required={true}>
  No description available.
</ParamField>

<ParamField query="model" type="str" required={false} default="'text-embedding-3-small'">
  No description available.
</ParamField>

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

<ParamField query="encoding_format" type="str" required={false} default="'float'">
  No description available.
</ParamField>

<ParamField query="timeout" type="float" required={false} default="600.0">
  No description available.
</ParamField>

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

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

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

### Returns

<ResponseField name="Returns" type="EmbeddingResult">
  The result of the operation.
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
>>> from praisonaiagents import aembedding
    >>> result = await aembedding("Hello, world!")
    >>> print(len(result.embeddings[0]))
    1536
```

## Uses

* `litellm.aembedding`
* `EmbeddingResult`

## Used By

* [`EmbeddingAgent.aembed`](../functions/EmbeddingAgent-aembed)
* [`EmbeddingAgent.aembed_batch`](../functions/EmbeddingAgent-aembed_batch)
* [`aembedding`](../functions/aembedding)

## Source

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