-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Closed
Feature
Copy link
Labels
.NETagent memoryRelated to agentic memoryRelated to agentic memoryv1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GA
Description
Description
With the new WithMessageFilters method, it is now possible to easily filter messages before they are passed to a Message Store.
However, I noticed that the RequestMessages property in the ChatMessageStore.InvokedContext class is read-only. Because of this, if the collection needs to be modified, a completely new InvokedContext instance must be created.
For example:
.WithMessageFilters(invokedMessagesFilter: context =>
{
var newContext = new ChatMessageStore.InvokedContext(context.RequestMessages
.Where(x => !(x.AdditionalProperties?.TryGetValue("IsPrivate", out bool value) is true && value is true)),
context.ChatMessageStoreMessages)
{
ResponseMessages = context.ResponseMessages,
AIContextProviderMessages = context.AIContextProviderMessages,
InvokeException = context.InvokeException
};
return newContext;
});Would it be possible to make the RequestMessages property writable, or alternatively provide a supported way to modify the request messages without recreating the entire InvokedContext?
Language/SDK
.NET
Metadata
Metadata
Assignees
Labels
.NETagent memoryRelated to agentic memoryRelated to agentic memoryv1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GA
Type
Projects
Status
Done