Skip to content

Commit 738aaee

Browse files
rouxiaominliumin
andauthored
fix(api):Fix the issue of empty and not empty operations failing in k… (langgenius#24276)
Co-authored-by: liumin <[email protected]>
1 parent 5867e63 commit 738aaee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/core/rag/retrieval/dataset_retrieval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def _automatic_metadata_filter_func(
10121012
def _process_metadata_filter_func(
10131013
self, sequence: int, condition: str, metadata_name: str, value: Optional[Any], filters: list
10141014
):
1015-
if value is None:
1015+
if value is None and condition not in ("empty", "not empty"):
10161016
return
10171017

10181018
key = f"{metadata_name}_{sequence}"

api/core/workflow/nodes/knowledge_retrieval/knowledge_retrieval_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def _automatic_metadata_filter_func(
572572
def _process_metadata_filter_func(
573573
self, sequence: int, condition: str, metadata_name: str, value: Optional[Any], filters: list
574574
):
575-
if value is None:
575+
if value is None and condition not in ("empty", "not empty"):
576576
return
577577

578578
key = f"{metadata_name}_{sequence}"

0 commit comments

Comments
 (0)