Share via


EmbeddingGeneratorBuilder<TInput,TEmbedding>.Use Method

Definition

Overloads

Use(IEmbeddingGenerator<TInput,TEmbedding>)

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

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.

public:
 Microsoft::Extensions::AI::IEmbeddingGenerator<TInput, TEmbedding> ^ Use(Microsoft::Extensions::AI::IEmbeddingGenerator<TInput, TEmbedding> ^ innerGenerator);
public Microsoft.Extensions.AI.IEmbeddingGenerator<TInput,TEmbedding> Use (Microsoft.Extensions.AI.IEmbeddingGenerator<TInput,TEmbedding> innerGenerator);
member this.Use : Microsoft.Extensions.AI.IEmbeddingGenerator<'Input, 'Embedding (requires 'Embedding :> Microsoft.Extensions.AI.Embedding)> -> Microsoft.Extensions.AI.IEmbeddingGenerator<'Input, 'Embedding (requires 'Embedding :> Microsoft.Extensions.AI.Embedding)>
Public Function Use (innerGenerator As IEmbeddingGenerator(Of TInput, TEmbedding)) As IEmbeddingGenerator(Of TInput, TEmbedding)

Parameters

innerGenerator
IEmbeddingGenerator<TInput,TEmbedding>

The inner generator to use.

Returns

An instance of IEmbeddingGenerator<TInput,TEmbedding>.

Remarks

If there are any factories registered with this builder, innerGenerator is used as a seed to the last factory, and the result of each factory delegate is passed to the previously registered factory. The final result is then returned from this call.

Applies to

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

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

public:
 Microsoft::Extensions::AI::EmbeddingGeneratorBuilder<TInput, TEmbedding> ^ Use(Func<Microsoft::Extensions::AI::IEmbeddingGenerator<TInput, TEmbedding> ^, Microsoft::Extensions::AI::IEmbeddingGenerator<TInput, TEmbedding> ^> ^ generatorFactory);
public Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<TInput,TEmbedding> Use (Func<Microsoft.Extensions.AI.IEmbeddingGenerator<TInput,TEmbedding>,Microsoft.Extensions.AI.IEmbeddingGenerator<TInput,TEmbedding>> generatorFactory);
member this.Use : Func<Microsoft.Extensions.AI.IEmbeddingGenerator<'Input, 'Embedding>, Microsoft.Extensions.AI.IEmbeddingGenerator<'Input, 'Embedding>> -> Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<'Input, 'Embedding (requires 'Embedding :> Microsoft.Extensions.AI.Embedding)>
Public Function Use (generatorFactory As Func(Of IEmbeddingGenerator(Of TInput, TEmbedding), IEmbeddingGenerator(Of TInput, TEmbedding))) As EmbeddingGeneratorBuilder(Of TInput, TEmbedding)

Parameters

generatorFactory
Func<IEmbeddingGenerator<TInput,TEmbedding>,IEmbeddingGenerator<TInput,TEmbedding>>

The generator factory function.

Returns

The updated EmbeddingGeneratorBuilder<TInput,TEmbedding> instance.

Applies to

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

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

public:
 Microsoft::Extensions::AI::EmbeddingGeneratorBuilder<TInput, TEmbedding> ^ Use(Func<IServiceProvider ^, Microsoft::Extensions::AI::IEmbeddingGenerator<TInput, TEmbedding> ^, Microsoft::Extensions::AI::IEmbeddingGenerator<TInput, TEmbedding> ^> ^ generatorFactory);
public Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<TInput,TEmbedding> Use (Func<IServiceProvider,Microsoft.Extensions.AI.IEmbeddingGenerator<TInput,TEmbedding>,Microsoft.Extensions.AI.IEmbeddingGenerator<TInput,TEmbedding>> generatorFactory);
member this.Use : Func<IServiceProvider, Microsoft.Extensions.AI.IEmbeddingGenerator<'Input, 'Embedding>, Microsoft.Extensions.AI.IEmbeddingGenerator<'Input, 'Embedding>> -> Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<'Input, 'Embedding (requires 'Embedding :> Microsoft.Extensions.AI.Embedding)>
Public Function Use (generatorFactory As Func(Of IServiceProvider, IEmbeddingGenerator(Of TInput, TEmbedding), IEmbeddingGenerator(Of TInput, TEmbedding))) As EmbeddingGeneratorBuilder(Of TInput, TEmbedding)

Parameters

generatorFactory
Func<IServiceProvider,IEmbeddingGenerator<TInput,TEmbedding>,IEmbeddingGenerator<TInput,TEmbedding>>

The generator factory function.

Returns

The updated EmbeddingGeneratorBuilder<TInput,TEmbedding> instance.

Applies to