perf: AI支持自定义模型列表

This commit is contained in:
kuaifan
2025-02-14 00:50:45 +08:00
parent 821df75d4b
commit 8ed9186ff4
5 changed files with 227 additions and 164 deletions

View File

@@ -196,20 +196,23 @@ class UserBot extends AbstractModel
];
}
$aibotSetting = Base::setting('aibotSetting');
$aibotModel = $aibotSetting[$match[1] . '_model'];
$aibotModels = Setting::AIModels2Array($aibotSetting[$match[1] . '_models']);
if (empty($aibotModels)) {
return [];
}
return [
[
'key' => '~ai-model-select',
'label' => Doo::translate('选择模型'),
'config' => [
'model' => $aibotSetting[$match[1] . '_model']
'model' => $aibotModel,
'models' => $aibotModels
]
],
[
'key' => '~ai-session-create',
'label' => Doo::translate('开启新会话'),
'config' => [
'model' => $aibotSetting[$match[1] . '_model']
]
],
[
'key' => '~ai-session-history',