Skip to content

Commit

Permalink
second try
Browse files Browse the repository at this point in the history
  • Loading branch information
agt committed Apr 9, 2024
1 parent 0441b26 commit 3f6c28c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/lib/providers/openai/request.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,11 @@ export const chatRequest = async (
// Remove updating indicator
chatRequest.updating = 1 // hide indicator, but still signal we're updating
chatRequest.updatingMessage = ''
// console.log('ev.data', ev.data)
if (!chatResponse.hasFinished()) {
if (ev.data === '[DONE]') {
// ?? anything to do when "[DONE]"?
} else {
d=ev.data
d.replace(/^data: /, '')
const data = JSON.parse(d)
console.log('data', data)
const data = JSON.parse(ev.data)
window.setTimeout(() => { chatResponse.updateFromAsyncResponse(data) }, 1)
}
}
Expand Down

0 comments on commit 3f6c28c

Please sign in to comment.