From 5e563054f9671493c10a66fc3bdaa16e679e6277 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 3 Mar 2025 18:14:47 +0800 Subject: [PATCH 1/6] fix: Fix default_value not show when image model changed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1052695 --user=刘瑞斌 【应用】高级编排-设置-图片生成组件-切换模型后图片尺寸为空-未同步切换到当前模型的首个尺寸 https://www.tapd.cn/57709429/s/1661346 --- ui/src/components/dynamics-form/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/src/components/dynamics-form/index.vue b/ui/src/components/dynamics-form/index.vue index ab17bb21e..626471202 100644 --- a/ui/src/components/dynamics-form/index.vue +++ b/ui/src/components/dynamics-form/index.vue @@ -179,7 +179,12 @@ const render = ( const value = formFieldList.value .map((item) => { if (form_data[item.field] !== undefined) { - return { [item.field]: form_data[item.field] } + const v: any = item.option_list?.filter(i => i.value_field === form_data[item.field]) + if (v?.length > 0) { + return { [item.field]: form_data[item.field] }; + } else { + return { [item.field]: item.default_value }; + } } if (item.show_default_value === true || item.show_default_value === undefined) { return { [item.field]: item.default_value } From 13ce64e51a4094798d54b9f95b3eaeb4b012c780 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 4 Mar 2025 10:42:09 +0800 Subject: [PATCH 2/6] fix: Compatible with dashscope tts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1052708 --user=刘瑞斌 【应用】-使用阿里云语音合成模型sambert-zhichu-v1,对话报错 https://www.tapd.cn/57709429/s/1661551 --- .../impl/aliyun_bai_lian_model_provider/model/tts.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/tts.py b/apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/tts.py index ec26f14d5..bcba7d462 100644 --- a/apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/tts.py +++ b/apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/tts.py @@ -1,7 +1,7 @@ from typing import Dict import dashscope -from dashscope.audio.tts_v2 import * + from django.utils.translation import gettext as _ from common.util.common import _remove_empty_lines @@ -38,9 +38,14 @@ class AliyunBaiLianTextToSpeech(MaxKBBaseModel, BaseTextToSpeech): def text_to_speech(self, text): dashscope.api_key = self.api_key - synthesizer = SpeechSynthesizer(model=self.model, **self.params) text = _remove_empty_lines(text) - audio = synthesizer.call(text) + if 'sambert' in self.model: + from dashscope.audio.tts import SpeechSynthesizer + audio = SpeechSynthesizer.call(model=self.model, text=text, **self.params).get_audio_data() + else: + from dashscope.audio.tts_v2 import SpeechSynthesizer + synthesizer = SpeechSynthesizer(model=self.model, **self.params) + audio = synthesizer.call(text) if type(audio) == str: print(audio) raise Exception(audio) From c65ef97301e29a1d6e5c050d854adc671bc4458a Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 4 Mar 2025 11:34:56 +0800 Subject: [PATCH 3/6] fix: Fixed the default value of not selecting 'select' after switching models (#2477) --- ui/src/components/ai-chat/index.vue | 2 +- ui/src/components/dynamics-form/index.vue | 15 ++++++++++----- .../component/AIModeParamSettingDialog.vue | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 8136420bb..afeea39aa 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -417,7 +417,7 @@ const handleScrollTop = ($event: any) => { scrollTop.value = $event.scrollTop if ( dialogScrollbar.value.scrollHeight - (scrollTop.value + scrollDiv.value.wrapRef.offsetHeight) <= - 30 + 40 ) { scorll.value = true } else { diff --git a/ui/src/components/dynamics-form/index.vue b/ui/src/components/dynamics-form/index.vue index 626471202..8885aeec9 100644 --- a/ui/src/components/dynamics-form/index.vue +++ b/ui/src/components/dynamics-form/index.vue @@ -179,11 +179,17 @@ const render = ( const value = formFieldList.value .map((item) => { if (form_data[item.field] !== undefined) { - const v: any = item.option_list?.filter(i => i.value_field === form_data[item.field]) - if (v?.length > 0) { - return { [item.field]: form_data[item.field] }; + if (item.value_field && item.option_list && item.option_list.length > 0) { + const value_field = item.value_field + const find = item.option_list?.find((i) => i[value_field] === form_data[item.field]) + if (find) { + return { [item.field]: form_data[item.field] } + } + if (item.show_default_value === true || item.show_default_value === undefined) { + return { [item.field]: item.default_value } + } } else { - return { [item.field]: item.default_value }; + return { [item.field]: form_data[item.field] } } } if (item.show_default_value === true || item.show_default_value === undefined) { @@ -192,7 +198,6 @@ const render = ( return {} }) .reduce((x, y) => ({ ...x, ...y }), {}) - formValue.value = _.cloneDeep(value) } } diff --git a/ui/src/views/application/component/AIModeParamSettingDialog.vue b/ui/src/views/application/component/AIModeParamSettingDialog.vue index 16b3c56f8..a42399209 100644 --- a/ui/src/views/application/component/AIModeParamSettingDialog.vue +++ b/ui/src/views/application/component/AIModeParamSettingDialog.vue @@ -6,6 +6,7 @@ v-model="dialogVisible" style="width: 550px" append-to-body + destroy-on-close :close-on-click-modal="false" :close-on-press-escape="false" > From 9d5f9fde622eba035a495af57600c4d3e1646a99 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 4 Mar 2025 14:13:36 +0800 Subject: [PATCH 4/6] fix: Retrieve the dialogue record list document and confirm the parameters (#2479) --- apps/application/serializers/chat_serializers.py | 2 +- apps/application/swagger_api/chat_api.py | 5 +++++ apps/locales/en_US/LC_MESSAGES/django.po | 3 +++ apps/locales/zh_CN/LC_MESSAGES/django.po | 5 ++++- apps/locales/zh_Hant/LC_MESSAGES/django.po | 5 ++++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/apps/application/serializers/chat_serializers.py b/apps/application/serializers/chat_serializers.py index 4ec230b7c..21e583be0 100644 --- a/apps/application/serializers/chat_serializers.py +++ b/apps/application/serializers/chat_serializers.py @@ -472,7 +472,7 @@ class ChatRecordSerializer(serializers.Serializer): class Query(serializers.Serializer): application_id = serializers.UUIDField(required=True) chat_id = serializers.UUIDField(required=True) - order_asc = serializers.BooleanField(required=False) + order_asc = serializers.BooleanField(required=False, allow_null=True) def list(self, with_valid=True): if with_valid: diff --git a/apps/application/swagger_api/chat_api.py b/apps/application/swagger_api/chat_api.py index 32522fd94..57dc01640 100644 --- a/apps/application/swagger_api/chat_api.py +++ b/apps/application/swagger_api/chat_api.py @@ -284,6 +284,11 @@ class ChatRecordApi(ApiMixin): type=openapi.TYPE_STRING, required=True, description=_('Conversation ID')), + openapi.Parameter(name='order_asc', + in_=openapi.IN_QUERY, + type=openapi.TYPE_BOOLEAN, + required=False, + description=_('Is it ascending order')), ] @staticmethod diff --git a/apps/locales/en_US/LC_MESSAGES/django.po b/apps/locales/en_US/LC_MESSAGES/django.po index 452f51465..ef9686265 100644 --- a/apps/locales/en_US/LC_MESSAGES/django.po +++ b/apps/locales/en_US/LC_MESSAGES/django.po @@ -6764,3 +6764,6 @@ msgstr "" msgid "The network is busy, try again later." msgstr "" + +msgid "Is it ascending order" +msgstr "" \ No newline at end of file diff --git a/apps/locales/zh_CN/LC_MESSAGES/django.po b/apps/locales/zh_CN/LC_MESSAGES/django.po index 5eabfcb52..fdc1f8ac8 100644 --- a/apps/locales/zh_CN/LC_MESSAGES/django.po +++ b/apps/locales/zh_CN/LC_MESSAGES/django.po @@ -6902,4 +6902,7 @@ msgid "AI reply: " msgstr "AI 回复: " msgid "The network is busy, try again later." -msgstr "网络繁忙,请稍后再试。" \ No newline at end of file +msgstr "网络繁忙,请稍后再试。" + +msgid "Is it ascending order" +msgstr "是否升序" \ No newline at end of file diff --git a/apps/locales/zh_Hant/LC_MESSAGES/django.po b/apps/locales/zh_Hant/LC_MESSAGES/django.po index bef312532..69e39e457 100644 --- a/apps/locales/zh_Hant/LC_MESSAGES/django.po +++ b/apps/locales/zh_Hant/LC_MESSAGES/django.po @@ -6914,4 +6914,7 @@ msgid "AI reply: " msgstr "AI 回覆: " msgid "The network is busy, try again later." -msgstr "網絡繁忙,請稍後再試。" \ No newline at end of file +msgstr "網絡繁忙,請稍後再試。" + +msgid "Is it ascending order" +msgstr "是否昇冪" \ No newline at end of file From 7faa79d36196475e3c455b24e56b2da44443de60 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 4 Mar 2025 14:06:46 +0800 Subject: [PATCH 5/6] refactor: disable buttons based on permission type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1052737 --user=刘瑞斌 【函数库】-非当前用户所有的函数,不应该支持复制和导出 https://www.tapd.cn/57709429/s/1661776 --- ui/src/views/function-lib/index.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/views/function-lib/index.vue b/ui/src/views/function-lib/index.vue index bfea00970..63548edb6 100644 --- a/ui/src/views/function-lib/index.vue +++ b/ui/src/views/function-lib/index.vue @@ -115,13 +115,17 @@