Share via


OpenTelemetryImageGenerator Class

Definition

Represents a delegating image generator that implements the OpenTelemetry Semantic Conventions for Generative AI systems.

public ref class OpenTelemetryImageGenerator sealed : Microsoft::Extensions::AI::DelegatingImageGenerator
[System.Diagnostics.CodeAnalysis.Experimental("MEAI001")]
public sealed class OpenTelemetryImageGenerator : Microsoft.Extensions.AI.DelegatingImageGenerator
public sealed class OpenTelemetryImageGenerator : Microsoft.Extensions.AI.DelegatingImageGenerator
[<System.Diagnostics.CodeAnalysis.Experimental("MEAI001")>]
type OpenTelemetryImageGenerator = class
    inherit DelegatingImageGenerator
type OpenTelemetryImageGenerator = class
    inherit DelegatingImageGenerator
Public NotInheritable Class OpenTelemetryImageGenerator
Inherits DelegatingImageGenerator
Inheritance
OpenTelemetryImageGenerator
Attributes

Remarks

This class provides an implementation of the Semantic Conventions for Generative AI systems v1.37, defined at https://opentelemetry.io/docs/specs/semconv/gen-ai/. The specification is still experimental and subject to change; as such, the telemetry output by this client is also subject to change.

Constructors

OpenTelemetryImageGenerator(IImageGenerator, ILogger, String)

Initializes a new instance of the OpenTelemetryImageGenerator class.

Properties

EnableSensitiveData

Gets or sets a value indicating whether potentially sensitive information should be included in telemetry.

InnerGenerator

Gets the inner IImageGenerator.

(Inherited from DelegatingImageGenerator)

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 serviceType.

Extension Methods

AsBuilder(IImageGenerator)

Creates a new ImageGeneratorBuilder using innerGenerator as its inner generator.

EditImageAsync(IImageGenerator, DataContent, String, ImageGenerationOptions, CancellationToken)

Edits a single image based on the original image and the specified prompt.

EditImageAsync(IImageGenerator, ReadOnlyMemory<Byte>, String, String, ImageGenerationOptions, CancellationToken)

Edits a single image based on a byte array and the specified prompt.

EditImagesAsync(IImageGenerator, IEnumerable<AIContent>, String, ImageGenerationOptions, CancellationToken)

Edits images based on original images and a text prompt.

GenerateImagesAsync(IImageGenerator, String, ImageGenerationOptions, CancellationToken)

Generates images based on a text prompt.

GetRequiredService(IImageGenerator, Type, Object)

Asks the IImageGenerator for an object of the specified type serviceType and throws an exception if one isn't available.

GetRequiredService<TService>(IImageGenerator, Object)

Asks the IImageGenerator for an object of type TService and throws an exception if one isn't available.

GetService<TService>(IImageGenerator, Object)

Asks the IImageGenerator for an object of type TService.

Applies to