From c5dfbde07c27bdc5d6604942a08f5f21451a99f5 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed, 22 Oct 2025 17:57:16 +0800 Subject: [PATCH] fix: Error parameter not popped up prompt during variable splitting and parameter extraction node verification (#4238) --- .../impl/base_parameter_extraction_node.py | 2 +- ui/src/locales/lang/en-US/views/application-workflow.ts | 2 ++ ui/src/locales/lang/zh-CN/views/application-workflow.ts | 2 ++ ui/src/locales/lang/zh-Hant/views/application-workflow.ts | 2 ++ ui/src/workflow/nodes/parameter-extraction-node/index.vue | 8 ++++++-- ui/src/workflow/nodes/variable-splitting/index.vue | 8 ++++++-- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/apps/application/flow/step_node/parameter_extraction_node/impl/base_parameter_extraction_node.py b/apps/application/flow/step_node/parameter_extraction_node/impl/base_parameter_extraction_node.py index f8a81a9f1..aff510028 100644 --- a/apps/application/flow/step_node/parameter_extraction_node/impl/base_parameter_extraction_node.py +++ b/apps/application/flow/step_node/parameter_extraction_node/impl/base_parameter_extraction_node.py @@ -46,7 +46,7 @@ def get_default_model_params_setting(model_id): def generate_properties(variable_list): - return {variable['field']: {'type': variable['parameter_type'], 'description': variable['desc'], + return {variable['field']: {'type': variable['parameter_type'], 'description': (variable.get('desc') or ""), 'title': variable['label']} for variable in variable_list} diff --git a/ui/src/locales/lang/en-US/views/application-workflow.ts b/ui/src/locales/lang/en-US/views/application-workflow.ts index cf39512f5..849dc291f 100644 --- a/ui/src/locales/lang/en-US/views/application-workflow.ts +++ b/ui/src/locales/lang/en-US/views/application-workflow.ts @@ -436,6 +436,7 @@ You are a master of problem optimization, adept at accurately inferring user int addVariables: 'Add Variables', editVariables: 'Edit Variables', variablePlaceholder: 'Please enter variable', + variableListPlaceholder: 'Please add split variables', expression: { label: 'Expression', placeholder: 'Please enter expression', @@ -446,6 +447,7 @@ You are a master of problem optimization, adept at accurately inferring user int text: 'Use AI models to extract structured parameters', extractParameters: { label: 'Extract Parameters', + variableListPlaceholder: 'Please add extraction parameters', parameterType: 'Parameter Type', }, }, diff --git a/ui/src/locales/lang/zh-CN/views/application-workflow.ts b/ui/src/locales/lang/zh-CN/views/application-workflow.ts index 2857716ed..857ca8096 100644 --- a/ui/src/locales/lang/zh-CN/views/application-workflow.ts +++ b/ui/src/locales/lang/zh-CN/views/application-workflow.ts @@ -447,6 +447,7 @@ export default { addVariables: '添加变量', editVariables: '编辑变量', variablePlaceholder: '请输入变量', + variableListPlaceholder: '请添加拆分变量', expression: { label: '表达式', placeholder: '请输入表达式', @@ -457,6 +458,7 @@ export default { text: '利用 AI 模型提取结构化参数', extractParameters: { label: '提取参数', + variableListPlaceholder: '请添加提取参数', parameterType: '参数类型', }, }, diff --git a/ui/src/locales/lang/zh-Hant/views/application-workflow.ts b/ui/src/locales/lang/zh-Hant/views/application-workflow.ts index 12448bfea..3d23a7b91 100644 --- a/ui/src/locales/lang/zh-Hant/views/application-workflow.ts +++ b/ui/src/locales/lang/zh-Hant/views/application-workflow.ts @@ -422,6 +422,7 @@ export default { addVariables: '添加變量', editVariables: '編輯變量', variablePlaceholder: '請輸入變量', + variableListPlaceholder: '請添加折開變數', expression: { label: '表達式', placeholder: '請輸入表達式', @@ -432,6 +433,7 @@ export default { text: '利用 AI 模型提取結構化參數', extractParameters: { label: '提取參數', + variableListPlaceholder: '請添加選取參數', parameterType: '參數類型', }, }, diff --git a/ui/src/workflow/nodes/parameter-extraction-node/index.vue b/ui/src/workflow/nodes/parameter-extraction-node/index.vue index d86f162cf..b50273e55 100644 --- a/ui/src/workflow/nodes/parameter-extraction-node/index.vue +++ b/ui/src/workflow/nodes/parameter-extraction-node/index.vue @@ -79,7 +79,9 @@ { const VariableSplittingRef = ref() const validate = async () => { - return VariableSplittingRef.value.validate() + return VariableSplittingRef.value.validate().catch((err: any) => { + return Promise.reject({ node: props.nodeModel, errMessage: err }) + }) } onMounted(() => { diff --git a/ui/src/workflow/nodes/variable-splitting/index.vue b/ui/src/workflow/nodes/variable-splitting/index.vue index e3f219a9b..80324aa09 100644 --- a/ui/src/workflow/nodes/variable-splitting/index.vue +++ b/ui/src/workflow/nodes/variable-splitting/index.vue @@ -39,7 +39,9 @@ { - return VariableSplittingRef.value.validate() + return VariableSplittingRef.value.validate().catch((err: any) => { + return Promise.reject({ node: props.nodeModel, errMessage: err }) + }) } onMounted(() => { set(props.nodeModel, 'validate', validate)