From 560365f99fcb2370fce80d095a3fe08720502cf9 Mon Sep 17 00:00:00 2001 From: Ethan-Zhang Date: Thu, 20 Nov 2025 18:34:32 +0800 Subject: [PATCH] Fix: RAGNodeDrawer keep document_ids in null --- .../components/workFlowConfig/RAGNodeDrawer.vue | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/views/createapp/components/workFlowConfig/RAGNodeDrawer.vue b/src/views/createapp/components/workFlowConfig/RAGNodeDrawer.vue index bbdf05c1..d40d044e 100644 --- a/src/views/createapp/components/workFlowConfig/RAGNodeDrawer.vue +++ b/src/views/createapp/components/workFlowConfig/RAGNodeDrawer.vue @@ -289,7 +289,7 @@ description: string; // node description node_type: string; // node type top_k: number; // 返回的分片数 - document_ids: string[]; // 文档id列表 + document_ids: null; // 文档id列表 knowledge_base_ids: string[]; // 知识库id列表(如果需要) search_method: string; // 检索方法 is_related_surrounding: boolean; // 是否关联上下文 @@ -308,7 +308,7 @@ description: '', node_type: NodeType.RAG, top_k: 5, - document_ids: [], + document_ids: null, knowledge_base_ids: [], search_method: '', // 将在 onMounted 中根据用户偏好或节点数据设置 is_related_surrounding: true, @@ -452,9 +452,6 @@ knowledge_base_ids: Array.isArray(input_content.knowledge_base_ids) ? input_content.knowledge_base_ids.filter(id => id && id.trim() !== '') : [], - document_ids: Array.isArray(input_content.document_ids) - ? input_content.document_ids.filter(id => id && id.trim() !== '') - : [], }; Object.assign(ragForm, { @@ -506,9 +503,7 @@ const updateNodeYaml = async (formEl: FormInstance | undefined) => { if (!formEl) return; await formEl.validate((valid, fields) => { if (valid) { - // 过滤掉 knowledge_base_ids 和 document_ids 中的空字符串 const filteredKnowledgeBaseIds = ragForm.knowledge_base_ids.filter(id => id && id.trim() !== ''); - const filteredDocumentIds = ragForm.document_ids.filter(id => id && id.trim() !== ''); // 只提取 input_parameters 相关的字段 const transResult = { @@ -517,7 +512,7 @@ const updateNodeYaml = async (formEl: FormInstance | undefined) => { controlled_output: ragForm.controlled_output, knowledge_base_ids: filteredKnowledgeBaseIds, top_k: ragForm.top_k, - document_ids: filteredDocumentIds, + document_ids: null, search_method: ragForm.search_method, is_related_surrounding: ragForm.is_related_surrounding, is_classify_by_doc: ragForm.is_classify_by_doc, -- Gitee