Interface IEmbeddingProvider
Generates embedding vectors for text inputs. Implement this interface to wrap any embedding API (OpenAI, Azure, local models, etc.).
public interface IEmbeddingProvider
Properties
Dimensions
The dimensionality of the embedding vectors produced by this provider.
int Dimensions { get; }
Property Value
Methods
GetEmbeddingAsync(string, CancellationToken)
Generates an embedding vector for a single text input.
Task<float[]> GetEmbeddingAsync(string text, CancellationToken cancellationToken = default)
Parameters
textstringcancellationTokenCancellationToken
Returns
GetEmbeddingsAsync(IEnumerable<string>, CancellationToken)
Generates embedding vectors for multiple text inputs in a single batch call.
Task<IReadOnlyList<float[]>> GetEmbeddingsAsync(IEnumerable<string> texts, CancellationToken cancellationToken = default)
Parameters
textsIEnumerable<string>cancellationTokenCancellationToken
Returns
- Task<IReadOnlyList<float[]>>