Skip to main content

embed

Method
This is a method of the EmbeddingAgent class in the embedding_agent module.
Generate embedding for a single text.

Signature

def embed(text: str, model: Optional[str]) -> List[float]

Parameters

text
str
required
Text to embed
model
Optional
Override model for this call **kwargs: Additional provider-specific parameters

Returns

Returns
List[float]
List of floats representing the embedding vector

Usage

agent = EmbeddingAgent()
    embedding = agent.embed("Hello world")
    print(f"Dimension: {len(embedding)}")