Skip to content

Commit 451be0c

Browse files
committedOct 15, 2024
feat: 高级编排检索结果字符串添加标题字段
1 parent 464aa13 commit 451be0c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎apps/application/flow/step_node/search_dataset_node/impl/base_search_dataset_node.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ def execute(self, dataset_id_list, dataset_setting, question,
6262
result = sorted(result, key=lambda p: p.get('similarity'), reverse=True)
6363
return NodeResult({'paragraph_list': result,
6464
'is_hit_handling_method_list': [row for row in result if row.get('is_hit_handling_method')],
65-
'data': '\n'.join([paragraph.get('content') for paragraph in paragraph_list]),
66-
'directly_return': '\n'.join([paragraph.get('content') for paragraph in result if
67-
paragraph.get('is_hit_handling_method')]),
65+
'data': '\n'.join(
66+
[f"{paragraph.get('title', '')}:{paragraph.get('content')}" for paragraph in
67+
paragraph_list]),
68+
'directly_return': '\n'.join(
69+
[f"{paragraph.get('title', '')}:{paragraph.get('content')}" for paragraph in result if
70+
paragraph.get('is_hit_handling_method')]),
6871
'question': question},
6972

7073
{})

0 commit comments

Comments
 (0)