LoggingEmbeddingGenerator<TInput,TEmbedding> Class

Definition

A delegating embedding generator that logs embedding generation operations to an ILogger.

C#
public class LoggingEmbeddingGenerator<TInput,TEmbedding> : Microsoft.Extensions.AI.DelegatingEmbeddingGenerator<TInput,TEmbedding> where TEmbedding : Embedding

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.

Inheritance
LoggingEmbeddingGenerator<TInput,TEmbedding>

Constructors

Properties

InnerGenerator

Gets the inner IEmbeddingGenerator<TInput,TEmbedding>.

(Inherited from DelegatingEmbeddingGenerator<TInput,TEmbedding>)
JsonSerializerOptions

Gets or sets JSON serialization options to use when serializing logging data.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from DelegatingEmbeddingGenerator<TInput,TEmbedding>)
Dispose(Boolean)

Provides a mechanism for releasing unmanaged resources.

(Inherited from DelegatingEmbeddingGenerator<TInput,TEmbedding>)
GenerateAsync(IEnumerable<TInput>, EmbeddingGenerationOptions, CancellationToken)

Generates embeddings for each of the supplied values.

GetService(Type, Object)

Asks the IEmbeddingGenerator<TInput,TEmbedding> for an object of the specified type serviceType.

(Inherited from DelegatingEmbeddingGenerator<TInput,TEmbedding>)

Extension Methods

Applies to

Produkt Wersje
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)