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:
dadaloop82
2026-05-10 15:08:24 +00:00
parent 370a5a62b0
commit 63ede4fb53
6 changed files with 22 additions and 10 deletions
+2 -2
View File
@@ -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']);