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.
This commit is contained in:
wizardchen
2025-11-16 23:35:54 +08:00
parent 7dd8861366
commit c07fd60e8b
2 changed files with 11 additions and 13 deletions
+2 -2
View File
@@ -1040,12 +1040,12 @@ export default {
indexModeLabel: "索引方式",
indexModeDescription: "仅索引问题可提升精度,索引问答可提高召回率",
questionIndexModeLabel: "问题索引方式",
questionIndexModeDescription: "一起索引:标准问和相似问合并索引;分别索引:标准问和每个相似问独立索引,检索更精确但需要更多存储",
questionIndexModeDescription: "合并索引:标准问和相似问合并索引;分别索引:标准问和每个相似问独立索引,检索更精确但需要更多存储",
entryGuide: "FAQ 条目由标准问、相似问、反例和多个答案组成,可在知识库详情中批量导入、编辑。",
modes: {
questionOnly: "仅标准问/相似问",
questionAnswer: "标准问 + 答案",
combined: "一起索引",
combined: "合并索引",
separate: "分别索引",
},
standardQuestion: "标准问",
@@ -45,7 +45,6 @@
<t-radio-group
v-model="formData.type"
:disabled="mode === 'edit'"
variant="default-filled"
>
<t-radio-button value="document">{{ $t('knowledgeEditor.basic.typeDocument') }}</t-radio-button>
<t-radio-button value="faq">{{ $t('knowledgeEditor.basic.typeFAQ') }}</t-radio-button>
@@ -97,7 +96,6 @@
<label class="form-label required">{{ $t('knowledgeEditor.faq.indexModeLabel') }}</label>
<t-radio-group
v-model="formData.faqConfig.indexMode"
variant="default-filled"
>
<t-radio-button value="question_only">{{ $t('knowledgeEditor.faq.modes.questionOnly') }}</t-radio-button>
<t-radio-button value="question_answer">{{ $t('knowledgeEditor.faq.modes.questionAnswer') }}</t-radio-button>
@@ -108,7 +106,6 @@
<label class="form-label required">{{ $t('knowledgeEditor.faq.questionIndexModeLabel') }}</label>
<t-radio-group
v-model="formData.faqConfig.questionIndexMode"
variant="default-filled"
>
<t-radio-button value="combined">{{ $t('knowledgeEditor.faq.modes.combined') }}</t-radio-button>
<t-radio-button value="separate">{{ $t('knowledgeEditor.faq.modes.separate') }}</t-radio-button>
@@ -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, {