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) {