Table of Contents

Interface IEmbeddingProvider

Namespace
JD.AI.Core.Memory
Assembly
JD.AI.Core.dll

Abstraction for text embedding providers (OpenAI, Ollama, Voyage, etc.).

public interface IEmbeddingProvider

Properties

Dimensions

The dimensionality of the embedding vectors.

int Dimensions { get; }

Property Value

int

ProviderName

string ProviderName { get; }

Property Value

string

Methods

EmbedAsync(IReadOnlyList<string>, CancellationToken)

Generates embeddings for a batch of texts.

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

Parameters

texts IReadOnlyList<string>
ct CancellationToken

Returns

Task<IReadOnlyList<float[]>>

EmbedSingleAsync(string, CancellationToken)

Generates an embedding for a single text.

Task<float[]> EmbedSingleAsync(string text, CancellationToken ct = default)

Parameters

text string
ct CancellationToken

Returns

Task<float[]>