fix: increase maxOutputTokens to 8192 in chatToRecipe; add 'Apri la ricetta' button after transfer
Fixes parse_error on complex recipes (JSON was truncated at 2048 tokens). After successful transfer, shows 'Apri la ricetta' button inline in chat alongside the '✅ Aggiunta alle Ricette!' button. Closes #27
This commit is contained in:
+2
-2
@@ -3645,10 +3645,10 @@ PROMPT;
|
||||
|
||||
$payload = [
|
||||
'contents' => [['role' => 'user', 'parts' => [['text' => $prompt]]]],
|
||||
'generationConfig' => ['temperature' => 0.1, 'maxOutputTokens' => 2048]
|
||||
'generationConfig' => ['temperature' => 0.1, 'maxOutputTokens' => 8192]
|
||||
];
|
||||
|
||||
$result = callGeminiWithFallback($apiKey, $payload, 30);
|
||||
$result = callGeminiWithFallback($apiKey, $payload, 45);
|
||||
|
||||
if ($result['http_code'] !== 200) {
|
||||
echo json_encode(['success' => false, 'error' => $result['data']['error']['message'] ?? 'gemini_error']);
|
||||
|
||||
Reference in New Issue
Block a user