From 5e20155ae46598e4de0ec7a98746b842ad29c466 Mon Sep 17 00:00:00 2001 From: Lizandro Date: Sat, 18 Jul 2026 17:11:55 +0000 Subject: [PATCH] fix(gemini): deshabilitar thinking y subir maxOutputTokens a 8192/2048 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Con thinkingBudget=0 el modelo no consume tokens en razonamiento interno, evitando que el JSON de respuesta quede truncado (bug: '{"banco":"Nu",...'). maxOutputTokens 2048→8192 en Vision, 1024→2048 en Intent. Co-Authored-By: Claude Sonnet 4.6 --- app/Services/GeminiIntentService.php | 6 +++++- app/Services/GeminiVisionService.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Services/GeminiIntentService.php b/app/Services/GeminiIntentService.php index eb250e0..132d820 100755 --- a/app/Services/GeminiIntentService.php +++ b/app/Services/GeminiIntentService.php @@ -27,7 +27,11 @@ class GeminiIntentService { return [ 'contents' => $contents, - 'generationConfig' => array_merge(['temperature' => 0.1, 'maxOutputTokens' => 1024], $genConfig), + 'generationConfig' => array_merge([ + 'temperature' => 0.1, + 'maxOutputTokens' => 2048, + 'thinkingConfig' => ['thinkingBudget' => 0], + ], $genConfig), ]; } diff --git a/app/Services/GeminiVisionService.php b/app/Services/GeminiVisionService.php index cd84048..0c00e94 100755 --- a/app/Services/GeminiVisionService.php +++ b/app/Services/GeminiVisionService.php @@ -34,7 +34,11 @@ class GeminiVisionService $body = [ 'contents' => $contents, - 'generationConfig' => ['temperature' => 0.1, 'maxOutputTokens' => 2048], + 'generationConfig' => [ + 'temperature' => 0.1, + 'maxOutputTokens' => 8192, + 'thinkingConfig' => ['thinkingBudget' => 0], + ], ]; $inicio = microtime(true);