38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace app\common\service;
|
|
|
|
/** Single entry point for references attached to clinical model requests. */
|
|
final class ClinicalKnowledgeReference
|
|
{
|
|
public static function augmentQuery(string $query): string
|
|
{
|
|
return TcmAncientBooksReference::augmentQuery(NihaixiaClinicalSkill::augmentQuery($query));
|
|
}
|
|
|
|
/** @param list<array<string,mixed>> $ancientBookSources */
|
|
public static function augmentQueryWithAncientBookSources(string $query, array $ancientBookSources): string
|
|
{
|
|
return TcmAncientBooksReference::augmentQueryWithSources(
|
|
NihaixiaClinicalSkill::augmentQuery($query),
|
|
$ancientBookSources
|
|
);
|
|
}
|
|
|
|
/** @param array<int,array<string,mixed>> $messages
|
|
* @return array<int,array<string,mixed>>
|
|
*/
|
|
public static function augmentMessages(array $messages): array
|
|
{
|
|
return TcmAncientBooksReference::augmentMessages(NihaixiaClinicalSkill::augmentMessages($messages));
|
|
}
|
|
|
|
/** @return list<array<string,mixed>> */
|
|
public static function ancientBookSources(string $query): array
|
|
{
|
|
return TcmAncientBooksReference::sourcesForText($query);
|
|
}
|
|
}
|