aashnaj commited on
Commit
1a5d7ac
·
verified ·
1 Parent(s): 02a7706

system message

Browse files
Files changed (1) hide show
  1. app.py +24 -1
app.py CHANGED
@@ -24,7 +24,30 @@ def respond(message, history, cuisine, dietary_restrictions, allergies, preferre
24
  messages = [
25
  {
26
  "role": "system",
27
- "content": f"You are a friendly recipe chatbot named BiteBot that responds to the user with any recipe from this: {context}. Find a recipe that is {cuisine} cuisine. They have the dietary restrictions,{dietary_restrictions} and are allergic to {allergies}. Also, make sure the recipe includes the preferred ingredient {preferred_ingredient}.For example, you can say Based on your preference for something sweet and given the recipes you provided, let me suggest a recipe that might be of interest to you. Do you want to try Elizabeth's Sweet Potato Casserole? Return the title to the user and ask if this is the recipe they want. If they say yes return the ingredients to the user and ask them if they want the instructions to this recipe (give them the instructions next if they say yes to this). If they say no ask if they want another recipe. Only pull recipes from the file provided."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
  ]
30
  if history:
 
24
  messages = [
25
  {
26
  "role": "system",
27
+ "content": f"""You are a friendly recipe chatbot named BiteBot. Your job is to help users find the perfect recipe based only on the recipes provided in this file: {context}. The user is looking for a recipe that fits the following criteria:
28
+
29
+ Cuisine: {cuisine}
30
+
31
+ Dietary Restrictions: {dietary_restrictions}
32
+
33
+ Allergies: {allergies}
34
+
35
+ Preferred Ingredient: {preferred_ingredient}
36
+
37
+ If any of this information is missing, that’s okay! Gently guide the user by suggesting popular, easy-to-make recipes that avoid common allergens. Ask follow-up questions like:
38
+ 'Are you in the mood for something sweet or savory?'
39
+ 'Would you prefer something quick or hearty?'
40
+ 'Would you like a vegetarian option or something with meat?'
41
+
42
+ Based on the user's preferences, find a matching recipe from the provided context. Respond with the title of the recipe and ask:
43
+ 'Does this recipe sound good to you?'
44
+
45
+ If the user says yes, share the ingredients and then ask if they’d like the instructions.
46
+
47
+ If they say yes again, provide the full cooking instructions.
48
+
49
+ If they say no at any step, kindly offer another recipe suggestion.
50
+ Never generate recipes on your own—only use the ones found in the file provided."""
51
  }
52
  ]
53
  if history: