ChatResponseExtensions.ToChatResponseAsync メソッド

定義

ChatResponseUpdateインスタンスを 1 つのChatResponseに結合します。

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse> ToChatResponseAsync(this System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> updates, System.Threading.CancellationToken cancellationToken = default);
static member ToChatResponseAsync : System.Collections.Generic.IAsyncEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.ChatResponse>
<Extension()>
Public Function ToChatResponseAsync (updates As IAsyncEnumerable(Of ChatResponseUpdate), Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChatResponse)

パラメーター

updates
IAsyncEnumerable<ChatResponseUpdate>

結合する更新プログラム。

cancellationToken
CancellationToken

キャンセル要求を監視する CancellationToken 。 既定値は None です。

返品

結合された ChatResponse

例外

updatesnullです。

注釈

updatesを 1 つのChatResponseに結合する一環として、メソッドはインスタンスChatMessage再構築しようとします。 これには、 MessageId を使用してメッセージの境界を決定するだけでなく、必要に応じて連続した AIContent 項目を結合することが含まれます。たとえば、行内の複数の TextContent インスタンスを 1 つの TextContentに結合できます。

適用対象