IChatHistoryReducer.ReduceAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.