From b559ec151fcac774a85e8095ea96a4af123b1fea Mon Sep 17 00:00:00 2001 From: Clivia <132346501+Yanyutin753@users.noreply.github.com> Date: Fri, 13 Sep 2024 19:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=94=AF=E6=8C=81o1-preview?= =?UTF-8?q?=E5=92=8Co1-mini=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index f9bfac7..769fda8 100644 --- a/main.py +++ b/main.py @@ -1301,10 +1301,10 @@ def data_fetcher(upstream_response, data_queue, stop_event, last_data_time, api_ end_index = buffer.index('\n\n') + 2 complete_data, buffer = buffer[:end_index], buffer[end_index:] try: - data_content = complete_data.replace('data', '').strip() + data_content = complete_data.replace('data: ', '').strip() if not data_content: continue - data_json = json.loads(complete_data.replace('data: ', '')) + data_json = json.loads(data_content) # print(f"data_json: {data_json}") message = data_json.get("message", {})