Skip to content

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

Fix: Optimize edge check & incorrect parameter usage (#11396)

Billy Baod2b1da0e266d
diff --git a/sdk/python/ragflow_sdk/modules/document.py b/sdk/python/ragflow_sdk/modules/document.py
index 70c1ac842c..c966980794 100644
--- a/sdk/python/ragflow_sdk/modules/document.py
+++ b/sdk/python/ragflow_sdk/modules/document.py
@@ -69,7 +69,7 @@ class Document(Base):
response = res.json()
actual_keys = set(response.keys())
if actual_keys == error_keys:
- raise Exception(res.get("message"))
+ raise Exception(response.get("message"))
else:
return res.content
except json.JSONDecodeError:
diff --git a/sdk/python/ragflow_sdk/modules/session.py b/sdk/python/ragflow_sdk/modules/session.py
index 12141afed3..d2bbc76e83 100644
--- a/sdk/python/ragflow_sdk/modules/session.py
+++ b/sdk/python/ragflow_sdk/modules/session.py
@@ -80,6 +80,7 @@ class Session(Base):
def _structure_answer(self, json_data):
+ answer = ""
if self.__session_type == "agent":
answer = json_data["data"]["content"]
elif self.__session_type == "chat":