更新
This commit is contained in:
@@ -52,6 +52,20 @@ ancientExpect(str_contains($augmented, NihaixiaClinicalSkill::VERSION), 'existin
|
||||
ancientExpect(str_ends_with($augmented, $query), 'original patient question remains intact');
|
||||
ancientExpect(ClinicalKnowledgeReference::augmentQuery($augmented) === $augmented, 'retry does not duplicate references');
|
||||
|
||||
foreach ([$query, '患者出现痛风症状。', '患者有未收录的症状。', '阶段=text 患者糖尿病', '阶段=final 患者糖尿病'] as $case) {
|
||||
$selected = ClinicalKnowledgeReference::ancientBookSources($case);
|
||||
ancientExpect(
|
||||
ClinicalKnowledgeReference::augmentQueryWithAncientBookSources($case, $selected)
|
||||
=== ClinicalKnowledgeReference::augmentQuery($case),
|
||||
'selected sources preserve the exact legacy prompt for each clinical case'
|
||||
);
|
||||
}
|
||||
ancientExpect(
|
||||
ClinicalKnowledgeReference::augmentQueryWithAncientBookSources('患者有未收录的症状。', [])
|
||||
=== ClinicalKnowledgeReference::augmentQuery('患者有未收录的症状。'),
|
||||
'an unrelated request receives no preceding patient citations'
|
||||
);
|
||||
|
||||
$messages = [['role' => 'user', 'content' => $query]];
|
||||
$wire = ClinicalKnowledgeReference::augmentMessages($messages);
|
||||
ancientExpect(count($wire) === 2 && str_contains($wire[0]['content'], '测试古籍'), 'chat receives reference in system message');
|
||||
|
||||
Reference in New Issue
Block a user