Commit 8a2f44da authored by nick zheng's avatar nick zheng

fix: 对话结束时无标识符号进行转语音

parent 8846cb1a
......@@ -374,7 +374,7 @@ function handleSelectImage(cb: () => void) {
}
function sentenceExtract(messageId: string) {
const symbolRegExp = /[。!?;.!?;]/g
const symbolRegExp = /[。!?;.!?;~]/g
let sentenceDraft = assistantFullAnswerContent.value
.replace(/\s{5,}/gi, '')
.slice(currentReplyContentSentenceExtractIndex.value)
......@@ -421,6 +421,7 @@ function sentenceExtract(messageId: string) {
}
if (matchResult) matchExtract()
else if (!isAnswerResponseWait.value) matchExtract()
else setTimeout(() => sentenceExtract(messageId), 600)
}
......
......@@ -336,7 +336,7 @@ function handleSelectImage(cb: () => void) {
}
function sentenceExtract(messageId: string) {
const symbolRegExp = /[。!?;.!?;]/g
const symbolRegExp = /[。!?;.!?;~]/g
let sentenceDraft = assistantFullAnswerContent.value
.replace(/\s{5,}/gi, '')
.slice(currentReplyContentSentenceExtractIndex.value)
......@@ -383,6 +383,7 @@ function sentenceExtract(messageId: string) {
}
if (matchResult) matchExtract()
else if (!isAnswerResponseWait.value) matchExtract()
else setTimeout(() => sentenceExtract(messageId), 600)
}
......
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