mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: 高级编排检索结果字符串添加标题字段
This commit is contained in:
parent
464aa13d2e
commit
451be0c81c
|
|
@ -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},
|
||||
|
||||
{})
|
||||
|
|
|
|||
Loading…
Reference in New Issue