fix(ai): prioritize flash models, prevent high-demand blocks, and add resilient brainstorm fallbacks

This commit is contained in:
2026-09-23 10:49:52 +02:00
parent f18f7d5794
commit 3dc09a11a7
5 changed files with 115 additions and 32 deletions
+2 -2
View File
@@ -191,9 +191,9 @@ function get_ai_settings(?int $userId = null): array {
$provider = 'gemini';
}
$model = !empty($personalModel) ? $personalModel : get_system_setting('ai_model', 'gemini-1.5-pro');
$model = !empty($personalModel) ? $personalModel : get_system_setting('ai_model', 'gemini-2.0-flash');
if (empty($model)) {
$model = (strpos((string)$provider, 'openai') !== false) ? 'gpt-4o-mini' : 'gemini-1.5-pro';
$model = (strpos((string)$provider, 'openai') !== false) ? 'gpt-4o-mini' : 'gemini-2.0-flash';
}
$apiKey = trim((string)$apiKey);