Freigeben über


EmbeddingGeneratorBuilder<TInput,TEmbedding> Class

Definition

A builder for creating pipelines of IEmbeddingGenerator<TInput,TEmbedding>.

generic <typename TInput, typename TEmbedding>
 where TEmbedding : Embeddingpublic ref class EmbeddingGeneratorBuilder sealed
public sealed class EmbeddingGeneratorBuilder<TInput,TEmbedding> where TEmbedding : Embedding
type EmbeddingGeneratorBuilder<'Input, 'Embedding (requires 'Embedding :> Embedding)> = class
Public NotInheritable Class EmbeddingGeneratorBuilder(Of TInput, TEmbedding)

Type Parameters

TInput

The type from which embeddings will be generated.

TEmbedding

The type of embeddings to generate.

Inheritance
EmbeddingGeneratorBuilder<TInput,TEmbedding>

Constructors

EmbeddingGeneratorBuilder<TInput,TEmbedding>(IServiceProvider)

Initializes a new instance of the EmbeddingGeneratorBuilder<TInput,TEmbedding> class.

Properties

Services

Gets the IServiceProvider associated with the builder instance.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)
Use(Func<IEmbeddingGenerator<TInput,TEmbedding>,IEmbeddingGenerator<TInput,TEmbedding>>)

Adds a factory for an intermediate embedding generator to the embedding generator pipeline.

Use(Func<IServiceProvider,IEmbeddingGenerator<TInput,TEmbedding>,IEmbeddingGenerator<TInput,TEmbedding>>)

Adds a factory for an intermediate embedding generator to the embedding generator pipeline.

Use(IEmbeddingGenerator<TInput,TEmbedding>)

Builds an instance of IEmbeddingGenerator<TInput,TEmbedding> using the specified inner generator.

Extension Methods

UseEmbeddingGenerationOptions<TInput,TEmbedding>(EmbeddingGeneratorBuilder<TInput, TEmbedding>, Func<EmbeddingGenerationOptions,EmbeddingGenerationOptions>)

Adds a callback that updates or replaces EmbeddingGenerationOptions. This can be used to set default options.

UseDistributedCache<TInput,TEmbedding>(EmbeddingGeneratorBuilder<TInput, TEmbedding>, IDistributedCache, Action<DistributedCachingEmbeddingGenerator<TInput, TEmbedding>>)

Adds a DistributedCachingEmbeddingGenerator<TInput,TEmbedding> as the next stage in the pipeline.

UseLogging<TInput,TEmbedding>(EmbeddingGeneratorBuilder<TInput,TEmbedding>, ILogger, Action<LoggingEmbeddingGenerator<TInput,TEmbedding>>)

Adds logging to the embedding generator pipeline.

UseOpenTelemetry<TInput,TEmbedding>(EmbeddingGeneratorBuilder<TInput, TEmbedding>, ILoggerFactory, String, Action<OpenTelemetryEmbeddingGenerator<TInput, TEmbedding>>)

Adds OpenTelemetry support to the embedding generator pipeline, following the OpenTelemetry Semantic Conventions for Generative AI systems.

Applies to