From 451be0c81ce3cb57fcdd0cc59d83af6dac8a9e3a Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Tue, 15 Oct 2024 16:16:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=AB=98=E7=BA=A7=E7=BC=96=E6=8E=92?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E7=BB=93=E6=9E=9C=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E9=A2=98=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search_dataset_node/impl/base_search_dataset_node.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/application/flow/step_node/search_dataset_node/impl/base_search_dataset_node.py b/apps/application/flow/step_node/search_dataset_node/impl/base_search_dataset_node.py index 3113848e3..6f778c454 100644 --- a/apps/application/flow/step_node/search_dataset_node/impl/base_search_dataset_node.py +++ b/apps/application/flow/step_node/search_dataset_node/impl/base_search_dataset_node.py @@ -62,9 +62,12 @@ class BaseSearchDatasetNode(ISearchDatasetStepNode): result = sorted(result, key=lambda p: p.get('similarity'), reverse=True) return NodeResult({'paragraph_list': result, 'is_hit_handling_method_list': [row for row in result if row.get('is_hit_handling_method')], - 'data': '\n'.join([paragraph.get('content') for paragraph in paragraph_list]), - 'directly_return': '\n'.join([paragraph.get('content') for paragraph in result if - paragraph.get('is_hit_handling_method')]), + 'data': '\n'.join( + [f"{paragraph.get('title', '')}:{paragraph.get('content')}" for paragraph in + paragraph_list]), + 'directly_return': '\n'.join( + [f"{paragraph.get('title', '')}:{paragraph.get('content')}" for paragraph in result if + paragraph.get('is_hit_handling_method')]), 'question': question}, {})