.NET: Replace inline string literals with constants in ChatHistoryMemoryProvider#4096
Open
westey-m wants to merge 2 commits intomicrosoft:mainfrom
Open
.NET: Replace inline string literals with constants in ChatHistoryMemoryProvider#4096westey-m wants to merge 2 commits intomicrosoft:mainfrom
westey-m wants to merge 2 commits intomicrosoft:mainfrom
Conversation
…vider Extract 11 private const string fields for vector store property names (Key, Role, MessageId, AuthorName, ApplicationId, AgentId, UserId, SessionId, Content, CreatedAt, ContentEmbedding) and replace all inline usages across the collection definition, store dictionary, search result access, and filter expressions. Fixes microsoft#3801 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses issue #3801 by refactoring the ChatHistoryMemoryProvider class to eliminate inline string literals in favor of named constants for field names. The changes improve code maintainability by centralizing field name definitions and reducing the risk of typos.
Changes:
- Added 11 private const string fields for vector store property names
- Replaced all inline string literal usages with the corresponding constants across the class
- Updated collection definition, storage dictionary, search result access, and filter expressions
lokitoth
approved these changes
Feb 19, 2026
peibekwe
approved these changes
Feb 19, 2026
rogerbarreto
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract 11
private const stringfields for vector store property names inChatHistoryMemoryProviderand replace all inline string literal usages.Constants added
KeyField,RoleField,MessageIdField,AuthorNameField,ApplicationIdField,AgentIdField,UserIdField,SessionIdField,ContentField,CreatedAtField,ContentEmbeddingFieldLocations updated
VectorStoreCollectionDefinition)StoreAIContextAsyncSearchTextAsyncSearchChatHistoryAsyncNo public API changes. All existing tests pass.
Fixes #3801