igengx
This commit is contained in:
@@ -51,7 +51,7 @@ class PatientAiReportLogic extends BaseLogic
|
||||
private const PROMPT_VERSION = 'patient-longitudinal-report-tcm-four-diagnoses-v7';
|
||||
|
||||
/** @var array<int,string> */
|
||||
private const MODEL_KEYS = ['qwen', 'openai'];
|
||||
private const MODEL_KEYS = ['qwen', 'openai', 'doubao'];
|
||||
|
||||
private const MAX_RESPONSE_BYTES = 65536;
|
||||
|
||||
@@ -174,7 +174,7 @@ class PatientAiReportLogic extends BaseLogic
|
||||
array $adminInfo
|
||||
): ?array {
|
||||
if (!in_array($modelKey, self::MODEL_KEYS, true)) {
|
||||
self::setError('AI模型仅支持qwen或openai');
|
||||
self::setError('AI模型仅支持qwen、openai或doubao');
|
||||
return null;
|
||||
}
|
||||
if (!self::hasPermission($adminId, $adminInfo, self::PERMISSION_READ)) {
|
||||
@@ -1664,7 +1664,7 @@ class PatientAiReportLogic extends BaseLogic
|
||||
|
||||
$authorized = array_fill_keys(array_map('intval', $diagnosisIds), true);
|
||||
$versionById = [];
|
||||
$modelVersions = ['qwen' => 0, 'openai' => 0];
|
||||
$modelVersions = array_fill_keys(self::MODEL_KEYS, 0);
|
||||
foreach (array_reverse($rows) as $row) {
|
||||
$model = strtolower(trim((string) ($row['model_key'] ?? '')));
|
||||
if (!array_key_exists($model, $modelVersions)) {
|
||||
@@ -1675,7 +1675,7 @@ class PatientAiReportLogic extends BaseLogic
|
||||
}
|
||||
|
||||
$reports = [];
|
||||
$latestByModel = ['qwen' => null, 'openai' => null];
|
||||
$latestByModel = array_fill_keys(self::MODEL_KEYS, null);
|
||||
$generatedReport = null;
|
||||
foreach ($rows as $row) {
|
||||
$sourceDiagnosisIds = array_values(array_filter(array_map(
|
||||
|
||||
Reference in New Issue
Block a user