diff --git a/web/app/components/workflow/nodes/question-classifier/default.ts b/web/app/components/workflow/nodes/question-classifier/default.ts index a059401e0e..4279d1d4b0 100644 --- a/web/app/components/workflow/nodes/question-classifier/default.ts +++ b/web/app/components/workflow/nodes/question-classifier/default.ts @@ -16,7 +16,16 @@ const nodeDefault: NodeDefault = { temperature: 0.7, }, }, - classes: [], + classes: [ + { + id: '1', + name: '', + }, + { + id: '2', + name: '', + }, + ], }, getAvailablePrevNodes(isChatMode: boolean) { const nodes = isChatMode @@ -39,6 +48,8 @@ const nodeDefault: NodeDefault = { if (!errorMessages && (!payload.classes || payload.classes.length === 0)) errorMessages = t(`${i18nPrefix}.errorMsg.fieldRequired`, { field: t(`${i18nPrefix}.nodes.questionClassifiers.class`) }) + if (!errorMessages && (payload.classes.some(item => !item.name))) + errorMessages = t(`${i18nPrefix}.errorMsg.fieldRequired`, { field: t(`${i18nPrefix}.nodes.questionClassifiers.topicName`) }) return { isValid: !errorMessages, errorMessage: errorMessages, diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index 3e2dc603c6..6f0fe3708f 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -313,6 +313,7 @@ const translation = { class: 'Class', classNamePlaceholder: 'Write your class name', advancedSetting: 'Advanced Setting', + topicName: 'Topic Name', topicPlaceholder: 'Write your topic name', addClass: 'Add Class', instruction: 'Instruction', diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index 860ca855e7..8fa02a5645 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -313,6 +313,7 @@ const translation = { class: '分类', classNamePlaceholder: '输入你的分类名称', advancedSetting: '高级设置', + topicName: '主题内容', topicPlaceholder: '在这里输入你的主题内容', addClass: '添加分类', instruction: '指令',