diff --git a/server/app/adminapi/service/TcmEvidenceGuard.php b/server/app/adminapi/service/TcmEvidenceGuard.php index b6301cd84..37b8fdfd5 100644 --- a/server/app/adminapi/service/TcmEvidenceGuard.php +++ b/server/app/adminapi/service/TcmEvidenceGuard.php @@ -263,7 +263,8 @@ final class TcmEvidenceGuard return "【本次证据范围】继续完成指定任务,对现有病程、检查、用药和风险给出有据分析。" . ($missing !== '' ? '本次尚缺可核验的' . $missing . ';只限制依赖这些证据的判断,不意味着其他资料不能分析。' : '舌象及症状是否有记录仅表示资料覆盖,不证明诊断或方药成立。') - . ($images > 0 ? '本次有' . $images . '份图片附件引用;引用数量不等于已访问、已读取或已确认舌质舌苔。优先核验已有附件,无法读取时如实说明。' : '') + . ($images > 0 ? '本次随请求附带' . $images . '份舌象/望诊原图,请直接观察图片:能看到舌体时描述舌质、舌色、舌形、苔色、苔质厚薄润燥并作为本次望诊依据;' + . '仅能看到面部、手掌等时描述可见的面色、神态、掌色等望诊所见;某张图看不到舌体或不清晰时只对该图如实说明,不因此把全部望诊判为未知。' : '') . '逐项区分原始记录、推断和待核实条件,未知不写成正常或不存在;历史记录保留日期,不移作本次查体或当前用药。' . '对证据不足的方向解释具体限制,仍完成其余可支持的分析;关键方证依据不足时不新增具体方药或剂量。' . TcmConsultationPulsePolicy::instruction(); diff --git a/server/app/common/service/DifyChatService.php b/server/app/common/service/DifyChatService.php index faa6a8093..13a26e030 100644 --- a/server/app/common/service/DifyChatService.php +++ b/server/app/common/service/DifyChatService.php @@ -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; diff --git a/server/tests/TcmEvidenceGuardTaskAnalysisR37Test.php b/server/tests/TcmEvidenceGuardTaskAnalysisR37Test.php index 037cc554e..b5ba86c88 100644 --- a/server/tests/TcmEvidenceGuardTaskAnalysisR37Test.php +++ b/server/tests/TcmEvidenceGuardTaskAnalysisR37Test.php @@ -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.');