mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add smooth streaming
This commit is contained in:
@ -45,7 +45,7 @@ import {
|
||||
import { getCustomStoppingStrings, persona_description_positions, power_user } from './power-user.js';
|
||||
import { SECRET_KEYS, secret_state, writeSecret } from './secrets.js';
|
||||
|
||||
import EventSourceStream from './sse-stream.js';
|
||||
import { getEventSourceStream } from './sse-stream.js';
|
||||
import {
|
||||
delay,
|
||||
download,
|
||||
@ -1772,7 +1772,7 @@ async function sendOpenAIRequest(type, messages, signal) {
|
||||
throw new Error(`Got response status ${response.status}`);
|
||||
}
|
||||
if (stream) {
|
||||
const eventStream = new EventSourceStream();
|
||||
const eventStream = getEventSourceStream();
|
||||
response.body.pipeThrough(eventStream);
|
||||
const reader = eventStream.readable.getReader();
|
||||
return async function* streamData() {
|
||||
|
Reference in New Issue
Block a user