Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: loopitem None issue. (#12166)

Kevin Huf0dac1d90ed8
diff --git a/agent/component/loopitem.py b/agent/component/loopitem.py
index 71b91c810c..b656ea7894 100644
--- a/agent/component/loopitem.py
+++ b/agent/component/loopitem.py
@@ -113,6 +113,10 @@ class LoopItem(ComponentBase, ABC):
return len(var) == 0
elif operator == "not empty":
return len(var) > 0
+ elif var is None:
+ if operator == "empty":
+ return True
+ return False
raise Exception(f"Invalid operator: {operator}")
diff --git a/api/db/services/document_service.py b/api/db/services/document_service.py
index b096e7c8b4..8a9d363617 100644
--- a/api/db/services/document_service.py
+++ b/api/db/services/document_service.py
@@ -701,6 +701,8 @@ class DocumentService(CommonService):
v = [v]
for vv in v:
if vv not in meta[k]:
+ if isinstance(vv, list) or isinstance(vv, dict):
+ continue
meta[k][vv] = []
meta[k][vv].append(doc_id)
return meta
diff --git a/deepdoc/parser/pdf_parser.py b/deepdoc/parser/pdf_parser.py
index 539cd007d1..b704d25eae 100644
--- a/deepdoc/parser/pdf_parser.py
+++ b/deepdoc/parser/pdf_parser.py
@@ -1447,6 +1447,7 @@ class VisionParser(RAGFlowPdfParser):
def __init__(self, vision_model, *args, **kwargs):
super().__init__(*args, **kwargs)
self.vision_model = vision_model
+ self.outlines = []
def __images__(self, fnm, zoomin=3, page_from=0, page_to=299, callback=None):
try: