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

Update combined.py #7541

Merged
merged 3 commits into from
Aug 1, 2023
Merged

Update combined.py #7541

merged 3 commits into from
Aug 1, 2023

Conversation

mzamini92
Copy link
Contributor

from my understanding, the check_repeated_memory_variable validator will raise an error if any of the variables in the memories list are repeated. However, the load_memory_variables method does not check for repeated variables. This means that it is possible for the CombinedMemory instance to return a dictionary of memory variables that contains duplicate values. This code will check for repeated variables in the data dictionary returned by the load_memory_variables method of each sub-memory. If a repeated variable is found, an error will be raised.

from my understanding, the `check_repeated_memory_variable` validator will raise an error if any of the variables in the `memories` list are repeated. However, the `load_memory_variables` method does not check for repeated variables. This means that it is possible for the `CombinedMemory` instance to return a dictionary of memory variables that contains duplicate values. This code will check for repeated variables in the `data` dictionary returned by the `load_memory_variables` method of each sub-memory. If a repeated variable is found, an error will be raised.
@vercel
Copy link

vercel bot commented Jul 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Aug 1, 2023 0:53am

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jul 11, 2023
@baskaryan
Copy link
Collaborator

from my understanding, the check_repeated_memory_variable validator will raise an error if any of the variables in the memories list are repeated. However, the load_memory_variables method does not check for repeated variables. This means that it is possible for the CombinedMemory instance to return a dictionary of memory variables that contains duplicate values. This code will check for repeated variables in the data dictionary returned by the load_memory_variables method of each sub-memory. If a repeated variable is found, an error will be raised.

dictionaries can't contain duplicate keys, so current logic would actually overwrite the stuff in memory_data with data if there was a duplicate. which idk if that's desirable either. thoughts @hwchase17?

@hwchase17 hwchase17 added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Aug 1, 2023
@hwchase17 hwchase17 merged commit 3fbb737 into langchain-ai:master Aug 1, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature lgtm PR looks good. Use to confirm that a PR is ready for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants