diff --git a/ui/src/views/application/component/STTModelParamSettingDialog.vue b/ui/src/views/application/component/STTModelParamSettingDialog.vue index c4e4723f5..df490f4a7 100644 --- a/ui/src/views/application/component/STTModelParamSettingDialog.vue +++ b/ui/src/views/application/component/STTModelParamSettingDialog.vue @@ -71,7 +71,7 @@ const open = (model_id: string, application_id?: string, model_setting_data?: an .getModelParamsForm(model_id, loading) .then(( ok: any ) => { model_form_field.value = ok.data - const res = ok.data + const resp = ok.data .map((item: any) => ({ [item.field]: item.show_default_value !== false ? item.default_value : undefined, })) @@ -79,12 +79,12 @@ const open = (model_id: string, application_id?: string, model_setting_data?: an if (model_setting_data) { Object.keys(model_setting_data).forEach((key) => { - if (!(key in res)) { + if (!(key in resp)) { delete model_setting_data[key] } }) } - model_setting_data = { ...res, ...model_setting_data } + model_setting_data = { ...resp, ...model_setting_data } // 渲染动态表单 dynamicsFormRef.value?.render(model_form_field.value, model_setting_data) }) diff --git a/ui/src/workflow/nodes/speech-to-text-node/index.vue b/ui/src/workflow/nodes/speech-to-text-node/index.vue index 003d54acb..8d9d34e9a 100644 --- a/ui/src/workflow/nodes/speech-to-text-node/index.vue +++ b/ui/src/workflow/nodes/speech-to-text-node/index.vue @@ -28,6 +28,15 @@ }}* + + + + @@ -100,12 +110,17 @@ import { computed, onMounted, ref, inject } from 'vue' import { groupBy, set } from 'lodash' import NodeCascader from '@/workflow/common/NodeCascader.vue' import type { FormInstance } from 'element-plus' +import { MsgSuccess } from '@/utils/message' +import { t } from '@/locales' import { useRoute } from 'vue-router' import { loadSharedApi } from '@/utils/dynamics-api/shared-api' +import STTModeParamSettingDialog from '@/views/application/component/STTModelParamSettingDialog.vue' const getApplicationDetail = inject('getApplicationDetail') as any const route = useRoute() -const {} = route as any +const { + params: { id }, +} = route as any const apiType = computed(() => { if (route.path.includes('resource-management')) { @@ -117,6 +132,8 @@ const apiType = computed(() => { const props = defineProps<{ nodeModel: any }>() const modelOptions = ref(null) +const STTModeParamSettingDialogRef = ref>() + const aiChatNodeFormRef = ref() const nodeCascaderRef = ref() @@ -143,6 +160,7 @@ const form = { stt_model_id: '', is_result: true, audio_list: [], + model_params_setting: {}, } const form_data = computed({ @@ -159,6 +177,25 @@ const form_data = computed({ }, }) + +const openSTTParamSettingDialog = () => { + const model_id = form_data.value.stt_model_id + if (!model_id) { + MsgSuccess(t('views.application.form.voiceInput.requiredMessage')) + return + } + STTModeParamSettingDialogRef.value?.open( + model_id, + id, + form_data.value.model_params_setting, + ) +} + +const refreshSTTForm = (data: any) => { + form_data.value.model_params_setting = data +} + + const application = getApplicationDetail() function getSelectModel() { const obj =