Commit 4ad7ef84 authored by Arman Ordookhani's avatar Arman Ordookhani
Browse files

add else

parent 74496342
...@@ -31,7 +31,7 @@ async function* openAIStreamToIterator( ...@@ -31,7 +31,7 @@ async function* openAIStreamToIterator(
console.log(line); console.log(line);
if (line === 'data: [DONE]') { if (line === 'data: [DONE]') {
yield { done: true, value: '' }; yield { done: true, value: '' };
} if (line.startsWith(':')) { } else 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 // 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" // OpenRouter sends heartbeats like ": OPENROUTER PROCESSING"
continue continue
......
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