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