From 229d68d9ca4597835382b0978f122f004c328898 Mon Sep 17 00:00:00 2001 From: jyong <718720800@qq.com> Date: Thu, 2 Jan 2025 18:34:35 +0800 Subject: [PATCH] add child chunk preview number limit --- .../index_processor/processor/parent_child_index_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/rag/index_processor/processor/parent_child_index_processor.py b/api/core/rag/index_processor/processor/parent_child_index_processor.py index 92447f7ff66b86..31401220818d20 100644 --- a/api/core/rag/index_processor/processor/parent_child_index_processor.py +++ b/api/core/rag/index_processor/processor/parent_child_index_processor.py @@ -83,7 +83,7 @@ def transform(self, documents: list[Document], **kwargs) -> list[Document]: ) if kwargs.get("preview"): if len(child_nodes) > dify_config.CHILD_CHUNKS_PREVIEW_NUMBER: - child_nodes = child_nodes[:dify_config.CHILD_CHUNKS_PREVIEW_NUMBER] + child_nodes = child_nodes[: dify_config.CHILD_CHUNKS_PREVIEW_NUMBER] document.children = child_nodes doc_id = str(uuid.uuid4())