mirror of
https://github.com/yudaocode/yudao-ui-admin-vue3.git
synced 2026-04-19 13:28:39 +00:00
fix:【ai 大模型】模型返回异常时,空消息进行删除
This commit is contained in:
@@ -476,6 +476,10 @@ const doSendMessageStream = async (userMessage: ChatMessageVO) => {
|
|||||||
const { code, data, msg } = JSON.parse(res.data)
|
const { code, data, msg } = JSON.parse(res.data)
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
message.alert(`对话异常! ${msg}`)
|
message.alert(`对话异常! ${msg}`)
|
||||||
|
// 如果未接收到消息,则进行删除
|
||||||
|
if (receiveMessageFullText.value === '') {
|
||||||
|
activeMessageList.value.pop()
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,6 +515,7 @@ const doSendMessageStream = async (userMessage: ChatMessageVO) => {
|
|||||||
await scrollToBottom()
|
await scrollToBottom()
|
||||||
},
|
},
|
||||||
(error: any) => {
|
(error: any) => {
|
||||||
|
// 异常提示,并停止流
|
||||||
message.alert(`对话异常! ${error}`)
|
message.alert(`对话异常! ${error}`)
|
||||||
stopStream()
|
stopStream()
|
||||||
// 需要抛出异常,禁止重试
|
// 需要抛出异常,禁止重试
|
||||||
|
|||||||
Reference in New Issue
Block a user