Share via


OpenTelemetryImageGenerator.GenerateAsync Method

Definition

Sends an image generation request and returns the generated image as a ImageGenerationResponse.

public override System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse> GenerateAsync(Microsoft.Extensions.AI.ImageGenerationRequest request, Microsoft.Extensions.AI.ImageGenerationOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
override this.GenerateAsync : Microsoft.Extensions.AI.ImageGenerationRequest * Microsoft.Extensions.AI.ImageGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse>
Public Overrides Function GenerateAsync (request As ImageGenerationRequest, Optional options As ImageGenerationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ImageGenerationResponse)

Parameters

request
ImageGenerationRequest

The image generation request containing the prompt and optional original images for editing.

options
ImageGenerationOptions

The image generation options to configure the request.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

The images generated by the ImageGenerationRequest.

Applies to