Skip to content

Commit d582507

Browse files
Merge branch 'main' of https://github.com/maxkb-dev/maxkb
2 parents 6805ebe + 5090554 commit d582507

File tree

13 files changed

+55
-15
lines changed

13 files changed

+55
-15
lines changed

apps/application/serializers/chat_serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ def one(self, current_role: RoleConstants, with_valid=True):
472472
class Query(serializers.Serializer):
473473
application_id = serializers.UUIDField(required=True)
474474
chat_id = serializers.UUIDField(required=True)
475-
order_asc = serializers.BooleanField(required=False)
475+
order_asc = serializers.BooleanField(required=False, allow_null=True)
476476

477477
def list(self, with_valid=True):
478478
if with_valid:

apps/application/swagger_api/chat_api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ def get_request_params_api():
284284
type=openapi.TYPE_STRING,
285285
required=True,
286286
description=_('Conversation ID')),
287+
openapi.Parameter(name='order_asc',
288+
in_=openapi.IN_QUERY,
289+
type=openapi.TYPE_BOOLEAN,
290+
required=False,
291+
description=_('Is it ascending order')),
287292
]
288293

289294
@staticmethod

apps/locales/en_US/LC_MESSAGES/django.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6764,3 +6764,6 @@ msgstr ""
67646764

67656765
msgid "The network is busy, try again later."
67666766
msgstr ""
6767+
6768+
msgid "Is it ascending order"
6769+
msgstr ""

apps/locales/zh_CN/LC_MESSAGES/django.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6902,4 +6902,7 @@ msgid "AI reply: "
69026902
msgstr "AI 回复: "
69036903

69046904
msgid "The network is busy, try again later."
6905-
msgstr "网络繁忙,请稍后再试。"
6905+
msgstr "网络繁忙,请稍后再试。"
6906+
6907+
msgid "Is it ascending order"
6908+
msgstr "是否升序"

apps/locales/zh_Hant/LC_MESSAGES/django.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6914,4 +6914,7 @@ msgid "AI reply: "
69146914
msgstr "AI 回覆: "
69156915

69166916
msgid "The network is busy, try again later."
6917-
msgstr "網絡繁忙,請稍後再試。"
6917+
msgstr "網絡繁忙,請稍後再試。"
6918+
6919+
msgid "Is it ascending order"
6920+
msgstr "是否昇冪"

apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/tts.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Dict
22

33
import dashscope
4-
from dashscope.audio.tts_v2 import *
4+
55
from django.utils.translation import gettext as _
66

77
from common.util.common import _remove_empty_lines
@@ -38,9 +38,14 @@ def check_auth(self):
3838

3939
def text_to_speech(self, text):
4040
dashscope.api_key = self.api_key
41-
synthesizer = SpeechSynthesizer(model=self.model, **self.params)
4241
text = _remove_empty_lines(text)
43-
audio = synthesizer.call(text)
42+
if 'sambert' in self.model:
43+
from dashscope.audio.tts import SpeechSynthesizer
44+
audio = SpeechSynthesizer.call(model=self.model, text=text, **self.params).get_audio_data()
45+
else:
46+
from dashscope.audio.tts_v2 import SpeechSynthesizer
47+
synthesizer = SpeechSynthesizer(model=self.model, **self.params)
48+
audio = synthesizer.call(text)
4449
if type(audio) == str:
4550
print(audio)
4651
raise Exception(audio)

ui/src/components/ai-chat/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ const handleScrollTop = ($event: any) => {
417417
scrollTop.value = $event.scrollTop
418418
if (
419419
dialogScrollbar.value.scrollHeight - (scrollTop.value + scrollDiv.value.wrapRef.offsetHeight) <=
420-
30
420+
40
421421
) {
422422
scorll.value = true
423423
} else {

ui/src/components/dynamics-form/index.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,25 @@ const render = (
179179
const value = formFieldList.value
180180
.map((item) => {
181181
if (form_data[item.field] !== undefined) {
182-
return { [item.field]: form_data[item.field] }
182+
if (item.value_field && item.option_list && item.option_list.length > 0) {
183+
const value_field = item.value_field
184+
const find = item.option_list?.find((i) => i[value_field] === form_data[item.field])
185+
if (find) {
186+
return { [item.field]: form_data[item.field] }
187+
}
188+
if (item.show_default_value === true || item.show_default_value === undefined) {
189+
return { [item.field]: item.default_value }
190+
}
191+
} else {
192+
return { [item.field]: form_data[item.field] }
193+
}
183194
}
184195
if (item.show_default_value === true || item.show_default_value === undefined) {
185196
return { [item.field]: item.default_value }
186197
}
187198
return {}
188199
})
189200
.reduce((x, y) => ({ ...x, ...y }), {})
190-
191201
formValue.value = _.cloneDeep(value)
192202
}
193203
}

ui/src/views/application/component/AIModeParamSettingDialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
v-model="dialogVisible"
77
style="width: 550px"
88
append-to-body
9+
destroy-on-close
910
:close-on-click-modal="false"
1011
:close-on-press-escape="false"
1112
>

ui/src/views/chat/embed/index.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ function editName(val: string, item: any) {
181181
}
182182
183183
log.asyncPutChatClientLog(applicationDetail.value.id, item.id, obj, loading).then(() => {
184-
getChatLog(applicationDetail.value.id)
184+
const find = chatLogData.value.find((item: any) => item.id == item.id)
185+
if (find) {
186+
find.abstract = val
187+
}
185188
item['writeStatus'] = false
186189
})
187190
} else {

0 commit comments

Comments
 (0)