From 8a583f7c689fc3724474f6d1188d1ed30e987697 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Fri, 15 Aug 2025 16:12:42 +0800 Subject: [PATCH] 'commit' --- dsLightRag/Test/TestGoogleGemini.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dsLightRag/Test/TestGoogleGemini.py b/dsLightRag/Test/TestGoogleGemini.py index 889dfdc1..bb3d16d7 100644 --- a/dsLightRag/Test/TestGoogleGemini.py +++ b/dsLightRag/Test/TestGoogleGemini.py @@ -35,7 +35,6 @@ try: ) response.raise_for_status() # 检查请求是否成功 - print("流式响应内容:\n") # 逐块处理响应 for chunk in response.iter_content(chunk_size=None): if chunk: @@ -62,7 +61,7 @@ try: if 'choices' in data and len(data['choices']) > 0: delta = data['choices'][0].get('delta', {}) content = delta.get('content', '') - if content: + if content and content != '\n': # 实时输出内容,不换行 print(content, end='', flush=True)