Skip to content

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

Fix: rm think if stream is Flase. (#5458)

Kevin Hu5fdfb8d46582
diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py
index 3cf599af6c..78f18f7780 100644
--- a/api/db/services/dialog_service.py
+++ b/api/db/services/dialog_service.py
@@ -194,7 +194,7 @@ def chat(dialog, messages, stream=True, **kwargs):
if isinstance(think, str):
thought = think
knowledges = [t for t in think.split("\n") if t]
- else:
+ elif stream:
yield think
else:
kbinfos = retriever.retrieval(" ".join(questions), embd_mdl, tenant_ids, dialog.kb_ids, 1, dialog.top_n,