Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

update document segment (#950)

Jyong5623839c710b
diff --git a/api/core/docstore/dataset_docstore.py b/api/core/docstore/dataset_docstore.py
index 24dc6194e2e..ca5f172ece0 100644
--- a/api/core/docstore/dataset_docstore.py
+++ b/api/core/docstore/dataset_docstore.py
@@ -103,6 +103,7 @@ class DatesetDocumentStore:
content=doc.page_content,
word_count=len(doc.page_content),
tokens=tokens,
+ enabled=False,
created_by=self._user_id,
)
if 'answer' in doc.metadata and doc.metadata['answer']:
diff --git a/api/core/indexing_runner.py b/api/core/indexing_runner.py
index ef6e9001c7d..98248874e2a 100644
--- a/api/core/indexing_runner.py
+++ b/api/core/indexing_runner.py
@@ -691,6 +691,7 @@ class IndexingRunner:
DocumentSegment.status == "indexing"
).update({
DocumentSegment.status: "completed",
+ DocumentSegment.enabled: True,
DocumentSegment.completed_at: datetime.datetime.utcnow()
})