MicrosoftExtensionsAIChatExtensions.AsOpenAIStreamingChatCompletionUpdatesAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从指定的实例序列创建 OpenAI StreamingChatCompletionUpdate 实例序列 ChatResponseUpdate 。
[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)
参数
- responseUpdates
- IAsyncEnumerable<ChatResponseUpdate>
更新实例。
- cancellationToken
- CancellationToken
要 CancellationToken 监视取消请求。 默认值为 None。
返回
已 ChatResponseUpdate 转换的实例序列。
- 属性
例外
responseUpdates 是 null。