Interface IEmbeddingProvider

Assembly: redb.Route.Llm.dll

Pure transport over an embeddings API — turns text into vectors. The sibling
of for the retrieval half of RAG: chunks are
embedded on ingest, the query is embedded on search, and
ranks by cosine
similarity. Implementations do protocol work only (serialise, HTTP,
deserialise); chunking, storage and ranking live elsewhere.

public interface IEmbeddingProvider

Properties

ModelId

Embedding model id this provider was configured with.

string ModelId { get; }

ProviderId

Provider identifier ("openai", "mistral", "together", ...).

string ProviderId { get; }

Methods

EmbedAsync(IReadOnlyList<string>, CancellationToken)

Embeds each input text and returns one vector per input, in the same order.

Task<IReadOnlyList<float[]>> EmbedAsync(IReadOnlyList<string> inputs, CancellationToken ct = default)

EmbedOneAsync(string, CancellationToken)

Convenience single-text embed. Returns an empty array when the provider returns nothing.

Task<float[]> EmbedOneAsync(string input, CancellationToken ct = default)