Dev #99
+8
-3
@@ -268,9 +268,14 @@ function fociz_ai_chat_gemini(array $messages, array $options, array $aiSettings
|
||||
continue;
|
||||
}
|
||||
|
||||
// Bij autorisatiefouten (zoals ongeldige API key 400/403) direct stoppen
|
||||
$response = $res;
|
||||
break;
|
||||
// Alleen bij expliciete autorisatiefouten (ongeldige API key 400/401/403) stoppen
|
||||
if (in_array($res['status'], [400, 401, 403], true)) {
|
||||
$response = $res;
|
||||
break;
|
||||
}
|
||||
|
||||
// Voor alle andere fouten (serverfout 500, timeout, etc.): probeer volgende kandidaat
|
||||
continue;
|
||||
}
|
||||
|
||||
// Als alle directe kandidaten een 404 gaven, probeer dynamisch via ListModels een passend gemini model te vinden
|
||||
|
||||
Reference in New Issue
Block a user