no message

This commit is contained in:
kuaifan 2025-11-09 02:14:27 +00:00
parent 3ffdce5e7a
commit 58c760bb77
2 changed files with 26 additions and 3 deletions

View File

@ -92,12 +92,35 @@ class AssistantController extends AbstractController
default => $modelType,
};
$authResult = Ihttp::ihttp_post('http://nginx/ai/invoke/auth', [
$authParams = [
'api_key' => $apiKey,
'model_type' => $remoteModelType,
'model_name' => $modelName,
'context' => $contextJson,
], 30);
];
if ($setting[$modelType . '_base_url']) {
$authParams['base_url'] = $setting[$modelType . '_base_url'];
}
if ($setting[$modelType . '_agency']) {
$authParams['agency'] = $setting[$modelType . '_agency'];
}
$thinkPatterns = [
"/^(.+?)(\s+|\s*[_-]\s*)(think|thinking|reasoning)\s*$/",
"/^(.+?)\s*\(\s*(think|thinking|reasoning)\s*\)\s*$/"
];
$thinkMatch = [];
foreach ($thinkPatterns as $pattern) {
if (preg_match($pattern, $authParams['model_name'], $thinkMatch)) {
break;
}
}
if ($thinkMatch && !empty($thinkMatch[1])) {
$authParams['model_name'] = $thinkMatch[1];
}
$authResult = Ihttp::ihttp_post('http://nginx/ai/invoke/auth', $authParams, 30);
if (Base::isError($authResult)) {
return Base::retError($authResult['msg']);

View File

@ -328,7 +328,7 @@ class SystemController extends AbstractController
}
/**
* @api {get} api/system/setting/aibot 获取会议设置、保存AI机器人设置限管理员
* @api {get} api/system/setting/aibot 获取AI设置、保存AI机器人设置限管理员
*
* @apiVersion 1.0.0
* @apiGroup system