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
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]]) -> EmbeddingResultParameters
ParamField
UnionNo description available.
ParamField
strNo description available.
ParamField
Optional[int]No description available.
ParamField
strNo description available.
ParamField
floatNo description available.
ParamField
Optional[str]No description available.
ParamField
Optional[str]No description available.
ParamField
OptionalNo description available.
Returns
ResponseField
EmbeddingResultThe result of the operation.
Usage
>>> from praisonaiagents import aembedding
>>> result = await aembedding("Hello, world!")
>>> print(len(result.embeddings[0]))
1536Uses
litellm.aembeddingEmbeddingResult
Used By
Source
View on GitHubpraisonaiagents/embedding/embed.py at line 100