- 
                Notifications
    
You must be signed in to change notification settings  - Fork 657
 
.NET: Add support for IChatReducer to InMemoryChatMessageStore #462
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds optional IChatReducer support to InMemoryChatMessageStore, allowing message reduction at configurable trigger points.
- Adds IChatReducer interface with ReduceAsync method for message reduction
 - Updates InMemoryChatMessageStore to support optional chat reducer with configurable trigger events
 - Makes InMemoryChatMessageStore public to enable user instantiation with custom reducers
 
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description | 
|---|---|
| IChatReducer.cs | Adds new interface defining chat message reduction capability | 
| InMemoryChatMessageStore.cs | Adds reducer support with trigger events and makes class public | 
| InMemoryChatMessageStoreTests.cs | Adds comprehensive test coverage for new reducer functionality | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
        
          
                ...tests/Microsoft.Extensions.AI.Agents.Abstractions.UnitTests/InMemoryChatMessageStoreTests.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...tests/Microsoft.Extensions.AI.Agents.Abstractions.UnitTests/InMemoryChatMessageStoreTests.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...tests/Microsoft.Extensions.AI.Agents.Abstractions.UnitTests/InMemoryChatMessageStoreTests.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | 
           Have you seen this update: dotnet/extensions#6666 ?  | 
    
        
          
                dotnet/src/Microsoft.Extensions.AI.Agents.Abstractions/MEAI/IChatReducer.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                dotnet/src/Microsoft.Extensions.AI.Agents.Abstractions/InMemoryChatMessageStore.cs
          
            Show resolved
            Hide resolved
        
      | 
           cc: @MackinnonBuck  | 
    
…soft#462) * Add support for IChatReducer to InMemoryChatMessageStore * Fix typos.
Motivation and Context
#295
Sample to follow if we are happy with this approach.
Description
Contribution Checklist