Partager via


LoggingEmbeddingGeneratorBuilderExtensions.UseLogging<TInput,TEmbedding> Method

Definition

Adds logging to the embedding generator pipeline.

public static Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<TInput,TEmbedding> UseLogging<TInput,TEmbedding> (this Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<TInput,TEmbedding> builder, Microsoft.Extensions.Logging.ILogger? logger = default, Action<Microsoft.Extensions.AI.LoggingEmbeddingGenerator<TInput,TEmbedding>>? configure = default) where TEmbedding : Microsoft.Extensions.AI.Embedding;
static member UseLogging : Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<'Input, 'Embedding (requires 'Embedding :> Microsoft.Extensions.AI.Embedding)> * Microsoft.Extensions.Logging.ILogger * Action<Microsoft.Extensions.AI.LoggingEmbeddingGenerator<'Input, 'Embedding>> -> Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<'Input, 'Embedding (requires 'Embedding :> Microsoft.Extensions.AI.Embedding)> (requires 'Embedding :> Microsoft.Extensions.AI.Embedding)
<Extension()>
Public Function UseLogging(Of TInput, TEmbedding) (builder As EmbeddingGeneratorBuilder(Of TInput, TEmbedding), Optional logger As ILogger = Nothing, Optional configure As Action(Of LoggingEmbeddingGenerator(Of TInput, TEmbedding)) = Nothing) As EmbeddingGeneratorBuilder(Of TInput, TEmbedding)

Type Parameters

TInput

Specifies the type of the input passed to the generator.

TEmbedding

Specifies the type of the embedding instance produced by the generator.

Parameters

logger
ILogger

An optional ILogger with which logging should be performed. If not supplied, an instance will be resolved from the service provider.

configure
Action<LoggingEmbeddingGenerator<TInput,TEmbedding>>

An optional callback that can be used to configure the LoggingEmbeddingGenerator<TInput,TEmbedding> instance.

Returns

The builder.

Applies to