forked from open-webui/open-webui
feat: switch OpenAI SSE parsing to eventsource-parser
This commit is contained in:
parent
3f0fae1d10
commit
e8bf596959
5 changed files with 40 additions and 44 deletions
|
@ -605,14 +605,8 @@
|
|||
|
||||
scrollToBottom();
|
||||
|
||||
if (res && res.ok) {
|
||||
const reader = res.body
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(splitStream('\n'))
|
||||
.getReader();
|
||||
|
||||
const textStream = await createOpenAITextStream(reader, $settings.splitLargeChunks);
|
||||
console.log(textStream);
|
||||
if (res && res.ok && res.body) {
|
||||
const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks);
|
||||
|
||||
for await (const update of textStream) {
|
||||
const { value, done } = update;
|
||||
|
|
|
@ -617,14 +617,8 @@
|
|||
|
||||
scrollToBottom();
|
||||
|
||||
if (res && res.ok) {
|
||||
const reader = res.body
|
||||
.pipeThrough(new TextDecoderStream())
|
||||
.pipeThrough(splitStream('\n'))
|
||||
.getReader();
|
||||
|
||||
const textStream = await createOpenAITextStream(reader, $settings.splitLargeChunks);
|
||||
console.log(textStream);
|
||||
if (res && res.ok && res.body) {
|
||||
const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks);
|
||||
|
||||
for await (const update of textStream) {
|
||||
const { value, done } = update;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue