diff --git a/apps/application/serializers/chat_message_serializers.py b/apps/application/serializers/chat_message_serializers.py index 355647032..13eae7cb1 100644 --- a/apps/application/serializers/chat_message_serializers.py +++ b/apps/application/serializers/chat_message_serializers.py @@ -33,7 +33,7 @@ class MessageManagement: return HumanMessage(content=message) return HumanMessage(content=( f'已知信息:{title}:{content} ' - '根据上述已知信息,简洁和专业的来回答用户的问题。如果无法从已知信息中得到答案,请说 “根据已知信息无法回答该问题” 或 “没有提供足够的相关信息”,不允许在答案中添加编造成分,答案请使用中文。 ' + '根据上述已知信息,请简洁和专业的来回答用户的问题。已知信息中的图片、链接地址和脚本语言请直接返回。如果无法从已知信息中得到答案,请说 “没有在知识库中查找到相关信息,建议咨询相关技术支持或参考官方文档进行操作” 或 “根据已知信息无法回答该问题,建议联系官方技术支持人员”,不允许在答案中添加编造成分,答案请使用中文。' f'问题是:{message}')) diff --git a/apps/common/util/split_model.py b/apps/common/util/split_model.py index bc5f4df12..d9e06424e 100644 --- a/apps/common/util/split_model.py +++ b/apps/common/util/split_model.py @@ -331,11 +331,12 @@ class SplitModel: :return: 解析后数据 {content:段落数据,keywords:[‘段落关键词’],parent_chain:['段落父级链路']} """ result_tree = self.parse_to_tree(text.replace('\r', '\n'), 0) - return result_tree_to_paragraph(result_tree, [], []) + result = result_tree_to_paragraph(result_tree, [], []) + return [{**item, 'title': item.get('title').replace("#", '') if 'title' in item else ''} for item in result] default_split_pattern = { - 'md': [re.compile("^# .*"), re.compile('(?