Skip to content

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

Fix: graphrag, raptor can be null for api created kb issue (#8743)

Can Wang779932dcb0f3
diff --git a/api/db/services/document_service.py b/api/db/services/document_service.py
index ba1098a0d8..a9dfcb438a 100644
--- a/api/db/services/document_service.py
+++ b/api/db/services/document_service.py
@@ -564,10 +564,10 @@ class DocumentService(CommonService):
prg = -1
status = TaskStatus.FAIL.value
elif finished:
- if d["parser_config"].get("raptor", {}).get("use_raptor") and not has_raptor:
+ if (d["parser_config"].get("raptor") or {}).get("use_raptor") and not has_raptor:
queue_raptor_o_graphrag_tasks(d, "raptor", priority)
prg = 0.98 * len(tsks) / (len(tsks) + 1)
- elif d["parser_config"].get("graphrag", {}).get("use_graphrag") and not has_graphrag:
+ elif (d["parser_config"].get("graphrag") or {}).get("use_graphrag") and not has_graphrag:
queue_raptor_o_graphrag_tasks(d, "graphrag", priority)
prg = 0.98 * len(tsks) / (len(tsks) + 1)
else: