ImageGeneratorExtensions.GenerateImagesAsync Metodo

Definizione

Genera immagini in base a una richiesta di testo.

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse> GenerateImagesAsync(this Microsoft.Extensions.AI.IImageGenerator generator, string prompt, Microsoft.Extensions.AI.ImageGenerationOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member GenerateImagesAsync : Microsoft.Extensions.AI.IImageGenerator * string * Microsoft.Extensions.AI.ImageGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ImageGenerationResponse>
<Extension()>
Public Function GenerateImagesAsync (generator As IImageGenerator, prompt As String, Optional options As ImageGenerationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ImageGenerationResponse)

Parametri

generator
IImageGenerator

Generatore di immagini.

prompt
String

Richiesta di guida alla generazione dell'immagine.

options
ImageGenerationOptions

Opzioni di generazione di immagini per configurare la richiesta.

cancellationToken
CancellationToken

Oggetto CancellationToken da monitorare per le richieste di annullamento. Il valore predefinito è None.

Valori restituiti

Immagini generate dal generatore.

Eccezioni

generator o prompt è null.

Si applica a