pratikshahp commited on
Commit
11af300
·
verified ·
1 Parent(s): a27f318

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -18,12 +18,14 @@ llm = HuggingFaceEndpoint(
18
  def suggest_recipes(ingredients):
19
  # Create a prompt for the recipe generation
20
  prompt = (
21
- f"You are an expert in cooking. Please review the following ingredients: {ingredients}. "
22
- f"If any ingredient is invalid, such as non-food items or unrecognizable terms, "
23
- f"respond only with a polite, two-line apology and do not provide any recipes. "
24
- f"If all ingredients are valid, suggest 2 recipes using them. Provide a title for each recipe, include "
25
- f"preparation time, and list step-by-step directions. Do not include the ingredients list in the response."
26
- )
 
 
27
 
28
 
29
  # Use the HuggingFaceEndpoint model to generate a response
 
18
  def suggest_recipes(ingredients):
19
  # Create a prompt for the recipe generation
20
  prompt = (
21
+ f"You are an expert in cooking. Carefully review the provided ingredients: {ingredients}. "
22
+ f"If any ingredient is invalid (e.g., non-food items), "
23
+ f"respond only with a two-line polite apology for not being able to process the request. "
24
+ f"Do not provide recipes, alternative suggestions, or unrelated outputs in such cases. "
25
+ f"If all ingredients are valid, suggest 2 recipes using them. Provide a title, preparation time, and step-by-step directions. "
26
+ f"Do not include the ingredients list in the recipes."
27
+ )
28
+
29
 
30
 
31
  # Use the HuggingFaceEndpoint model to generate a response