Skip to main content

embed_batch

Method
This is a method of the EmbeddingAgent class in the embedding_agent module.
Generate embeddings for multiple texts.

Signature

def embed_batch(texts: List[str], model: Optional[str]) -> List[List[float]]

Parameters

texts
List
required
List of texts to embed
model
Optional
Override model for this call **kwargs: Additional provider-specific parameters

Returns

Returns
List[List[float]]
List of embedding vectors

Usage

agent = EmbeddingAgent()
    embeddings = agent.embed_batch(["Hello", "World"])
    print(f"Generated {len(embeddings)} embeddings")