feat: stop response call api (#340)

This commit is contained in:
Joel 2023-06-12 16:37:03 +08:00 • committed by GitHub
commit b16a7b0b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 8 deletions

View file

@ -23,7 +23,8 @@ const baseOptions = {
}
export type IOnDataMoreInfo = {
conversationId: string | undefined
conversationId?: string
taskId?: string
messageId: string
errorMessage?: string
}
@ -101,6 +102,7 @@ const handleStream = (response: any, onData: IOnData, onCompleted?: IOnCompleted
// can not use format here. Because message is splited.
onData(unicodeToChar(bufferObj.answer), isFirstMessage, {
conversationId: bufferObj.conversation_id,
taskId: bufferObj.task_id,
messageId: bufferObj.id,
})
isFirstMessage = false