recipes icon indicating copy to clipboard operation
recipes copied to clipboard

AI-optimized import: assigning ingredients to steps

Open tomtjes opened this issue 7 months ago • 1 comments

Is your feature request related to a problem? Please describe.

"Auto sort" of ingredients during import, assigning ingredients to the steps where they are used, is insufficient and manual adjustments are cumbersome. Dividing ingredients that are used in multiple steps, is impossible to do manually in the importer.

Describe the solution you'd like

I believe that AI could be leveraged for a better experience:

  • Match name variations extra-virgin olive oil or green beans in the ingredients list can be matched to olive oil or beans used in a step.
  • Break up amounts 100 ml olive oil can be turned into 60 ml olive oil in step A and 40 ml olive oil in step B.
  • Extract ingredients and amounts from steps turn a simple mention of salt in the ingredient list into the exact amount used in the step(s). This is particularly useful for nutrition calculations.

Describe alternatives you've considered

No response

Additional context

No response

tomtjes avatar Sep 11 '25 15:09 tomtjes

As an extension to this: When importing from URL I find it often puts all the steps into a single step. So have AI automate the separation of steps into actual steps.

I had created a python script that would do this for my tandoor 1 recipies exported, and "improved" the recipies before importing them into tandoor 2. Here was the prompt:

You are an expert recipe converter specializing in Tandoor Recipe Manager format. Your task is to improve the following recipe JSON to meet these requirements:

**REQUIREMENTS:**
- Use **metric only** (grams, ml, tablespoons, teaspoons, cloves, pieces, heads, bunches)
- Prefer **tablespoons/teaspoons** for oils, sauces, and small amounts
- Use **grams/ml** for bulk ingredients  
- Use **cloves, pieces, heads, bunches** for discrete items
- Do **NOT** use "note" field for unit conversions (to keep scaling functional)
- Structure steps clearly: preparation, cooking, assembling, serving
- Link ingredients to the step where they are used
- Keep the JSON clean and valid for Tandoor import
- Maintain all original fields and structure
- Ensure ingredient names are clean and consistent

**CURRENT RECIPE:**
{recipe_data}

**TASK:**
Analyze this recipe and return ONLY the improved JSON that:
1. Converts all units to proper metric
2. Restructures steps logically (prep, cook, serve)
3. Cleans ingredient names and units
4. Maintains all original metadata (keywords, timing, servings, etc.)
5. Is valid JSON that can be imported into Tandoor

**IMPORTANT:** Return ONLY the JSON, no explanations or markdown formatting. The response must be valid JSON that can be parsed directly.

**EXAMPLE IMPROVEMENTS:**
- "4 chicken breasts" → "4 pieces" with "chicken breast" as food name
- "2 tbsp oil" → "2 tablespoons" with "olive oil" as food name  
- "1 onion diced" → "1 piece" with "onion" as food name and "diced" in note
- "400ml stock" → "400 ml" (already metric, keep as is)
- Break single long instruction into logical steps

Return the improved JSON now:

Hope it helps

Dunky13 avatar Nov 07 '25 10:11 Dunky13