Table of Contents

Interface IEmbeddingProvider

Namespace
Mythosia.AI.Rag
Assembly
Mythosia.AI.Rag.Abstractions.dll

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

int

Methods

GetEmbeddingAsync(string, CancellationToken)

Generates an embedding vector for a single text input.

Task<float[]> GetEmbeddingAsync(string text, CancellationToken cancellationToken = default)

Parameters

text string
cancellationToken CancellationToken

Returns

Task<float[]>

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

texts IEnumerable<string>
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<float[]>>