舌象原图要求模型直接观察,去掉误导性的图片识别说明

- TcmEvidenceGuard:提示词改为直接观察附带的舌象/望诊原图并描述所见,单张不清只说明该张,不再把全部望诊判为未知
- DifyChatService:本地文字识别不可用或无文字时不再给图片附加“未取得可用原文”说明,原图照常携带
- 同步更新 TcmEvidenceGuardTaskAnalysisR37Test 断言

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gr
2026-10-27 15:12:24 +08:00
co-authored by Claude Opus 5.5
parent c3c37e1650
commit f0f555f20f
3 changed files with 7 additions and 7 deletions
@@ -263,7 +263,8 @@ final class TcmEvidenceGuard
return "【本次证据范围】继续完成指定任务,对现有病程、检查、用药和风险给出有据分析。"
. ($missing !== '' ? '本次尚缺可核验的' . $missing . ';只限制依赖这些证据的判断,不意味着其他资料不能分析。'
: '舌象及症状是否有记录仅表示资料覆盖,不证明诊断或方药成立。')
. ($images > 0 ? '本次有' . $images . '份图片附件引用;引用数量不等于已访问、已读取或已确认舌质舌苔。优先核验已有附件,无法读取时如实说明。' : '')
. ($images > 0 ? '本次随请求附带' . $images . '份舌象/望诊原图,请直接观察图片:能看到舌体时描述舌质、舌色、舌形、苔色、苔质厚薄润燥并作为本次望诊依据;'
. '仅能看到面部、手掌等时描述可见的面色、神态、掌色等望诊所见;某张图看不到舌体或不清晰时只对该图如实说明,不因此把全部望诊判为未知。' : '')
. '逐项区分原始记录、推断和待核实条件,未知不写成正常或不存在;历史记录保留日期,不移作本次查体或当前用药。'
. '对证据不足的方向解释具体限制,仍完成其余可支持的分析;关键方证依据不足时不新增具体方药或剂量。'
. TcmConsultationPulsePolicy::instruction();
@@ -1087,10 +1087,9 @@ class DifyChatService
$physical = count(array_filter(array_slice($items, 0, $local + 1), static fn (array $item): bool =>
!in_array($item['status'] ?? '', ['skipped', 'omitted', 'rejected'], true)));
$label = '原始附件#' . (int) $source['index'] . '(' . $source['label'] . '),本次实际附件' . $physical;
if ($check['status'] !== 'processed') {
$lines[] = $label . ':本地文字识别未取得可用原文;原图仍已携带,不能据此补写数字。';
continue;
}
// 舌象等照片本就没有文字;识别不可用/无文字时不再附加说明,
// 否则模型会误以为原图未读取而把舌象判为未知。原图照常携带。
if ($check['status'] !== 'processed') continue;
$rows = [];
foreach (($check['lines'] ?? []) as $row) {
if (!is_array($row) || !is_string($row['text'] ?? null) || !is_numeric($row['confidence'] ?? null)) continue;
@@ -62,8 +62,8 @@ $imageLimits = TcmEvidenceGuard::limitationsPrompt($withImages);
guardR37($withImages['current_tongue_images']['reference_count'] === 1
&& !$withImages['current_tongue_images']['content_read']
&& !$withImages['current_tongue_images']['tongue_appearance_verified'], 'Image references never certify access or visual conclusions.');
guardR37(str_contains($imageLimits, '引用数量不等于已访问、已读取或已确认舌质舌苔')
&& str_contains($imageLimits, '优先核验已有附件'), 'Existing image references are acknowledged before requesting new capture.');
guardR37(str_contains($imageLimits, '请直接观察图片')
&& str_contains($imageLimits, '不因此把全部望诊判为未知'), 'Attached tongue images are observed directly, never dismissed as unread.');
guardR37(TcmEvidenceGuard::assess(['chief_complaint' => '口干。', 'tongue' => '舌淡红,苔薄白。'])['missing'] === [],
'Recorded tongue and symptoms remain complete without pulse.');
guardR37(serialize([$current, $source]) === $frozen, 'Prompt/review never changes source facts after processing.');