aembedding • AI Agent SDK

aembedding: Async: Generate embeddings for text using LiteLLM.

aembedding

Async

Function

</div>

This function is defined in the 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
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 Union

No description available.

ParamField str

No description available.

ParamField Optional[int]

No description available.

ParamField str

No description available.

ParamField float

No description available.

ParamField Optional[str]

No description available.

ParamField Optional[str]

No description available.

ParamField Optional

No description available.

Returns

ResponseField EmbeddingResult

The result of the operation.

Usage

python
>>> from praisonaiagents import aembedding
    >>> result = await aembedding("Hello, world!")
    >>> print(len(result.embeddings[0]))
    1536

Uses

  • litellm.aembedding
  • EmbeddingResult

Used By

Source

View on GitHub

praisonaiagents/embedding/embed.py at line 100