diff --git a/ui/src/views/application/ApplicationSetting.vue b/ui/src/views/application/ApplicationSetting.vue index f202cf59f..7880ee4ca 100644 --- a/ui/src/views/application/ApplicationSetting.vue +++ b/ui/src/views/application/ApplicationSetting.vue @@ -451,8 +451,12 @@ const submit = async (formEl: FormInstance | undefined) => { } }) } -const model_change = (model_id: string) => { - AIModeParamSettingDialogRef.value?.reset_default(model_id) +const model_change = (model_id?: string) => { + if (model_id) { + AIModeParamSettingDialogRef.value?.reset_default(model_id) + } else { + refreshForm({}) + } } const openAIParamSettingDialog = () => { const model_id = applicationForm.value.model_id diff --git a/ui/src/workflow/nodes/ai-chat-node/index.vue b/ui/src/workflow/nodes/ai-chat-node/index.vue index 04b279988..87737459c 100644 --- a/ui/src/workflow/nodes/ai-chat-node/index.vue +++ b/ui/src/workflow/nodes/ai-chat-node/index.vue @@ -239,8 +239,12 @@ function submitDialog() { set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value) dialogVisible.value = false } -const model_change = (model_id: string) => { - AIModeParamSettingDialogRef.value?.reset_default(model_id) +const model_change = (model_id?: string) => { + if (model_id) { + AIModeParamSettingDialogRef.value?.reset_default(model_id) + } else { + refreshParam({}) + } } const { params: { id } diff --git a/ui/src/workflow/nodes/question-node/index.vue b/ui/src/workflow/nodes/question-node/index.vue index b2cdc0d02..adfb34b8d 100644 --- a/ui/src/workflow/nodes/question-node/index.vue +++ b/ui/src/workflow/nodes/question-node/index.vue @@ -232,8 +232,12 @@ function openDialog() { cloneContent.value = form_data.value.prompt dialogVisible.value = true } -const model_change = (model_id: string) => { - AIModeParamSettingDialogRef.value?.reset_default(model_id) +const model_change = (model_id?: string) => { + if (model_id) { + AIModeParamSettingDialogRef.value?.reset_default(model_id) + } else { + refreshParam({}) + } } function submitDialog() { set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value)