Spaces:
Running
Running
A newer version of the Gradio SDK is available: 6.13.0
Ingredient Restrictions Update
β Changes Made
1. Strict Ingredient Usage
- Recipes now ONLY use detected ingredients (when ingredients are scanned)
- No random ingredients will be added
- Very clear and explicit instructions in the AI prompt
2. Flexible Combination
- Recipes don't need to use all detected ingredients
- Each of the 3 recipes uses a different combination of detected ingredients
- More variety in recipe suggestions
3. Common Pantry Items Exception
Always allowed even if not detected:
- Salt
- Pepper / Black pepper
- Olive oil / Vegetable oil / Cooking oil
- Garlic / Onion
- Garlic powder / Onion powder
- Basic seasonings / Herbs / Common spices
4. Updated UI
- Clear explanation of ingredient rules in the Recipe Generator tab
- Shows what items are always allowed
- Explains that recipes only use detected ingredients
π How It Works
When Ingredients Are Detected:
Detected: ["chicken", "tomatoes", "pasta", "cheese"]
Recipe 1: Uses chicken + tomatoes + salt + pepper + oil
Recipe 2: Uses pasta + cheese + garlic + salt + pepper
Recipe 3: Uses chicken + pasta + tomatoes + oil + seasonings
β Won't add: potatoes, rice, or any other non-detected items
β
Will add: salt, pepper, oil, garlic (common pantry items)
When No Ingredients Are Detected:
- Falls back to flexible recipe generation
- Uses common pantry items
- Works as before
π Code Changes
Prompt Structure:
STRICT INGREDIENT REQUIREMENTS section (when ingredients detected)
- Lists detected ingredients
- Lists allowed common pantry items
- Explicitly forbids other ingredients
- Emphasized multiple times in the prompt
REMINDER section
- Reinforces the restrictions
- Makes it very clear what can and cannot be used
UI Updates:
- Added ingredient rules explanation in description box
- Added "With Detected Ingredients" section explaining the behavior
- Clear messaging about common pantry items
π― Example
Input:
- Detected ingredients: "chicken", "tomatoes", "rice"
- Cuisine: "Italian"
Output:
- Recipe 1: Chicken and Tomato Risotto (uses chicken + tomatoes + rice + salt + pepper + oil + garlic)
- Recipe 2: Italian Chicken with Tomatoes (uses chicken + tomatoes + salt + pepper + herbs + oil)
- Recipe 3: Tomato Rice Bowl (uses tomatoes + rice + garlic + oil + seasonings)
Key Points:
- β Only uses detected items + common pantry items
- β Each recipe has different combinations
- β No random ingredients added
- β Still practical and delicious!