From 17ec5c5f77f01c2f8d6046b18b7ef781c5f72103 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Tue, 24 Jun 2025 00:14:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E5=BA=93=E6=A3=80=E7=B4=A2=E7=BB=93=E6=9E=9C=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=BC=BA=E6=96=87=E4=BB=B6=E5=88=86=E7=BB=84?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=92=8C=E8=AF=A6=E7=BB=86=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 KnowledgeBaseResult.vue 以按文件名聚合文档片段,提升用户体验。 - 添加文件级别的展开/折叠功能,允许用户查看每个文件的具体片段。 - 新增弹窗展示选中片段的详细信息,包括相似度和重排序分数。 - 调整样式以改善视觉效果和交互体验。 --- .../ToolCallingResult/KnowledgeBaseResult.vue | 451 +++++++++++++----- 1 file changed, 334 insertions(+), 117 deletions(-) diff --git a/web/src/components/ToolCallingResult/KnowledgeBaseResult.vue b/web/src/components/ToolCallingResult/KnowledgeBaseResult.vue index f8a986cd..c3d619c5 100644 --- a/web/src/components/ToolCallingResult/KnowledgeBaseResult.vue +++ b/web/src/components/ToolCallingResult/KnowledgeBaseResult.vue @@ -3,50 +3,54 @@

知识库检索结果

- 找到 {{ data.length }} 个相关文档片段 + 找到 {{ data.length }} 个相关文档片段,来自 {{ fileGroups.length }} 个文件
-
-
#{{ index + 1 }}
-
+ +
+
- {{ result.file.filename }} + {{ fileGroup.filename }} + {{ fileGroup.chunks.length }} chunks
-
ID: {{ result.id }}
-
- -
-
- 相似度: - - {{ result.distance.toFixed(4) }} -
- -
- 重排序: - - {{ result.rerank_score.toFixed(4) }} +
+
-
-
{{ result.entity.text }}
+ +
+
+
+ #{{ index + 1 }} +
+ 相似度 {{ (chunk.distance * 100).toFixed(0) }}% + 重排序 {{ (chunk.rerank_score * 100).toFixed(0) }}% +
+ {{ getPreviewText(chunk.entity.text) }} + +
+
@@ -54,11 +58,56 @@

未找到相关知识库内容

+ + + +
+
+
+
+
相似度分数
+
{{ (selectedChunk.data.distance * 100).toFixed(1) }}%
+ +
+
+
重排序分数
+
{{ (selectedChunk.data.rerank_score * 100).toFixed(1) }}%
+ +
+
+
+ ID: {{ selectedChunk.data.id }} +
+
+ +
+
文档内容
+
{{ selectedChunk.data.entity.text }}
+
+
+