Share via


IChatHistoryReducer.ReduceAsync Method

Definition

Reduces the chat history.

public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.SemanticKernel.ChatMessageContent>?> ReduceAsync(System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> chatHistory, System.Threading.CancellationToken cancellationToken = default);
abstract member ReduceAsync : System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<seq<Microsoft.SemanticKernel.ChatMessageContent>>
Public Function ReduceAsync (chatHistory As IReadOnlyList(Of ChatMessageContent), Optional cancellationToken As CancellationToken = Nothing) As Task(Of IEnumerable(Of ChatMessageContent))

Parameters

chatHistory
IReadOnlyList<ChatMessageContent>

Chat history to be reduced.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

The reduced history or null if no reduction has occurred.

Applies to