From dedfd31e5cfb087808d46d776bfef4c02f53f97f Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:11:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E5=88=86=E6=AE=B5=E6=8C=87=E5=AE=9A=E5=9B=9E=E7=AD=94?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=97=AE=E9=A2=98=20#317=20(#319)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat_pipeline/step/chat_step/impl/base_chat_step.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/application/chat_pipeline/step/chat_step/impl/base_chat_step.py b/apps/application/chat_pipeline/step/chat_step/impl/base_chat_step.py index 74c60d1f0..276d01947 100644 --- a/apps/application/chat_pipeline/step/chat_step/impl/base_chat_step.py +++ b/apps/application/chat_pipeline/step/chat_step/impl/base_chat_step.py @@ -142,7 +142,7 @@ class BaseChatStep(IChatStep): paragraph.hit_handling_method == 'directly_return'] if directly_return_chunk_list is not None and len(directly_return_chunk_list) > 0: return iter(directly_return_chunk_list), False - elif no_references_setting.get( + elif len(paragraph_list) == 0 and no_references_setting.get( 'status') == 'designated_answer': return iter([AIMessageChunk(content=no_references_setting.get('value'))]), False if chat_model is None: @@ -185,7 +185,7 @@ class BaseChatStep(IChatStep): paragraph.hit_handling_method == 'directly_return'] if directly_return_chunk_list is not None and len(directly_return_chunk_list) > 0: return directly_return_chunk_list[0], False - elif no_references_setting.get( + elif len(paragraph_list) == 0 and no_references_setting.get( 'status') == 'designated_answer': return AIMessage(no_references_setting.get('value')), False if chat_model is None: