ChatHistoryExtensions.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.
Overloads
ReduceAsync(ChatHistory, IChatHistoryReducer, CancellationToken) |
Returns the reduced history using the provided reducer without mutating the source history. |
ReduceAsync(IReadOnlyList<ChatMessageContent>, IChatHistoryReducer, CancellationToken) |
Returns the reduced history using the provided reducer without mutating the source history. |
ReduceAsync(ChatHistory, IChatHistoryReducer, CancellationToken)
Returns the reduced history using the provided reducer without mutating the source history.
public static System.Threading.Tasks.Task<Microsoft.SemanticKernel.ChatCompletion.ChatHistory> ReduceAsync(this Microsoft.SemanticKernel.ChatCompletion.ChatHistory chatHistory, Microsoft.SemanticKernel.ChatCompletion.IChatHistoryReducer? reducer, System.Threading.CancellationToken cancellationToken);
static member ReduceAsync : Microsoft.SemanticKernel.ChatCompletion.ChatHistory * Microsoft.SemanticKernel.ChatCompletion.IChatHistoryReducer * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.ChatCompletion.ChatHistory>
<Extension()>
Public Function ReduceAsync (chatHistory As ChatHistory, reducer As IChatHistoryReducer, cancellationToken As CancellationToken) As Task(Of ChatHistory)
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
Applies to
ReduceAsync(IReadOnlyList<ChatMessageContent>, IChatHistoryReducer, CancellationToken)
Returns the reduced history using the provided reducer without mutating the source history.
public static System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent>> ReduceAsync(this System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> chatHistory, Microsoft.SemanticKernel.ChatCompletion.IChatHistoryReducer? reducer, System.Threading.CancellationToken cancellationToken);
static member ReduceAsync : System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> * Microsoft.SemanticKernel.ChatCompletion.IChatHistoryReducer * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent>>
<Extension()>
Public Function ReduceAsync (chatHistory As IReadOnlyList(Of ChatMessageContent), reducer As IChatHistoryReducer, cancellationToken As CancellationToken) As Task(Of IReadOnlyList(Of ChatMessageContent))
Parameters
- chatHistory
- IReadOnlyList<ChatMessageContent>
The source history
- reducer
- IChatHistoryReducer
The target reducer
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.