pratikshahp commited on
Commit
c508f50
·
verified ·
1 Parent(s): 2450cde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -18,13 +18,13 @@ llm = HuggingFaceEndpoint(
18
  def suggest_recipes(ingredients):
19
  # Create a prompt for the recipe generation
20
  prompt = (
21
- f"You are a professional chef. Please evaluate the provided input: {ingredients}. "
22
- f"If the input does not contain valid food ingredients (e.g., it includes non-food items, random text, or questions like 'What should I cook today?'), "
23
- f"respond with exactly two lines apologizing for not being able to process the request. "
24
- f"Do not provide recipes, suggestions, or any other information in such cases. "
25
- f"If the input contains valid food ingredients, suggest exactly 2 recipes. For each recipe, provide: "
26
- f"1) A title, 2) Preparation time, and 3) Clear, step-by-step instructions. "
27
- f"Do not include the ingredient list in the response."
28
  )
29
 
30
 
 
18
  def suggest_recipes(ingredients):
19
  # Create a prompt for the recipe generation
20
  prompt = (
21
+ f"You are an expert chef. Carefully review the provided ingredients: {ingredients}. "
22
+ f"If all ingredients are valid, suggest exactly two recipes using them. "
23
+ f"Provide a title for each recipe, preparation time, and detailed step-by-step instructions. "
24
+ f"Do not include the ingredients list explicitly in the response. "
25
+ f"If the ingredients are invalid (e.g., non-food items, random words, or incomplete), "
26
+ f"respond only with: 'I'm sorry, but I can't process this request due to invalid ingredients.' "
27
+ f"Do not provide any recipes, alternative suggestions, or further explanations in such cases."
28
  )
29
 
30