perf: AI机器人支持自定义模型

This commit is contained in:
kuaifan
2025-02-08 12:34:20 +09:00
parent 6bcc7b6c49
commit fb286cea3c
5 changed files with 92 additions and 31 deletions

View File

@@ -188,23 +188,25 @@ class UserBot extends AbstractModel
];
default:
if (preg_match('/^ai-(.*?)@bot\.system$/', $email)) {
if (preg_match('/^ai-(.*?)@bot\.system$/', $email, $match)) {
if (!Base::judgeClientVersion('0.42.62')) {
return [
'key' => '%3A.clear',
'label' => Doo::translate('清空上下文')
];
}
$aibotSetting = Base::setting('aibotSetting');
return [
[
'key' => 'ai-newchat',
'label' => Doo::translate('开启新对话'),
'config' => []
'key' => '~ai-model-select',
'label' => Doo::translate('选择模型'),
'config' => [
'model' => $aibotSetting[$match[1] . '_model']
]
],
[
'key' => 'ai-historychat',
'label' => Doo::translate('历史对话'),
'config' => []
'key' => '%3A.clear',
'label' => Doo::translate('清空上下文')
]
];
}