From 7793d945149c6cedd340389daf28fb7d0520691d Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Tue, 10 Jun 2025 18:20:03 +0800 Subject: [PATCH] fix: deepseek rate limit keep-alive --- src/chatgpt.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/chatgpt.ts b/src/chatgpt.ts index 2e72fc2..d6d6c1e 100644 --- a/src/chatgpt.ts +++ b/src/chatgpt.ts @@ -338,6 +338,9 @@ class Chat { console.log("line", line); try { const jsonStr = line.slice("data:".length).trim(); + if (jsonStr === "keep-alive") { // for deepseek https://api-docs.deepseek.com/quick_start/rate_limit + continue; + } const json = JSON.parse(jsonStr) as StreamingResponseChunk; yield json; } catch (e) {