Dela via


ChatResponseUpdateExtensions.ToChatResponse Method

Definition

Combines ChatResponseUpdate instances into a single ChatResponse.

public static Microsoft.Extensions.AI.ChatResponse ToChatResponse(this System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatResponseUpdate> updates, bool coalesceContent = true);
static member ToChatResponse : seq<Microsoft.Extensions.AI.ChatResponseUpdate> * bool -> Microsoft.Extensions.AI.ChatResponse
<Extension()>
Public Function ToChatResponse (updates As IEnumerable(Of ChatResponseUpdate), Optional coalesceContent As Boolean = true) As ChatResponse

Parameters

updates
IEnumerable<ChatResponseUpdate>

The updates to be combined.

coalesceContent
Boolean

true to attempt to coalesce contiguous AIContent items, where applicable, into a single AIContent, in order to reduce the number of individual content items that are included in the manufactured ChatMessage instances. When false, the original content items are used. The default is true.

Returns

The combined ChatResponse.

Applies to