Skip to content

7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

TypeScript

fix(sse): accept no-space data: frames in the Google stream parser too (#1107)

Tashfeenfac3cbc4a6ba
diff --git a/server/src/providers/google.ts b/server/src/providers/google.ts
index e2a62b8e..f8122354 100644
--- a/server/src/providers/google.ts
+++ b/server/src/providers/google.ts
@@ -710,8 +710,9 @@ export class GoogleProvider extends BaseProvider {
for (const line of lines) {
const trimmed = line.trim();
- if (!trimmed || !trimmed.startsWith('data: ')) continue;
- const raw = trimmed.slice(6);
+ // `data:` with or without the space, same as BaseProvider (#1087).
+ if (!trimmed || !trimmed.startsWith('data:')) continue;
+ const raw = trimmed.slice(5).replace(/^ /, '');
if (raw === '[DONE]') {
if (!emittedFinish) {
emittedFinish = true;