fix 法规对话模块

This commit is contained in:
2026-05-20 23:39:15 +08:00
parent b065d55c86
commit 1b640f0084

View File

@@ -116,14 +116,17 @@ class DeepSeekClient(BaseLLMClient):
with self._client.stream("POST", "/chat/completions", json=payload) as response: with self._client.stream("POST", "/chat/completions", json=payload) as response:
response.raise_for_status() response.raise_for_status()
for line in response.iter_lines(): for line in response.iter_lines():
if not line or line.startswith(b":"): if not line:
continue continue
line_str = line.decode("utf-8").strip() line = line.strip()
if not line_str.startswith("data: "): if line.startswith(":"):
continue continue
data_str = line_str[6:] if not line.startswith("data: "):
continue
data_str = line[6:]
if data_str == "[DONE]": if data_str == "[DONE]":
break break