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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
add child chunk preview number limit (#12309)
Jyongb873e6349cb4
diff --git a/api/configs/feature/__init__.py b/api/configs/feature/__init__.pyindex e11993ddc7a..1550de0fd24 100644--- a/api/configs/feature/__init__.py+++ b/api/configs/feature/__init__.py@@ -667,6 +667,11 @@ class IndexingConfig(BaseSettings):default=4000,)+ CHILD_CHUNKS_PREVIEW_NUMBER: PositiveInt = Field(+ description="Maximum number of child chunks to preview",+ default=50,+ )+class MultiModalTransferConfig(BaseSettings):MULTIMODAL_SEND_FORMAT: Literal["base64", "url"] = Field(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.pyindex e8423e2b777..31401220818 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@@ -3,6 +3,7 @@import uuidfrom typing import Optional+from configs import dify_configfrom core.model_manager import ModelInstancefrom core.rag.cleaner.clean_processor import CleanProcessorfrom core.rag.datasource.retrieval_service import RetrievalService@@ -80,6 +81,10 @@ class ParentChildIndexProcessor(BaseIndexProcessor):child_nodes = self._split_child_nodes(document, rules, process_rule.get("mode"), kwargs.get("embedding_model_instance"))+ if kwargs.get("preview"):+ if len(child_nodes) > dify_config.CHILD_CHUNKS_PREVIEW_NUMBER:+ child_nodes = child_nodes[: dify_config.CHILD_CHUNKS_PREVIEW_NUMBER]+document.children = child_nodesdoc_id = str(uuid.uuid4())hash = helper.generate_text_hash(document.page_content)