MicrosoftExtensionsAIResponsesExtensions.AsChatResponseUpdatesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a sequence of Microsoft.Extensions.AI ChatResponseUpdate instances from the specified sequence of OpenAI StreamingResponseUpdate instances.
public static System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> AsChatResponseUpdatesAsync(this System.Collections.Generic.IAsyncEnumerable<OpenAI.Responses.StreamingResponseUpdate> responseUpdates, OpenAI.Responses.ResponseCreationOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member AsChatResponseUpdatesAsync : System.Collections.Generic.IAsyncEnumerable<OpenAI.Responses.StreamingResponseUpdate> * OpenAI.Responses.ResponseCreationOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate>
<Extension()>
Public Function AsChatResponseUpdatesAsync (responseUpdates As IAsyncEnumerable(Of StreamingResponseUpdate), Optional options As ResponseCreationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ChatResponseUpdate)
Parameters
- responseUpdates
- IAsyncEnumerable<StreamingResponseUpdate>
The update instances.
- options
- ResponseCreationOptions
The options employed in the creation of the response.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
A sequence of converted ChatResponseUpdate instances.
Exceptions
responseUpdates is null.