Skip to content

Commit c5dfbde

Browse files
authored
fix: Error parameter not popped up prompt during variable splitting and parameter extraction node verification (#4238)
1 parent fe2180b commit c5dfbde

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

apps/application/flow/step_node/parameter_extraction_node/impl/base_parameter_extraction_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_default_model_params_setting(model_id):
4646

4747

4848
def generate_properties(variable_list):
49-
return {variable['field']: {'type': variable['parameter_type'], 'description': variable['desc'],
49+
return {variable['field']: {'type': variable['parameter_type'], 'description': (variable.get('desc') or ""),
5050
'title': variable['label']} for variable in
5151
variable_list}
5252

ui/src/locales/lang/en-US/views/application-workflow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ You are a master of problem optimization, adept at accurately inferring user int
436436
addVariables: 'Add Variables',
437437
editVariables: 'Edit Variables',
438438
variablePlaceholder: 'Please enter variable',
439+
variableListPlaceholder: 'Please add split variables',
439440
expression: {
440441
label: 'Expression',
441442
placeholder: 'Please enter expression',
@@ -446,6 +447,7 @@ You are a master of problem optimization, adept at accurately inferring user int
446447
text: 'Use AI models to extract structured parameters',
447448
extractParameters: {
448449
label: 'Extract Parameters',
450+
variableListPlaceholder: 'Please add extraction parameters',
449451
parameterType: 'Parameter Type',
450452
},
451453
},

ui/src/locales/lang/zh-CN/views/application-workflow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ export default {
447447
addVariables: '添加变量',
448448
editVariables: '编辑变量',
449449
variablePlaceholder: '请输入变量',
450+
variableListPlaceholder: '请添加拆分变量',
450451
expression: {
451452
label: '表达式',
452453
placeholder: '请输入表达式',
@@ -457,6 +458,7 @@ export default {
457458
text: '利用 AI 模型提取结构化参数',
458459
extractParameters: {
459460
label: '提取参数',
461+
variableListPlaceholder: '请添加提取参数',
460462
parameterType: '参数类型',
461463
},
462464
},

ui/src/locales/lang/zh-Hant/views/application-workflow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ export default {
422422
addVariables: '添加變量',
423423
editVariables: '編輯變量',
424424
variablePlaceholder: '請輸入變量',
425+
variableListPlaceholder: '請添加折開變數',
425426
expression: {
426427
label: '表達式',
427428
placeholder: '請輸入表達式',
@@ -432,6 +433,7 @@ export default {
432433
text: '利用 AI 模型提取結構化參數',
433434
extractParameters: {
434435
label: '提取參數',
436+
variableListPlaceholder: '請添加選取參數',
435437
parameterType: '參數類型',
436438
},
437439
},

ui/src/workflow/nodes/parameter-extraction-node/index.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@
7979
<el-form-item
8080
prop="variable_list"
8181
:rules="{
82-
message: $t('views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.label'),
82+
message: $t(
83+
'views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.variableListPlaceholder',
84+
),
8385
trigger: 'blur',
8486
required: true,
8587
}"
@@ -184,7 +186,9 @@ const model_change = (model_id?: string) => {
184186
185187
const VariableSplittingRef = ref()
186188
const validate = async () => {
187-
return VariableSplittingRef.value.validate()
189+
return VariableSplittingRef.value.validate().catch((err: any) => {
190+
return Promise.reject({ node: props.nodeModel, errMessage: err })
191+
})
188192
}
189193
190194
onMounted(() => {

ui/src/workflow/nodes/variable-splitting/index.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
<el-form-item
4040
prop="variable_list"
4141
:rules="{
42-
message: $t('views.applicationWorkflow.variable.placeholder'),
42+
message: $t(
43+
'views.applicationWorkflow.nodes.variableSplittingNode.variableListPlaceholder',
44+
),
4345
trigger: 'blur',
4446
required: true,
4547
}"
@@ -81,7 +83,9 @@ const form_data = computed({
8183
})
8284
const VariableSplittingRef = ref()
8385
const validate = async () => {
84-
return VariableSplittingRef.value.validate()
86+
return VariableSplittingRef.value.validate().catch((err: any) => {
87+
return Promise.reject({ node: props.nodeModel, errMessage: err })
88+
})
8589
}
8690
onMounted(() => {
8791
set(props.nodeModel, 'validate', validate)

0 commit comments

Comments
 (0)