LoggingImageGenerator 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 image generator that logs image generation operations to an ILogger.
public ref class LoggingImageGenerator : Microsoft::Extensions::AI::DelegatingImageGenerator
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001")]
public class LoggingImageGenerator : Microsoft.Extensions.AI.DelegatingImageGenerator
public class LoggingImageGenerator : Microsoft.Extensions.AI.DelegatingImageGenerator
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001")>]
type LoggingImageGenerator = class
inherit DelegatingImageGenerator
type LoggingImageGenerator = class
inherit DelegatingImageGenerator
Public Class LoggingImageGenerator
Inherits DelegatingImageGenerator
- Inheritance
- Attributes
Remarks
The provided implementation of IImageGenerator 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 prompts and options are logged. These prompts and options may contain sensitive application data. Trace is disabled by default and should never be enabled in a production environment. Prompts and options are not logged at other logging levels.
Constructors
LoggingImageGenerator(IImageGenerator, ILogger) |
Initializes a new instance of the LoggingImageGenerator class. |
Properties
InnerGenerator |
Gets the inner IImageGenerator. (Inherited from DelegatingImageGenerator) |
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 DelegatingImageGenerator) |
Dispose(Boolean) |
Provides a mechanism for releasing unmanaged resources. (Inherited from DelegatingImageGenerator) |
GenerateAsync(ImageGenerationRequest, ImageGenerationOptions, CancellationToken) |
Sends an image generation request and returns the generated image as a ImageGenerationResponse. |
GetService(Type, Object) |
Asks the IImageGenerator for an object of the specified type |