Delen via


StreamingChatCompletionUpdateExtensions.ToChatCompletion Method

Definition

Combines StreamingChatCompletionUpdate instances into a single ChatCompletion.

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

Parameters

updates
IEnumerable<StreamingChatCompletionUpdate>

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 ChatCompletion.

Applies to