"backend/apps/webui/routers/auths.py" did not exist on "88e8f31c0709774eae5c8d7e00612e3f725f893c"
Commit 74496342 authored by Arman Ordookhani's avatar Arman Ordookhani
Browse files

Fix OpenRouter hearbeats breaking streaming

parent 1092ee9c
......@@ -31,6 +31,10 @@ async function* openAIStreamToIterator(
console.log(line);
if (line === 'data: [DONE]') {
yield { done: true, value: '' };
} if (line.startsWith(':')) {
// Events starting with : are comments https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format
// OpenRouter sends heartbeats like ": OPENROUTER PROCESSING"
continue
} else {
const data = JSON.parse(line.replace(/^data: /, ''));
console.log(data);
......
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