feat(Capture): 归档后后台预生成大白话摘要,详情页秒开 + 兜底重试

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
link2026
2026-06-10 07:12:48 +08:00
parent 0a824610cf
commit 43cdde9bab
5 changed files with 184 additions and 8 deletions

View File

@@ -0,0 +1,26 @@
import Testing
@testable import
struct InsightPromptsTests {
@Test func reportSummaryPromptCarriesDataAndGuards() {
let p = InsightPrompts.reportPlainSummary(
title: "春季体检", typeLabel: "体检报告",
indicatorLines: "血红蛋白 118 g/L(参考 130-175)low")
#expect(p.contains("春季体检"))
#expect(p.contains("血红蛋白 118"))
#expect(p.contains("/no_think"))
#expect(p.contains("不诊断"))
#expect(!p.contains("患者"))
}
@Test func trendPromptCarriesDataAndGuards() {
let p = InsightPrompts.trendInsight(
title: "空腹血糖", unit: "mmol/L", rangeText: ",参考 3.9-6.1",
dataLines: "2026-05-01 5.2 / 2026-06-01 5.8")
#expect(p.contains("空腹血糖"))
#expect(p.contains("2026-06-01 5.8"))
#expect(p.contains("/no_think"))
#expect(!p.contains("患者"))
}
}