From 518cddbd1cbe7dbbef1aaabdfa55dad101c87f10 Mon Sep 17 00:00:00 2001 From: Blizzard Date: Mon, 20 Jul 2026 15:29:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E6=A3=80=E7=B4=A2=E8=AF=95?= =?UTF-8?q?=E9=AA=8C=E5=8F=B0=E5=88=86=E8=B7=AF=E5=8D=A1=E7=89=87=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=AF=B4=E6=98=8E"=E4=B8=BA=E4=BB=80=E4=B9=88?= =?UTF-8?q?=E7=A9=BA"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 此前四张卡片一律写"这一路没召回",而人的视线落在卡片上、不在顶部状态行。 现在按该路诊断分别显示:未启用给出缺什么配置(琥珀)、报错给出错误原文(红)、 真没匹配才说没召回。 真环境验证(截图为证):向量="该知识库在 Milvus 中没有向量(未入库或集合被 重建过)"、图谱="未启用:Neo4j 未连接或未配置"、全文="索引里确实没有匹配内容"。 Co-Authored-By: Claude Opus 4.8 --- .../src/components/RetrievalBench.tsx | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sundynix-admin/src/components/RetrievalBench.tsx b/sundynix-admin/src/components/RetrievalBench.tsx index 6379842..e0593e2 100644 --- a/sundynix-admin/src/components/RetrievalBench.tsx +++ b/sundynix-admin/src/components/RetrievalBench.tsx @@ -162,9 +162,11 @@ export function RetrievalBench({ kbs }: { kbs: DatasourceKB[] }) { 分路诊断(分数体系不同,勿跨路比大小)
- {ROUTES.map((r) => ( - - ))} + {ROUTES.map((r) => { + // 单路那次请求里,取它自己那一路的诊断(RRF 融合没有单独一路,故为空) + const diag = res[r.mode]?.routes?.find((d) => d.name === r.mode); + return ; + })}
@@ -177,11 +179,13 @@ function RouteCard({ label, hint, data, + diag, highlight, }: { label: string; hint: string; - data?: { hits: KbHit[]; err?: string }; + data?: { hits: KbHit[]; routes?: RouteDiag[]; err?: string }; + diag?: RouteDiag; highlight?: boolean; }) { const hits = data?.hits ?? []; @@ -198,7 +202,14 @@ function RouteCard({ {data?.err ? (

{data.err}

) : hits.length === 0 ? ( -

这一路没召回

+ // 空的原因比"空"本身重要:没配置 / 报错 / 确实没匹配,处理方式完全不同 +

+ {diag?.status === "disabled" + ? `未启用:${diag.note || "该路未配置"}` + : diag?.status === "error" + ? `报错:${diag.error}` + : diag?.note || "这一路没召回(索引里确实没有匹配内容)"} +

) : (
    {hits.map((h, i) => (