Skip to content

Commit

Permalink
Renamed TryReduceAsync to ReduceAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro Hanea committed Sep 18, 2024
1 parent 53ab30b commit 14db801
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ private static ChatHistory CreateNewChat(string? text = null, OpenAIPromptExecut

private static async Task<IList<ChatMessage>> CreateChatCompletionMessagesAsync(OpenAIPromptExecutionSettings executionSettings, ChatHistory chatHistory, Kernel? kernel, CancellationToken cancellationToken)
{
var sourceMessages = await chatHistory.TryReduceAsync(kernel, cancellationToken).ConfigureAwait(false);
var sourceMessages = await chatHistory.ReduceAsync(kernel, cancellationToken).ConfigureAwait(false);

List<ChatMessage> messages = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.SemanticKernel.AI.ChatCompletion;
public static class ChatHistoryReducerExtensions
{
/// <summary>
/// Try to reduce the chat history before sending it to the chat completion provider.
/// Reduces the chat history before sending it to the chat completion provider.
/// </summary>
/// <remarks>
/// If there is no <see cref="IChatHistoryReducer"/> registered in the <see cref="Kernel"/>, the original chat history will be returned.
Expand All @@ -25,7 +25,7 @@ public static class ChatHistoryReducerExtensions
/// <param name="kernel">The <see cref="Kernel"/> containing services, plugins, and other state for use throughout the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to cancel this operation.</param>
/// <returns>The reduced chat history if the kernel had one reducer configured, or the same <see cref="ChatHistory"/> if it cannot be reduced.</returns>
public static async Task<IEnumerable<ChatMessageContent>> TryReduceAsync(this ChatHistory chatHistory, Kernel? kernel, CancellationToken cancellationToken)
public static async Task<IEnumerable<ChatMessageContent>> ReduceAsync(this ChatHistory chatHistory, Kernel? kernel, CancellationToken cancellationToken)
{
if (kernel is null)
{
Expand Down

0 comments on commit 14db801

Please sign in to comment.