mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
no message
This commit is contained in:
parent
3ffdce5e7a
commit
58c760bb77
@ -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']);
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user