Share via


OpenAIClient.GetImageGenerationsAsync Method

Definition

Get a set of generated images influenced by a provided textual prompt.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.ImageGenerations>> GetImageGenerationsAsync (Azure.AI.OpenAI.ImageGenerationOptions imageGenerationOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member GetImageGenerationsAsync : Azure.AI.OpenAI.ImageGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.ImageGenerations>>
override this.GetImageGenerationsAsync : Azure.AI.OpenAI.ImageGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.ImageGenerations>>
Public Overridable Function GetImageGenerationsAsync (imageGenerationOptions As ImageGenerationOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ImageGenerations))

Parameters

imageGenerationOptions
ImageGenerationOptions

The configuration information for the image generation request that controls the content, size, and other details about generated images.

cancellationToken
CancellationToken

An optional cancellation token that may be used to abort an ongoing request.

Returns

The response information for the image generations request.

Exceptions

imageGenerationOptions is null.

imageGenerationOptions.DeploymentName.DeploymentName is null or empty when using Azure OpenAI. Azure OpenAI image generation requires a valid dall-e-3 model deployment.

Applies to