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 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) 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 ab17bb21e..8885aeec9 100644 --- a/ui/src/components/dynamics-form/index.vue +++ b/ui/src/components/dynamics-form/index.vue @@ -179,7 +179,18 @@ const render = ( const value = formFieldList.value .map((item) => { if (form_data[item.field] !== undefined) { - 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]: form_data[item.field] } + } } if (item.show_default_value === true || item.show_default_value === undefined) { return { [item.field]: item.default_value } @@ -187,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" > diff --git a/ui/src/views/chat/embed/index.vue b/ui/src/views/chat/embed/index.vue index 8ff0152ca..cabf459bf 100644 --- a/ui/src/views/chat/embed/index.vue +++ b/ui/src/views/chat/embed/index.vue @@ -181,7 +181,10 @@ function editName(val: string, item: any) { } log.asyncPutChatClientLog(applicationDetail.value.id, item.id, obj, loading).then(() => { - getChatLog(applicationDetail.value.id) + const find = chatLogData.value.find((item: any) => item.id == item.id) + if (find) { + find.abstract = val + } item['writeStatus'] = false }) } else { diff --git a/ui/src/views/chat/pc/EditTitleDialog.vue b/ui/src/views/chat/pc/EditTitleDialog.vue index cdc6ea92a..e8a8d08e7 100644 --- a/ui/src/views/chat/pc/EditTitleDialog.vue +++ b/ui/src/views/chat/pc/EditTitleDialog.vue @@ -75,7 +75,7 @@ const submit = async (formEl: FormInstance | undefined) => { await formEl.validate((valid) => { if (valid) { log.asyncPutChatClientLog(applicationId.value, chatId.value, form.value, loading).then(() => { - emit('refresh') + emit('refresh', chatId.value, form.value.abstract) dialogVisible.value = false }) } diff --git a/ui/src/views/chat/pc/index.vue b/ui/src/views/chat/pc/index.vue index 8573d18a9..ba65332bf 100644 --- a/ui/src/views/chat/pc/index.vue +++ b/ui/src/views/chat/pc/index.vue @@ -232,8 +232,11 @@ function mouseenter(row: any) { function editLogTitle(row: any) { EditTitleDialogRef.value.open(row, applicationDetail.value.id) } -function refreshFieldTitle() { - getChatLog(applicationDetail.value.id) +function refreshFieldTitle(chatId: string, abstract: string) { + const find = chatLogData.value.find((item: any) => item.id == chatId) + if (find) { + find.abstract = abstract + } } function deleteLog(row: any) { log.asyncDelChatClientLog(applicationDetail.value.id, row.id, left_loading).then(() => { 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 @@