feat: Raise error when can not generate prompt
parent
8f16358e20
commit
f943cc52bb
|
|
@ -309,6 +309,12 @@ const getWrite = (reader: any) => {
|
||||||
if (split) {
|
if (split) {
|
||||||
for (const index in split) {
|
for (const index in split) {
|
||||||
const chunk = JSON?.parse(split[index].replace('data:', ''))
|
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) {
|
if (!chunk.is_end) {
|
||||||
// 实时将新接收的内容添加到完整内容中
|
// 实时将新接收的内容添加到完整内容中
|
||||||
fullContent.value += chunk.content
|
fullContent.value += chunk.content
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue