embedding • AI Agents Framework
embedding: Get embedding vector for text.
embedding
Function
</div>
This function is defined in the llm module.
Get embedding vector for text.
.. deprecated:: Use from praisonai import embed or from praisonai.capabilities import embed instead. This function returns raw vectors; the new embed() returns EmbeddingResult with metadata.
Signature
def embedding(text: Any, model: Any) -> AnyParameters
ParamField
AnyText string or list of strings to embed
ParamField
AnyEmbedding model name (default: text-embedding-3-small) **kwargs: Additional arguments passed to litellm.embedding()
Returns
ResponseField
AnyList[float] for single text, or List[List[float]] for multiple texts
Usage
from praisonai.llm import embedding
# Single text
emb = embedding("Hello world")
# Multiple texts
embs = embedding(["Hello", "World"])
# Different model
emb = embedding("Hello", model="text-embedding-3-large")Uses
warn_deprecated_paramwarnings.warnImportErrorlitellm.embedding
Notes
Requires litellm. Install with: pip install praisonai[llm]
Used By
Source
View on GitHubpraisonai/llm/__init__.py at line 61