feat(memory): Add explicit GetMemoryKey method to token and window buffer memory types#1471
Open
mahanadh wants to merge 1 commit into
Open
feat(memory): Add explicit GetMemoryKey method to token and window buffer memory types#1471mahanadh wants to merge 1 commit into
mahanadh wants to merge 1 commit into
Conversation
…ffer and ConversationWindowBuffer Add explicit GetMemoryKey wrapper methods for API consistency with other Memory interface methods. While Go's struct embedding would forward these calls, having explicit methods improves documentation, IDE support, and maintains consistency with other explicitly wrapped methods like Clear, MemoryVariables, LoadMemoryVariables, and SaveContext. Also adds unit tests to verify the GetMemoryKey behavior with both default and custom memory keys.
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.
Description
This PR adds explicit
GetMemoryKeymethod implementations toConversationTokenBufferandConversationWindowBuffertypes in the memory package.Motivation
Both
ConversationTokenBufferandConversationWindowBufferembedConversationBufferand implement theschema.Memoryinterface. While Go's struct embedding forwards method calls to the embedded type, all other Memory interface methods (MemoryVariables,LoadMemoryVariables,SaveContext,Clear) are explicitly implemented with proper documentation comments - exceptGetMemoryKey.This inconsistency can lead to:
Changes
GetMemoryKeymethod toConversationTokenBufferinmemory/token_buffer.goGetMemoryKeymethod toConversationWindowBufferinmemory/window_buffer.goTesting
Added unit tests that verify:
WithMemoryKeyoption are returned correctlyType of Change