feat(maker): AI parsing schede tecniche PDF via OpenRouter

- Nuovo servizio ai_service.py: estrae testo da PDF (pdfplumber) + analisi AI (OpenRouter)
- Endpoint POST /api/recipes/{id}/parse-technical-sheet con validazione file
- UI: bottone "Importa da PDF" nel task editor con modale upload + preview editabile
- Task suggeriti modificabili/rimovibili prima della creazione bulk
- Config: OPENROUTER_API_KEY e OPENROUTER_MODEL in .env
- Dipendenze: pdfplumber + httpx aggiunti a server deps

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adriano Dal Pastro
2026-05-24 11:01:00 +00:00
parent 9bd605c958
commit d2bf0b5828
10 changed files with 539 additions and 10 deletions
@@ -768,6 +768,42 @@ msgstr "Send signal to management system to start the line timer"
msgid "Produzione avviata"
msgstr "Production started"
msgid "Importa da PDF"
msgstr "Import from PDF"
msgid "Importa da Scheda Tecnica"
msgstr "Import from Technical Sheet"
msgid "Carica un PDF e l'AI estrarrà i task automaticamente"
msgstr "Upload a PDF and AI will extract tasks automatically"
msgid "Clicca per caricare un PDF"
msgstr "Click to upload a PDF"
msgid "Analisi in corso con AI..."
msgstr "AI analysis in progress..."
msgid "Potrebbe richiedere fino a 30 secondi"
msgstr "May take up to 30 seconds"
msgid "Riprova"
msgstr "Retry"
msgid "task suggeriti — modifica o rimuovi prima di confermare"
msgstr "suggested tasks — edit or remove before confirming"
msgid "Crea"
msgstr "Create"
msgid "Errore nell'analisi del PDF"
msgstr "Error analyzing PDF"
msgid "Nessun task identificato nel PDF"
msgstr "No tasks identified in PDF"
msgid "task creati dalla scheda tecnica"
msgstr "tasks created from technical sheet"
msgid "Prossima misurazione tra"
msgstr "Next measurement in"
@@ -798,6 +798,42 @@ msgstr "Invia segnale al gestionale per avviare il timer della linea"
msgid "Produzione avviata"
msgstr "Produzione avviata"
msgid "Importa da PDF"
msgstr "Importa da PDF"
msgid "Importa da Scheda Tecnica"
msgstr "Importa da Scheda Tecnica"
msgid "Carica un PDF e l'AI estrarrà i task automaticamente"
msgstr "Carica un PDF e l'AI estrarrà i task automaticamente"
msgid "Clicca per caricare un PDF"
msgstr "Clicca per caricare un PDF"
msgid "Analisi in corso con AI..."
msgstr "Analisi in corso con AI..."
msgid "Potrebbe richiedere fino a 30 secondi"
msgstr "Potrebbe richiedere fino a 30 secondi"
msgid "Riprova"
msgstr "Riprova"
msgid "task suggeriti — modifica o rimuovi prima di confermare"
msgstr "task suggeriti — modifica o rimuovi prima di confermare"
msgid "Crea"
msgstr "Crea"
msgid "Errore nell'analisi del PDF"
msgstr "Errore nell'analisi del PDF"
msgid "Nessun task identificato nel PDF"
msgstr "Nessun task identificato nel PDF"
msgid "task creati dalla scheda tecnica"
msgstr "task creati dalla scheda tecnica"
msgid "Prossima misurazione tra"
msgstr "Prossima misurazione tra"