langchain
langchain copied to clipboard
Update combined.py
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.
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 |
from my understanding, the
check_repeated_memory_variable
validator will raise an error if any of the variables in thememories
list are repeated. However, theload_memory_variables
method does not check for repeated variables. This means that it is possible for theCombinedMemory
instance to return a dictionary of memory variables that contains duplicate values. This code will check for repeated variables in thedata
dictionary returned by theload_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?