mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Intent node
--bug=1062137 --user=张展玮 【应用】意图识别节点存在空的意图项,可以发布应用成功 https://www.tapd.cn/62980211/s/1779110
This commit is contained in:
parent
82fdef16f1
commit
3e8bf8a631
|
|
@ -341,6 +341,7 @@ You are a master of problem optimization, adept at accurately inferring user int
|
|||
label: 'IntentNode',
|
||||
text: 'Match user questions with user-defined intent classifications',
|
||||
other: 'other',
|
||||
error2: 'Repeated intent',
|
||||
placeholder: 'Please choose a classification option',
|
||||
classify: {
|
||||
label: 'Intent classify',
|
||||
|
|
|
|||
|
|
@ -341,6 +341,7 @@ export default {
|
|||
label: '意图识别',
|
||||
text: '将用户问题与用户预设的意图分类进行匹配',
|
||||
other: '其他',
|
||||
error2: '意图重复',
|
||||
placeholder: '请选择分类项',
|
||||
classify: {
|
||||
label: '意图分类',
|
||||
|
|
|
|||
|
|
@ -334,6 +334,7 @@ export default {
|
|||
label: '意圖識別',
|
||||
text: '將用戶問題與用戶預設的意圖分類進行匹配',
|
||||
other: '其他',
|
||||
error2: '意圖重複',
|
||||
placeholder: '請選擇分類項',
|
||||
classify: {
|
||||
label: '意圖分類',
|
||||
|
|
|
|||
|
|
@ -90,10 +90,6 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:rules="{
|
||||
required: true,
|
||||
trigger: 'change',
|
||||
}"
|
||||
>
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
|
|
@ -113,6 +109,14 @@
|
|||
v-for="(item, index) in form_data.branch"
|
||||
v-resize="(wh: any) => resizeBranch(wh, item, index)"
|
||||
:key="item.id"
|
||||
>
|
||||
<el-form-item
|
||||
:prop="`branch.${index}.content`"
|
||||
:rules="{
|
||||
message: $t('views.applicationWorkflow.nodes.intentNode.classify.placeholder'),
|
||||
trigger: 'change',
|
||||
required: true,
|
||||
}"
|
||||
>
|
||||
<el-row class="mb-8" :gutter="12" align="middle">
|
||||
<el-col :span="21">
|
||||
|
|
@ -138,6 +142,7 @@
|
|||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
|
@ -326,10 +331,15 @@ const IntentClassifyNodeFormRef = ref<FormInstance>()
|
|||
const modelOptions = ref<any>(null)
|
||||
|
||||
const validate = () => {
|
||||
|
||||
return Promise.all([
|
||||
nodeCascaderRef.value ? nodeCascaderRef.value.validate() : Promise.resolve(''),
|
||||
IntentClassifyNodeFormRef.value?.validate(),
|
||||
]).catch((err: any) => {
|
||||
]).then(() => {
|
||||
if (form_data.value.branch.length != new Set(form_data.value.branch.map((item: any) => item.content)).size) {
|
||||
throw t('views.applicationWorkflow.nodes.intentNode.error2')
|
||||
}
|
||||
}).catch((err: any) => {
|
||||
return Promise.reject({ node: props.nodeModel, errMessage: err })
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue