From 102b0e9f97dd5b71a928f70c98c04da2ea543f66 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Wed, 21 Oct 2026 10:28:34 +0800 Subject: [PATCH] fix: When an AI conversation node uses the default model, the button for generating system prompts will not be automatically activated. --- ui/src/workflow/nodes/ai-chat-node/index.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ui/src/workflow/nodes/ai-chat-node/index.vue b/ui/src/workflow/nodes/ai-chat-node/index.vue index d4a765feecb..9e617d60ba5 100644 --- a/ui/src/workflow/nodes/ai-chat-node/index.vue +++ b/ui/src/workflow/nodes/ai-chat-node/index.vue @@ -38,7 +38,10 @@ style="width: 85px" @change="chat_data.model_id_reference = []" > - + @@ -101,7 +104,11 @@ type="primary" link @click="openGeneratePromptDialog(chat_data.model_id)" - :disabled="chat_data.model_id_type === 'reference' || !chat_data.model_id" + :disabled=" + chat_data.model_id_type === 'reference' || + (!chat_data.model_id && chat_data.model_id_type === 'custom')|| + (chat_data.model_id_type==='default'&& !defaultModelId) + " > @@ -638,7 +645,9 @@ import { fileTooltip } from '@/workflow/common/data.ts' const workflowMode = (inject('workflowMode') as WorkflowMode) || WorkflowMode.Application const getResourceDetail = inject('getResourceDetail') as any const route = useRoute() - +const defaultModelId = computed(() => { + return getResourceDetail?.()?.value?.default_model_setting?.['LLM']?.model_id || '' +}) const { params: { id }, } = route as any @@ -784,9 +793,12 @@ const openAIParamSettingDialog = (modelId: string) => { const GeneratePromptDialogRef = ref>() const openGeneratePromptDialog = (modelId: string) => { - if (modelId) { + if (modelId && chat_data.value.model_id_type === 'custom') { GeneratePromptDialogRef.value?.open(modelId, id) } + if (chat_data.value.model_id_type === 'default'&&defaultModelId.value) { + GeneratePromptDialogRef.value?.open(defaultModelId.value, id) + } } const replace = (v: any) => { set(props.nodeModel.properties.node_data, 'system', v)