From 87d9ab789c1ac6485a01e7dfebaf11db81338209 Mon Sep 17 00:00:00 2001 From: taylorxie Date: Mon, 9 Mar 2026 23:01:29 +0800 Subject: [PATCH] add --- maubot_llmplus/thrid_platform.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maubot_llmplus/thrid_platform.py b/maubot_llmplus/thrid_platform.py index 3aa74ac..308818d 100644 --- a/maubot_llmplus/thrid_platform.py +++ b/maubot_llmplus/thrid_platform.py @@ -184,7 +184,10 @@ class Anthropic(Platform): async with self.http.post(endpoint, headers=headers, data=json.dumps(req_body)) as response: if response.status != 200: raise ValueError(f"Error: {await response.text()}") - async for line_bytes in response.content.iter_lines(): + while True: + line_bytes = await response.content.readline() + if not line_bytes: + break line = line_bytes.decode("utf-8").strip() if not line.startswith("data: "): continue