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.

fix: create child chunk (#18209)

devxinge912928ccef2
diff --git a/api/services/dataset_service.py b/api/services/dataset_service.py
index b08d70489a4..44d2594ee85 100644
--- a/api/services/dataset_service.py
+++ b/api/services/dataset_service.py
@@ -2025,7 +2025,7 @@ class SegmentService:
dataset_id=dataset.id,
document_id=document.id,
segment_id=segment.id,
- position=max_position + 1,
+ position=max_position + 1 if max_position else 1,
index_node_id=index_node_id,
index_node_hash=index_node_hash,
content=content,