Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Python Agents: ChatHistoryReducer #7969

Open
crickman opened this issue Aug 7, 2024 · 3 comments
Open

.Net: Python Agents: ChatHistoryReducer #7969

crickman opened this issue Aug 7, 2024 · 3 comments
Assignees
Labels
agents enhancement experimental Associated with an experimental feature .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)

Comments

@crickman
Copy link
Contributor

crickman commented Aug 7, 2024

Replicate reducer feature implemented for .NET here: #7570

public interface IChatHistoryReducer
{
    /// <summary>
    /// Each reducer shall override equality evaluation so that different reducers
    /// of the same configuration can be evaluated for equivalency.
    /// </summary>
    bool Equals(object? obj);

    /// <summary>
    /// Each reducer shall implement custom hash-code generation so that different reducers
    /// of the same configuration can be evaluated for equivalency.
    /// </summary>
    int GetHashCode();

    /// <summary>
    /// Optionally reduces the chat history.
    /// </summary>
    /// <param name="history">The source history (which may have been previously reduced)</param>
    /// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
    /// <returns>The reduced history, or 'null' if no reduction has occurred</returns>
    Task<IEnumerable<ChatMessageContent>?> ReduceAsync(IReadOnlyList<ChatMessageContent> history, CancellationToken cancellationToken = default);
}

With implementations:

  1. ChatHistoryTruncationReducer
  2. ChatHistorySummarizationReducer

Utilize within ChatHistoryChannel with utility extension for "no-chat" case

Note: May want to give the .NET feature a couple weeks bake time (for customer feedback)

@crickman crickman added agents enhancement experimental Associated with an experimental feature python Pull requests for the Python Semantic Kernel triage labels Aug 7, 2024
@markwallace-microsoft markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Aug 7, 2024
@github-actions github-actions bot changed the title Python Agents: ChatHistoryReducer .Net: Python Agents: ChatHistoryReducer Aug 7, 2024
@crickman crickman removed the .NET Issue or Pull requests regarding .NET code label Aug 7, 2024
@crickman crickman moved this to Backlog: Planned in Semantic Kernel Aug 7, 2024
@crickman crickman changed the title .Net: Python Agents: ChatHistoryReducer Python Agents: ChatHistoryReducer Aug 7, 2024
@crickman crickman removed the triage label Aug 7, 2024
@evchaki evchaki added the sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) label Aug 22, 2024
Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale Issue is stale because it has been open for 90 days with no activity label Nov 21, 2024
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@moonbox3
Copy link
Contributor

Not complete yet. Re-opening.

@moonbox3 moonbox3 reopened this Dec 14, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Dec 14, 2024
@github-actions github-actions bot changed the title Python Agents: ChatHistoryReducer .Net: Python Agents: ChatHistoryReducer Dec 14, 2024
@github-actions github-actions bot removed the stale Issue is stale because it has been open for 90 days with no activity label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents enhancement experimental Associated with an experimental feature .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)
Projects
Status: Backlog: Planned
Development

No branches or pull requests

5 participants
@moonbox3 @evchaki @crickman @markwallace-microsoft and others