feat: implement chat history and retrieval settings

- Added new API endpoints for managing chat history configuration and retrieval settings, allowing tenants to enable message indexing and configure search parameters.
- Introduced new Vue components for ChatHistorySettings and RetrievalSettings, providing a user-friendly interface for managing these configurations.
- Updated localization files to include new settings descriptions and labels in multiple languages.
- Enhanced the KnowledgeSearch view to support searching across both knowledge bases and chat history, improving the overall search functionality.

These changes significantly enhance the application's capabilities in managing and retrieving chat history, contributing to a more robust user experience.
This commit is contained in:
wizardchen
2026-03-06 21:06:10 +08:00
committed by lyingbug
parent c516d1f9bd
commit 1fb2bedd2b
27 changed files with 2755 additions and 199 deletions
+48 -3
View File
@@ -14,7 +14,7 @@ export default {
newSession: "新会话",
confirmLogout: "确定要退出登录吗?",
systemInfo: "系统信息",
knowledgeSearch: "知识搜索",
knowledgeSearch: "搜索",
collapseSidebar: "收起侧边栏",
expandSidebar: "展开侧边栏",
logoutSuccess: "已退出登录",
@@ -538,6 +538,45 @@ export default {
saveFailed: "保存配置失败: {message}",
},
},
chatHistorySettings: {
title: "消息管理",
description: "配置聊天历史知识库,将对话消息自动向量化索引,实现语义搜索",
enableLabel: "启用消息索引",
enableDescription: "开启后,新的对话消息将自动索引到知识库,支持向量搜索",
embeddingModelLabel: "Embedding 模型",
embeddingModelDescription: "选择用于消息向量化的 Embedding 模型",
embeddingModelLocked: "已有消息被索引,Embedding 模型不可修改(修改需清空索引数据)",
statsTitle: "索引统计",
statsIndexedMessages: "已索引消息",
statsNotConfigured: "消息索引未配置",
statsNotConfiguredDesc: "启用并选择 Embedding 模型后,对话消息将自动向量化索引",
toasts: {
saveSuccess: "消息管理配置已保存",
saveFailed: "保存配置失败: {message}",
loadFailed: "加载配置失败: {message}",
},
},
retrievalSettings: {
title: "搜索设置",
description: "配置知识库搜索和消息搜索的全局检索参数",
embeddingTopKLabel: "向量检索数量 (Top K)",
embeddingTopKDescription: "向量搜索返回的最大结果数量",
vectorThresholdLabel: "向量相似度阈值",
vectorThresholdDescription: "向量搜索的最低相似度分数(0-1,越高越精确)",
keywordThresholdLabel: "关键词匹配阈值",
keywordThresholdDescription: "关键词搜索的最低匹配分数(0-1)",
rerankTopKLabel: "Rerank 数量 (Top K)",
rerankTopKDescription: "重排序后保留的最大结果数量",
rerankThresholdLabel: "Rerank 阈值",
rerankThresholdDescription: "重排序的最低分数阈值(0-1)",
rerankModelLabel: "Rerank 模型",
rerankModelDescription: "选择用于搜索结果重排序的模型",
rerankModelRequired: "请选择 Rerank 模型,搜索功能需要此模型对结果进行重排序",
toasts: {
saveSuccess: "检索配置已保存",
saveFailed: "保存配置失败: {message}",
},
},
graphSettings: {
title: "知识图谱配置",
description: "配置实体关系提取功能,自动从文本中提取实体和关系构建知识图谱",
@@ -2920,9 +2959,12 @@ export default {
unsupportedHint: "请下载文件后使用本地应用查看",
},
knowledgeSearch: {
title: "知识搜索",
subtitle: "在知识库中进行语义检索,快速查找相关内容",
title: "搜索",
subtitle: "在知识库和历史对话中进行语义检索,快速查找相关内容",
tabKnowledge: "知识搜索",
tabMessages: "消息搜索",
placeholder: "输入搜索内容...",
messagePlaceholder: "搜索历史对话消息...",
searchBtn: "搜索",
selectKb: "选择知识库",
allKb: "全部知识库",
@@ -2932,7 +2974,10 @@ export default {
matchType: "匹配类型",
matchTypeVector: "向量匹配",
matchTypeKeyword: "关键词匹配",
untitledSession: "未命名对话",
matchCount: "条匹配",
emptyHint: "输入关键词,在知识库中搜索相关内容片段",
messageEmptyHint: "输入关键词,搜索历史对话消息",
searching: "搜索中...",
source: "来源",
chunk: "个片段",