feat: Raise error when can not generate prompt

This commit is contained in:
zhangzhanwei 2025-09-29 18:01:56 +08:00 committed by zhanweizhang7
parent 8f16358e20
commit f943cc52bb

View File

@ -309,6 +309,12 @@ const getWrite = (reader: any) => {
if (split) {
for (const index in split) {
const chunk = JSON?.parse(split[index].replace('data:', ''))
if (chunk.error) {
loading.value = false
stopStreaming()
middleAnswer.content = chunk.error
return Promise.reject(new Error(chunk.error))
}
if (!chunk.is_end) {
//
fullContent.value += chunk.content