Condividi tramite


MicrosoftExtensionsAIChatExtensions.AsOpenAIStreamingChatCompletionUpdatesAsync Metodo

Definizione

Crea una sequenza di istanze OpenAI StreamingChatCompletionUpdate dalla sequenza di ChatResponseUpdate istanze specificata.

[System.Diagnostics.CodeAnalysis.Experimental("OPENAI001")]
public static System.Collections.Generic.IAsyncEnumerable<OpenAI.Chat.StreamingChatCompletionUpdate> AsOpenAIStreamingChatCompletionUpdatesAsync(this System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> responseUpdates, System.Threading.CancellationToken cancellationToken = default);
public static System.Collections.Generic.IAsyncEnumerable<OpenAI.Chat.StreamingChatCompletionUpdate> AsOpenAIStreamingChatCompletionUpdatesAsync(this System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> responseUpdates, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.Experimental("OPENAI001")>]
static member AsOpenAIStreamingChatCompletionUpdatesAsync : System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<OpenAI.Chat.StreamingChatCompletionUpdate>
static member AsOpenAIStreamingChatCompletionUpdatesAsync : System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<OpenAI.Chat.StreamingChatCompletionUpdate>
<Extension()>
Public Function AsOpenAIStreamingChatCompletionUpdatesAsync (responseUpdates As IAsyncEnumerable(Of ChatResponseUpdate), Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of StreamingChatCompletionUpdate)

Parametri

responseUpdates
IAsyncEnumerable<ChatResponseUpdate>

Istanze di aggiornamento.

cancellationToken
CancellationToken

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

Restituisce

Sequenza di istanze convertite ChatResponseUpdate .

Attributi

Eccezioni

responseUpdates è null.

Si applica a