perf: 优化 Ollama AI

This commit is contained in:
kuaifan
2025-02-22 01:29:37 +08:00
parent b3e83e13bc
commit a8f3b02ee7
5 changed files with 57 additions and 2 deletions

View File

@@ -443,6 +443,9 @@ class BotReceiveMsgTask extends AbstractTask
if ($type === 'wenxin') {
$extras['api_key'] .= ':' . $setting['wenxin_secret'];
}
if ($type === 'ollama' && empty($extras['api_key'])) {
$extras['api_key'] = Base::strRandom(6);
}
if (empty($extras['api_key'])) {
$errorContent = '机器人未启用。';
}