feat: SSE streaming recipe generation with live agent feedback

- Add generateRecipeStream() endpoint with real-time SSE status events
- Frontend generateRecipe() uses ReadableStream for live step updates
- Fix gemini-2.5-flash thinking model: disable thinkingBudget, raise maxOutputTokens to 4096
- Passo 2 is pure PHP heuristic (zero extra AI calls)
- Retry logic with live countdown on 429, fallback chain: 2.5-flash → 2.0-flash
- Pass all ingredients when meal plan is active (no limits)
- Add recipe-loading-msg element with CSS transition
This commit is contained in:
dadaloop82
2026-04-23 15:16:50 +00:00
parent db033844d4
commit 546d4afd59
4 changed files with 580 additions and 21 deletions
+1 -1
View File
@@ -1195,7 +1195,7 @@
</div>
<div id="recipe-loading" style="display:none" class="recipe-loading">
<div class="loading-spinner"></div>
<p>Sto preparando la ricetta...</p>
<p id="recipe-loading-msg">Sto preparando la ricetta...</p>
</div>
<div id="recipe-result" style="display:none" class="recipe-result">
<div id="recipe-content"></div>