ChatHistoryExtensions.ReduceInPlaceAsync 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.
Process history reduction and mutate the provided history in place.
public static System.Threading.Tasks.Task<bool> ReduceInPlaceAsync(this Microsoft.SemanticKernel.ChatCompletion.ChatHistory chatHistory, Microsoft.SemanticKernel.ChatCompletion.IChatHistoryReducer? reducer, System.Threading.CancellationToken cancellationToken);
static member ReduceInPlaceAsync : Microsoft.SemanticKernel.ChatCompletion.ChatHistory * Microsoft.SemanticKernel.ChatCompletion.IChatHistoryReducer * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
<Extension()>
Public Function ReduceInPlaceAsync (chatHistory As ChatHistory, reducer As IChatHistoryReducer, cancellationToken As CancellationToken) As Task(Of Boolean)
Parameters
- chatHistory
- ChatHistory
The source history
- reducer
- IChatHistoryReducer
The target reducer
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
True if reduction has occurred.
Remarks
Using the existing ChatHistory for a reduction in collection size eliminates the need for re-allocation (of memory).