fix 法规对话模块
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user