This commit is contained in:
Your Name
2026-10-22 16:42:26 +08:00
parent 7982aab721
commit 14abf67d0d
17 changed files with 1179 additions and 54 deletions
@@ -77,9 +77,14 @@ class DifyChatService
return self::error('CONFIG_INVALID', 'AI 模型配置无效');
}
$ancientBookSources = ClinicalKnowledgeReference::ancientBookSources($query);
// Evidence extraction is a server-selected intermediate operation, not a
// clinical synthesis. Do not inject book facts into source summaries.
$evidenceOnly = ($options['knowledge_mode'] ?? '') === 'evidence';
$ancientBookSources = $evidenceOnly ? [] : ClinicalKnowledgeReference::ancientBookSources($query);
try {
$query = ClinicalKnowledgeReference::augmentQueryWithAncientBookSources($query, $ancientBookSources);
if (!$evidenceOnly) {
$query = ClinicalKnowledgeReference::augmentQueryWithAncientBookSources($query, $ancientBookSources);
}
} catch (\RuntimeException $error) {
return self::error('SKILL_UNAVAILABLE', '临床 AI 参考资料不可用');
}