embed_batch

Function embed_batch 

Source
pub async fn embed_batch(
    texts: Vec<&str>,
    provider: Option<EmbeddingProvider>,
    api_key: Option<&str>,
) -> Result<Vec<Vec<f32>>>
Expand description

Embed multiple text strings

Uses local embeddings by default (no API required). Set AVOCADODB_EMBEDDING_PROVIDER=openai to use OpenAI.

§Arguments

  • texts - Vector of text strings to embed
  • provider - Embedding provider (defaults to Local)
  • api_key - OpenAI API key (only used if provider is OpenAI)

§Returns

A vector of embeddings, in the same order as the input texts