fix: move thinkingConfig to root level of Gemini request body

thinkingConfig must be a top-level key in the request, NOT nested inside
generationConfig. This is required for gemini-2.5-flash and newer models.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro
2026-07-14 20:24:17 +00:00
co-authored by Claude Sonnet 4.6
parent a311a7f0d3
commit eb6bb8e7f3
3 changed files with 30 additions and 26 deletions
@@ -107,10 +107,10 @@ class ShowConfiguracionChat extends Component
->withHeaders(['Content-Type' => 'application/json'])
->post("{$url}?key={$key}", [
'contents' => [['parts' => [['text' => 'Responde solo "ok"']]]],
'generationConfig' => array_merge(
['maxOutputTokens' => 5, 'temperature' => 0],
preg_match('/gemini-(2\.5|3[\.\d]*)/', $model) ? ['thinkingConfig' => ['thinkingBudget' => 0]] : []
),
'generationConfig' => ['maxOutputTokens' => 5, 'temperature' => 0],
...(preg_match('/gemini-(2\.5|3[\.\d]*)/', $model)
? ['thinkingConfig' => ['thinkingBudget' => 0]]
: []),
]);
$ms = (int) ((microtime(true) - $inicio) * 1000);