fix 法规对话模块
This commit is contained in:
@@ -116,14 +116,17 @@ class DeepSeekClient(BaseLLMClient):
|
||||
with self._client.stream("POST", "/chat/completions", json=payload) as response:
|
||||
response.raise_for_status()
|
||||
for line in response.iter_lines():
|
||||
if not line or line.startswith(b":"):
|
||||
if not line:
|
||||
continue
|
||||
|
||||
line_str = line.decode("utf-8").strip()
|
||||
if not line_str.startswith("data: "):
|
||||
line = line.strip()
|
||||
if line.startswith(":"):
|
||||
continue
|
||||
|
||||
data_str = line_str[6:]
|
||||
if not line.startswith("data: "):
|
||||
continue
|
||||
|
||||
data_str = line[6:]
|
||||
if data_str == "[DONE]":
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user