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.ILoggerFactory? loggerFactory = 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.ILoggerFactory * 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 loggerFactory As ILoggerFactory = 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

loggerFactory
ILoggerFactory

An optional ILoggerFactory used to create a logger with which logging should be performed. If not supplied, a required 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