LoggingEmbeddingGenerator<TInput,TEmbedding> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A delegating embedding generator that logs embedding generation operations to an ILogger.
generic <typename TInput, typename TEmbedding>
where TEmbedding : Embeddingpublic ref class LoggingEmbeddingGenerator : Microsoft::Extensions::AI::DelegatingEmbeddingGenerator<TInput, TEmbedding>
public class LoggingEmbeddingGenerator<TInput,TEmbedding> : Microsoft.Extensions.AI.DelegatingEmbeddingGenerator<TInput,TEmbedding> where TEmbedding : Embedding
type LoggingEmbeddingGenerator<'Input, 'Embedding (requires 'Embedding :> Embedding)> = class
inherit DelegatingEmbeddingGenerator<'Input, 'Embedding (requires 'Embedding :> Embedding)>
Public Class LoggingEmbeddingGenerator(Of TInput, TEmbedding)
Inherits DelegatingEmbeddingGenerator(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.
- Inheritance
Remarks
The provided implementation of IEmbeddingGenerator<TInput,TEmbedding> is thread-safe for concurrent use so long as the ILogger employed is also thread-safe for concurrent use.
When the employed ILogger enables Trace, the contents of values and options are logged. These values and options may contain sensitive application data. Trace is disabled by default and should never be enabled in a production environment. Messages and options are not logged at other logging levels.
Constructors
LoggingEmbeddingGenerator<TInput,TEmbedding>(IEmbeddingGenerator<TInput,TEmbedding>, ILogger) |
Initializes a new instance of the LoggingEmbeddingGenerator<TInput,TEmbedding> class. |
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 |
GetService(Type, Object) |
Asks the IEmbeddingGenerator<TInput,TEmbedding> for an object of the specified type |