mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-29 07:52:50 +00:00
fix: show error message for tts model params not correct
--bug=1051057 --user=刘瑞斌 【模型管理】语音合成模型有错误的参数,播放回答内容时没有反应 https://www.tapd.cn/57709429/s/1639429
This commit is contained in:
parent
4ae21bcf1f
commit
06f591d404
|
|
@ -84,6 +84,7 @@ import { useRoute } from 'vue-router'
|
|||
import { copyClick } from '@/utils/clipboard'
|
||||
import applicationApi from '@/api/application'
|
||||
import { datetimeFormat } from '@/utils/time'
|
||||
import { MsgError } from '@/utils/message'
|
||||
|
||||
const route = useRoute()
|
||||
const {
|
||||
|
|
@ -197,7 +198,12 @@ const playAnswerText = (text: string) => {
|
|||
}
|
||||
applicationApi
|
||||
.postTextToSpeech((props.applicationId as string) || (id as string), { text: text }, loading)
|
||||
.then((res: any) => {
|
||||
.then(async (res: any) => {
|
||||
if (res.type === 'application/json') {
|
||||
const text = await res.text()
|
||||
MsgError(text)
|
||||
return
|
||||
}
|
||||
// 假设我们有一个 MP3 文件的字节数组
|
||||
// 创建 Blob 对象
|
||||
const blob = new Blob([res], { type: 'audio/mp3' })
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ import EditMarkDialog from '@/views/log/component/EditMarkDialog.vue'
|
|||
import { datetimeFormat } from '@/utils/time'
|
||||
import applicationApi from '@/api/application'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { MsgError } from '@/utils/message'
|
||||
|
||||
const route = useRoute()
|
||||
const {
|
||||
|
|
@ -177,7 +178,12 @@ const playAnswerText = (text: string) => {
|
|||
}
|
||||
applicationApi
|
||||
.postTextToSpeech(id || (props.applicationId as string), { text: text }, loading)
|
||||
.then((res: any) => {
|
||||
.then(async (res: any) => {
|
||||
if (res.type === 'application/json') {
|
||||
const text = await res.text()
|
||||
MsgError(text)
|
||||
return
|
||||
}
|
||||
// 假设我们有一个 MP3 文件的字节数组
|
||||
// 创建 Blob 对象
|
||||
const blob = new Blob([res], { type: 'audio/mp3' })
|
||||
|
|
|
|||
Loading…
Reference in New Issue