mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: Raise error when can not generate prompt
This commit is contained in:
parent
8f16358e20
commit
f943cc52bb
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue