This commit is contained in:
Your Name
2026-10-08 18:03:11 +08:00
parent 4dac39c4c2
commit 19ea2dadeb
26 changed files with 1131 additions and 28 deletions
@@ -77,8 +77,9 @@ class DifyChatService
return self::error('CONFIG_INVALID', 'AI 模型配置无效');
}
$ancientBookSources = ClinicalKnowledgeReference::ancientBookSources($query);
try {
$query = NihaixiaClinicalSkill::augmentQuery($query);
$query = ClinicalKnowledgeReference::augmentQuery($query);
} catch (\RuntimeException $error) {
return self::error('SKILL_UNAVAILABLE', '临床 AI 参考资料不可用');
}
@@ -163,6 +164,7 @@ class DifyChatService
$formatted = self::formatResponse($lastResponse, $startedAt);
self::logUpstreamFailure($lastSpec, $lastResponse, $query, $attempt['files'], $formatted);
if (!empty($formatted['ok'])) {
$formatted['ancient_book_sources'] = $ancientBookSources;
if ($strictFiles) {
$formatted['transmitted_file_count'] = count($attempt['files']);
$formatted['attachment_transport'] = (string) ($lastSpec['protocol'] ?? '');
@@ -235,8 +237,9 @@ class DifyChatService
return self::error('CONFIG_INVALID', 'AI 模型配置无效');
}
$ancientBookSources = ClinicalKnowledgeReference::ancientBookSources($query);
try {
$query = NihaixiaClinicalSkill::augmentQuery($query);
$query = ClinicalKnowledgeReference::augmentQuery($query);
} catch (\RuntimeException $error) {
return self::error('SKILL_UNAVAILABLE', '临床 AI 参考资料不可用');
}
@@ -311,6 +314,7 @@ class DifyChatService
$formatted = self::formatStreamResponse($lastResponse, $startedAt);
self::logUpstreamFailure($lastSpec, $lastResponse, $query, $attempt['files'], $formatted);
if (!empty($formatted['ok'])) {
$formatted['ancient_book_sources'] = $ancientBookSources;
return $formatted;
}
if (