Language

EmbeddingGenerationDispatcher Class

Definition

Represents a supported embedding type for a vector store provider. This is an internal support type meant for use by providers only and not by applications.

public ref class EmbeddingGenerationDispatcher abstract
[System.Diagnostics.CodeAnalysis.Experimental("MEVD9001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public abstract class EmbeddingGenerationDispatcher
public abstract class EmbeddingGenerationDispatcher
[<System.Diagnostics.CodeAnalysis.Experimental("MEVD9001", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
type EmbeddingGenerationDispatcher = class
type EmbeddingGenerationDispatcher = class
Public MustInherit Class EmbeddingGenerationDispatcher
Inheritance
EmbeddingGenerationDispatcher
Derived
Attributes

Remarks

Each instance encapsulates both build-time embedding type resolution and runtime embedding generation for a specific Embedding subtype.

Constructors

Name Description
EmbeddingGenerationDispatcher()

Properties

Name Description
EmbeddingType

Gets the Embedding type that this instance supports.

Methods

Name Description
CanGenerateEmbedding(VectorPropertyModel, IEmbeddingGenerator)

Checks whether the given embeddingGenerator can produce embeddings of this type for any of the input types supported by the given vectorProperty. This is used for native vector property types (e.g., ReadOnlyMemory<T> of float), where embedding generation is only needed for search and the input type is not known at model-build time.

Create<TEmbedding>()

Creates a new EmbeddingGenerationDispatcher for the given TEmbedding type.

GenerateEmbeddingAsync(VectorPropertyModel, Object, CancellationToken)

Generates a single embedding of this type from the given value, using the embedding generator configured on the vectorProperty.

GenerateEmbeddingsAsync(VectorPropertyModel, IEnumerable<Object>, CancellationToken)

Generates embeddings of this type from the given values, using the embedding generator configured on the vectorProperty.

ResolveEmbeddingType(VectorPropertyModel, IEmbeddingGenerator, Type)

Attempts to resolve the embedding type for the given vectorProperty, using the given embeddingGenerator.

Applies to