MicrosoftExtensionsAIChatExtensions.AsOpenAIStreamingChatCompletionUpdatesAsync Methode

Definitie

Hiermee maakt u een reeks OpenAI-exemplaren StreamingChatCompletionUpdate op basis van de opgegeven reeks ChatResponseUpdate exemplaren.

[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)

Parameters

responseUpdates
IAsyncEnumerable<ChatResponseUpdate>

De update-exemplaren.

cancellationToken
CancellationToken

De CancellationToken te controleren op annuleringsaanvragen. De standaardwaarde is None.

Retouren

Een reeks geconverteerde ChatResponseUpdate exemplaren.

Kenmerken

Uitzonderingen

responseUpdates is null.

Van toepassing op