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(() => { ...@@ -86,10 +86,6 @@ const isUploadFileDisabled = computed(() => {
return uploadFileList.value.length === 1 return uploadFileList.value.length === 1
}) })
const isEnableVoice = computed(() => {
return !!personalAppConfigStore.voiceConfig.timbreId
})
const uploadFileIcon = (type: string) => { const uploadFileIcon = (type: string) => {
return `https://gsst-poe-sit.gz.bcebos.com/icon/${type}.svg` return `https://gsst-poe-sit.gz.bcebos.com/icon/${type}.svg`
} }
...@@ -124,6 +120,7 @@ function messageItemFactory(): ConversationMessageItem { ...@@ -124,6 +120,7 @@ function messageItemFactory(): ConversationMessageItem {
isVoiceLoading: false, isVoiceLoading: false,
isVoicePlaying: false, isVoicePlaying: false,
voiceFragmentUrlList: [], voiceFragmentUrlList: [],
isVoiceEnabled: false,
} }
} }
...@@ -188,12 +185,15 @@ function handleMessageSend() { ...@@ -188,12 +185,15 @@ function handleMessageSend() {
sentenceSpeechException.value = false sentenceSpeechException.value = false
messageAudioLoading.value = false messageAudioLoading.value = false
const isVoiceEnabled = !!personalAppConfigStore.voiceConfig.timbreId
emit('addMessageItem', latestAssistantMessageKey, { emit('addMessageItem', latestAssistantMessageKey, {
...messageItemFactory(), ...messageItemFactory(),
role: 'assistant', role: 'assistant',
isTextContentLoading: true, isTextContentLoading: true,
isAnswerResponseLoading: true, isAnswerResponseLoading: true,
isVoiceLoading: true, isVoiceLoading: true,
isVoiceEnabled,
}) })
emit('updatePageScroll') emit('updatePageScroll')
...@@ -231,7 +231,7 @@ function handleMessageSend() { ...@@ -231,7 +231,7 @@ function handleMessageSend() {
'', '',
) )
if (!sentenceExtractCheckEnabled.value && isEnableVoice.value) { if (!sentenceExtractCheckEnabled.value && isVoiceEnabled) {
sentenceExtract(latestAssistantMessageKey) sentenceExtract(latestAssistantMessageKey)
sentenceExtractCheckEnabled.value = true sentenceExtractCheckEnabled.value = true
messageAudioLoading.value = true messageAudioLoading.value = true
......
...@@ -31,10 +31,6 @@ const assistantAvatar = computed(() => { ...@@ -31,10 +31,6 @@ const assistantAvatar = computed(() => {
return personalAppConfigStore.baseInfo.agentAvatar return personalAppConfigStore.baseInfo.agentAvatar
}) })
const timbreEnabled = computed(() => {
return !!personalAppConfigStore.voiceConfig.timbreId
})
const isShowAudioControl = computed(() => { const isShowAudioControl = computed(() => {
return props.role === 'assistant' && !props.messageItem.isVoiceLoading return props.role === 'assistant' && !props.messageItem.isVoiceLoading
}) })
...@@ -44,7 +40,7 @@ const isPlayableAudio = computed(() => { ...@@ -44,7 +40,7 @@ const isPlayableAudio = computed(() => {
}) })
const isShowVoiceLoading = 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() { function handleAudioControl() {
......
...@@ -251,10 +251,14 @@ async function handleSettingAgent(autoConfigInputValue: string) { ...@@ -251,10 +251,14 @@ async function handleSettingAgent(autoConfigInputValue: string) {
handleAIGeneratePreamble(), handleAIGeneratePreamble(),
handleAIGenerateFeaturedQuestions(), handleAIGenerateFeaturedQuestions(),
handleAIGenerateAgentSystem(), handleAIGenerateAgentSystem(),
]).finally(() => { ])
isFullScreenLoading.value = false .finally(() => {
emitter?.emit('resetAgent') isFullScreenLoading.value = false
}) emitter?.emit('resetAgent')
})
.catch(() => {
handleStopGenerate()
})
}) })
.catch(() => { .catch(() => {
isFullScreenLoading.value = false isFullScreenLoading.value = false
......
...@@ -8,4 +8,5 @@ declare interface ConversationMessageItem { ...@@ -8,4 +8,5 @@ declare interface ConversationMessageItem {
isVoiceLoading: boolean isVoiceLoading: boolean
isVoicePlaying: boolean isVoicePlaying: boolean
voiceFragmentUrlList: string[] 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