Skip to content

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

Fix: Option ineffective in Chat API (#5118)

petertc8525f55ad0e9
diff --git a/api/apps/sdk/session.py b/api/apps/sdk/session.py
index 2e78d4e3a9..f2fd6ab66a 100644
--- a/api/apps/sdk/session.py
+++ b/api/apps/sdk/session.py
@@ -159,8 +159,10 @@ def update(tenant_id, chat_id, session_id):
@token_required
def chat_completion(tenant_id, chat_id):
req = request.json
- if not req or not req.get("session_id"):
+ if not req:
req = {"question": ""}
+ if not req.get("session_id"):
+ req["question"]=""
if not DialogService.query(tenant_id=tenant_id, id=chat_id, status=StatusEnum.VALID.value):
return get_error_data_result(f"You don't own the chat {chat_id}")
if req.get("session_id"):