Commit 25ba4ac4 authored by Joel's avatar Joel

feat: show agent show

parent 83695999
...@@ -258,7 +258,7 @@ export const upload = (fetchOptions: any): Promise<any> => { ...@@ -258,7 +258,7 @@ export const upload = (fetchOptions: any): Promise<any> => {
}) })
} }
export const ssePost = (url: string, fetchOptions: any, { onData, onCompleted, onError }: IOtherOptions) => { export const ssePost = (url: string, fetchOptions: any, { onData, onCompleted, onThought, onFile, onMessageEnd, onMessageReplace, onError }: IOtherOptions) => {
const options = Object.assign({}, baseOptions, { const options = Object.assign({}, baseOptions, {
method: 'POST', method: 'POST',
}, fetchOptions) }, fetchOptions)
...@@ -290,7 +290,7 @@ export const ssePost = (url: string, fetchOptions: any, { onData, onCompleted, o ...@@ -290,7 +290,7 @@ export const ssePost = (url: string, fetchOptions: any, { onData, onCompleted, o
onData?.(str, isFirstMessage, moreInfo) onData?.(str, isFirstMessage, moreInfo)
}, () => { }, () => {
onCompleted?.() onCompleted?.()
}) }, onThought, onMessageEnd, onMessageReplace, onFile)
}).catch((e) => { }).catch((e) => {
Toast.notify({ type: 'error', message: e }) Toast.notify({ type: 'error', message: e })
onError?.(e) onError?.(e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment