We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 490f469 commit de39128Copy full SHA for de39128
python/helpers/memory.py
@@ -1,3 +1,4 @@
1
+import ast
2
from datetime import datetime
3
from typing import Any, List, Sequence
4
from langchain.storage import InMemoryByteStore, LocalFileStore
@@ -391,7 +392,7 @@ def _save_db_file(db: MyFaiss, memory_subdir: str):
391
392
def _get_comparator(condition: str):
393
def comparator(data: dict[str, Any]):
394
try:
- return eval(condition, {}, data)
395
+ return ast.literal_eval(condition, {}, data)
396
except Exception as e:
397
# PrintStyle.error(f"Error evaluating condition: {e}")
398
return False
0 commit comments