feat: text generation application support run batch (#529)

This commit is contained in:
Joel
2023-07-07 10:35:05 +08:00
committed by GitHub
parent cde1797cc0
commit 11baff6740
24 changed files with 1017 additions and 180 deletions

View File

@@ -308,13 +308,13 @@ export const ssePost = (url: string, fetchOptions: any, { isPublicAPI = false, o
}
return handleStream(res, (str: string, isFirstMessage: boolean, moreInfo: IOnDataMoreInfo) => {
if (moreInfo.errorMessage) {
onError?.(moreInfo.errorMessage)
Toast.notify({ type: 'error', message: moreInfo.errorMessage })
return
}
onData?.(str, isFirstMessage, moreInfo)
}, onCompleted)
}).catch((e) => {
// debugger
Toast.notify({ type: 'error', message: e })
onError?.(e)
})