Commit a39d83db authored by 박민석's avatar 박민석

rollback

parent 93b93bf2
Pipeline #21093 passed with stages
in 3 minutes and 45 seconds
...@@ -189,23 +189,24 @@ ...@@ -189,23 +189,24 @@
body: JSON.stringify(payload), body: JSON.stringify(payload),
}) })
.then((response) => { .then((response) => {
const reader = response.body?.getReader() // const reader = response.body?.getReader()
const decoder = new TextDecoder('utf-8') // const decoder = new TextDecoder('utf-8')
function readStream () { // function readStream () {
return reader?.read().then(({ done, value }) => { // return reader?.read().then(({ done, value }) => {
if (done) { // if (done) {
isLoading = false // isLoading = false
return // return
} // }
const chunk = decoder.decode(value, { stream: true }) // const chunk = decoder.decode(value, { stream: true })
messageItem.textContent += chunk // messageItem.textContent += chunk
chatBody.scrollTop = chatBody?.scrollHeight // chatBody.scrollTop = chatBody?.scrollHeight
return readStream() // return readStream()
}) // })
} // }
return readStream() // return readStream()
console.log(response)
}) })
.catch((error) => { .catch((error) => {
console.error('Chatbot Error', error) console.error('Chatbot Error', error)
......
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