From c07fd60e8b11bb130354fb0978ffad8a9db467c6 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Sun, 16 Nov 2025 23:35:54 +0800 Subject: [PATCH] feat: Update FAQ configuration defaults and localization for improved clarity - Changed default FAQ configuration to use 'question_only' index mode and 'separate' question index mode for better performance. - Updated localization strings in Chinese for consistency and clarity, including terminology adjustments for indexing methods. --- frontend/src/i18n/locales/zh-CN.ts | 4 ++-- .../knowledge/KnowledgeBaseEditorModal.vue | 20 +++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index d1df67ce..01a88ccf 100644 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -1040,12 +1040,12 @@ export default { indexModeLabel: "索引方式", indexModeDescription: "仅索引问题可提升精度,索引问答可提高召回率", questionIndexModeLabel: "问题索引方式", - questionIndexModeDescription: "一起索引:标准问和相似问合并索引;分别索引:标准问和每个相似问独立索引,检索更精确但需要更多存储", + questionIndexModeDescription: "合并索引:标准问和相似问合并索引;分别索引:标准问和每个相似问独立索引,检索更精确但需要更多存储", entryGuide: "FAQ 条目由标准问、相似问、反例和多个答案组成,可在知识库详情中批量导入、编辑。", modes: { questionOnly: "仅标准问/相似问", questionAnswer: "标准问 + 答案", - combined: "一起索引", + combined: "合并索引", separate: "分别索引", }, standardQuestion: "标准问", diff --git a/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue b/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue index 4cf1f90a..c8834076 100644 --- a/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue +++ b/frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue @@ -45,7 +45,6 @@ {{ $t('knowledgeEditor.basic.typeDocument') }} {{ $t('knowledgeEditor.basic.typeFAQ') }} @@ -97,7 +96,6 @@ {{ $t('knowledgeEditor.faq.modes.questionOnly') }} {{ $t('knowledgeEditor.faq.modes.questionAnswer') }} @@ -108,7 +106,6 @@ {{ $t('knowledgeEditor.faq.modes.combined') }} {{ $t('knowledgeEditor.faq.modes.separate') }} @@ -227,7 +224,7 @@ watch( if (!formData.value) return if (newType === 'faq') { if (!formData.value.faqConfig) { - formData.value.faqConfig = { indexMode: 'question_answer', questionIndexMode: 'combined' } + formData.value.faqConfig = { indexMode: 'question_only', questionIndexMode: 'separate' } } if (!['basic', 'models', 'faq'].includes(currentSection.value)) { currentSection.value = 'faq' @@ -245,7 +242,8 @@ const initFormData = (type: 'document' | 'faq' = 'document') => { name: '', description: '', faqConfig: { - indexMode: 'question_answer' + indexMode: 'question_only', + questionIndexMode: 'separate' }, modelConfig: { llmModelId: '', @@ -321,8 +319,8 @@ const loadKBData = async () => { name: kb.name || '', description: kb.description || '', faqConfig: { - indexMode: kb.faq_config?.index_mode || 'question_answer', - questionIndexMode: kb.faq_config?.question_index_mode || 'combined' + indexMode: kb.faq_config?.index_mode || 'question_only', + questionIndexMode: kb.faq_config?.question_index_mode || 'separate' }, modelConfig: { llmModelId: kb.summary_model_id || '', @@ -496,8 +494,8 @@ const buildSubmitData = () => { if (formData.value.type === 'faq') { data.faq_config = { - index_mode: formData.value.faqConfig?.indexMode || 'question_answer', - question_index_mode: formData.value.faqConfig?.questionIndexMode || 'combined' + index_mode: formData.value.faqConfig?.indexMode || 'question_only', + question_index_mode: formData.value.faqConfig?.questionIndexMode || 'separate' } } @@ -535,8 +533,8 @@ const handleSubmit = async () => { const updateConfig: any = {} if (formData.value.type === 'faq' && formData.value.faqConfig) { updateConfig.faq_config = { - index_mode: formData.value.faqConfig.indexMode || 'question_answer', - question_index_mode: formData.value.faqConfig.questionIndexMode || 'combined' + index_mode: formData.value.faqConfig.indexMode || 'question_only', + question_index_mode: formData.value.faqConfig.questionIndexMode || 'separate' } } await updateKnowledgeBase(props.kbId, {