Commit 3e5e4c1a authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

fix: 已发送的提问再添加音色不显示音频加载&AI自动配置失败后停止其他生成

See merge request !103
parents de8310fd 42029a86
......@@ -86,10 +86,6 @@ const isUploadFileDisabled = computed(() => {
return uploadFileList.value.length === 1
})
const isEnableVoice = computed(() => {
return !!personalAppConfigStore.voiceConfig.timbreId
})
const uploadFileIcon = (type: string) => {
return `https://gsst-poe-sit.gz.bcebos.com/icon/${type}.svg`
}
......@@ -124,6 +120,7 @@ function messageItemFactory(): ConversationMessageItem {
isVoiceLoading: false,
isVoicePlaying: false,
voiceFragmentUrlList: [],
isVoiceEnabled: false,
}
}
......@@ -188,12 +185,15 @@ function handleMessageSend() {
sentenceSpeechException.value = false
messageAudioLoading.value = false
const isVoiceEnabled = !!personalAppConfigStore.voiceConfig.timbreId
emit('addMessageItem', latestAssistantMessageKey, {
...messageItemFactory(),
role: 'assistant',
isTextContentLoading: true,
isAnswerResponseLoading: true,
isVoiceLoading: true,
isVoiceEnabled,
})
emit('updatePageScroll')
......@@ -231,7 +231,7 @@ function handleMessageSend() {
'',
)
if (!sentenceExtractCheckEnabled.value && isEnableVoice.value) {
if (!sentenceExtractCheckEnabled.value && isVoiceEnabled) {
sentenceExtract(latestAssistantMessageKey)
sentenceExtractCheckEnabled.value = true
messageAudioLoading.value = true
......
......@@ -31,10 +31,6 @@ const assistantAvatar = computed(() => {
return personalAppConfigStore.baseInfo.agentAvatar
})
const timbreEnabled = computed(() => {
return !!personalAppConfigStore.voiceConfig.timbreId
})
const isShowAudioControl = computed(() => {
return props.role === 'assistant' && !props.messageItem.isVoiceLoading
})
......@@ -44,7 +40,7 @@ const isPlayableAudio = computed(() => {
})
const isShowVoiceLoading = computed(() => {
return props.role === 'assistant' && props.messageItem.isVoiceLoading && timbreEnabled.value
return props.role === 'assistant' && props.messageItem.isVoiceLoading && props.messageItem.isVoiceEnabled
})
function handleAudioControl() {
......
......@@ -251,10 +251,14 @@ async function handleSettingAgent(autoConfigInputValue: string) {
handleAIGeneratePreamble(),
handleAIGenerateFeaturedQuestions(),
handleAIGenerateAgentSystem(),
]).finally(() => {
isFullScreenLoading.value = false
emitter?.emit('resetAgent')
})
])
.finally(() => {
isFullScreenLoading.value = false
emitter?.emit('resetAgent')
})
.catch(() => {
handleStopGenerate()
})
})
.catch(() => {
isFullScreenLoading.value = false
......
......@@ -8,4 +8,5 @@ declare interface ConversationMessageItem {
isVoiceLoading: boolean
isVoicePlaying: boolean
voiceFragmentUrlList: string[]
isVoiceEnabled?: boolean
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment