Embed Batch • AI Agent SDK
embed_batch: Generate embeddings for multiple texts.
embed_batch
Method
</div>
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
ParamField
List[str]List of texts to embed
ParamField
Optional[str]Override model for this call **kwargs: Additional provider-specific parameters
Returns
ResponseField
List[List[float]]List of embedding vectors
Usage
agent = EmbeddingAgent()
embeddings = agent.embed_batch(["Hello", "World"])
print(f"Generated {len(embeddings)} embeddings")Uses
embedding
Used By
Source
View on GitHubpraisonaiagents/agent/embedding_agent.py at line 223