Skip to content

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

Optimize conversation when uploading attachments (#4964)

kuschzzp88daa349f930
diff --git a/api/db/services/dialog_service.py b/api/db/services/dialog_service.py
index 0c60d5a83b..d9103baece 100644
--- a/api/db/services/dialog_service.py
+++ b/api/db/services/dialog_service.py
@@ -204,9 +204,6 @@ def chat(dialog, messages, stream=True, **kwargs):
attachments = kwargs["doc_ids"].split(",") if "doc_ids" in kwargs else None
if "doc_ids" in messages[-1]:
attachments = messages[-1]["doc_ids"]
- for m in messages[:-1]:
- if "doc_ids" in m:
- attachments.extend(m["doc_ids"])
create_retriever_ts = timer()