feat(parser): remove step number prefixes from recipe extraction
- Update RECIPE_EXTRACTION_PROMPT to v2.1 - Remove instruction to number steps sequentially - Update OUTPUT FORMAT and both few-shot examples - Remove 'All steps numbered sequentially' from quality checklist - Update fallback parser system prompt in parseRecipeWithStandardCompletion - Frontend <ol> element already handles auto-numbering - Tandoor integration unaffected (uses array index for step numbers) Fixes double-numbering bug where steps appeared as '1. 1. Step text' All 34 tests passing Implementation follows execution plan in docs/plans/RemoveStepNumberPrefixes.md Documented in docs/outcomes/RemoveStepNumberPrefixes.md
This commit is contained in:
@@ -146,7 +146,7 @@ async function parseRecipeWithStandardCompletion(text: string): Promise<Recipe>
|
||||
"servings": number or null,
|
||||
"description": "description in Italian or null",
|
||||
"ingredients": [{"item": "ingredient name", "amount": "quantity", "unit": "SI unit"}],
|
||||
"steps": ["1. First step", "2. Second step", ...]
|
||||
"steps": ["First step", "Second step", ...]
|
||||
}
|
||||
|
||||
Convert all measurements to SI units (g, mL, °C).
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* Recipe Extraction System Prompts - Version 2.0
|
||||
* Recipe Extraction System Prompts - Version 2.1
|
||||
*
|
||||
* Changelog:
|
||||
* - v2.1 (2025-12-21): Removed step number prefixes (now handled by frontend <ol>)
|
||||
* - v2.0 (2025-12-21): Added social media handling, few-shot examples, partial recipe support
|
||||
* - v1.0 (2024): Initial version with Italian translation and SI conversion
|
||||
*/
|
||||
@@ -91,8 +92,8 @@ Extract structured recipe data from text that may contain social media noise, em
|
||||
{"item": "aglio", "amount": "2", "unit": "spicchi"}
|
||||
],
|
||||
"steps": [
|
||||
"1. Primo passaggio dettagliato",
|
||||
"2. Secondo passaggio dettagliato"
|
||||
"Primo passaggio dettagliato",
|
||||
"Secondo passaggio dettagliato"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -133,12 +134,12 @@ Output:
|
||||
{"item": "gocce di cioccolato", "amount": "480", "unit": "mL"}
|
||||
],
|
||||
"steps": [
|
||||
"1. Preriscaldare il forno a 190°C",
|
||||
"2. Mescolare farina e bicarbonato di sodio",
|
||||
"3. Montare burro e zucchero a crema",
|
||||
"4. Aggiungere le uova",
|
||||
"5. Incorporare le gocce di cioccolato",
|
||||
"6. Cuocere per 10 minuti"
|
||||
"Preriscaldare il forno a 190°C",
|
||||
"Mescolare farina e bicarbonato di sodio",
|
||||
"Montare burro e zucchero a crema",
|
||||
"Aggiungere le uova",
|
||||
"Incorporare le gocce di cioccolato",
|
||||
"Cuocere per 10 minuti"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -181,11 +182,11 @@ Output:
|
||||
{"item": "pepe nero", "amount": "q.b.", "unit": ""}
|
||||
],
|
||||
"steps": [
|
||||
"1. Tritare il salmone affumicato",
|
||||
"2. Sciogliere il burro e aggiungere lo scalogno tritato, far andare per qualche minuto",
|
||||
"3. Sfumare con il vino e aggiungere il salmone, cuocere un paio di minuti",
|
||||
"4. Aggiungere la panna, il pepe e il concentrato di pomodoro",
|
||||
"5. Cuocere la pasta al dente e ultimare la cottura in padella"
|
||||
"Tritare il salmone affumicato",
|
||||
"Sciogliere il burro e aggiungere lo scalogno tritato, far andare per qualche minuto",
|
||||
"Sfumare con il vino e aggiungere il salmone, cuocere un paio di minuti",
|
||||
"Aggiungere la panna, il pepe e il concentrato di pomodoro",
|
||||
"Cuocere la pasta al dente e ultimare la cottura in padella"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -206,7 +207,6 @@ Output:
|
||||
- IGNORE all social media metadata (likes, comments, emojis, hashtags, mentions)
|
||||
- If units are missing, use context clues or standard assumptions
|
||||
- Translate faithfully to Italian, preserving culinary terms accurately
|
||||
- Number all steps sequentially starting with "1."
|
||||
|
||||
🎯 QUALITY CHECKLIST:
|
||||
|
||||
@@ -214,7 +214,6 @@ Before returning, verify:
|
||||
- [ ] All ingredients have item, amount, and unit
|
||||
- [ ] All measurements converted to SI units (g, mL, °C)
|
||||
- [ ] All text translated to Italian
|
||||
- [ ] All steps numbered sequentially
|
||||
- [ ] No social media noise (emojis, hashtags, mentions) in output
|
||||
- [ ] JSON is valid and matches schema
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user