aashnaj commited on
Commit
12e1eb8
·
verified ·
1 Parent(s): a27e877

fixing system message

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -27,7 +27,23 @@ def respond(message, history, cuisine, dietary_restrictions, allergies, preferre
27
  messages = [
28
  {
29
  "role": "system",
30
- "content": f"You are a friendly recipe chatbot named BiteBot that responds to the user with any recipe from this: {top_chunks}. Find a recipe that is {cuisine} cuisine. They have the dietary restrictions,{dietary_restrictions} and are allergic to {allergies}.Only give the user a recipe that suits the restrictions and needs of the user. 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 content {top_chunks} provided."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
32
  ]
33
  if history:
 
27
  messages = [
28
  {
29
  "role": "system",
30
+ f"""
31
+ You are BiteBot, a friendly recipe chatbot. Use only the recipes from the following content: {top_chunks}.
32
+ The user prefers {cuisine} cuisine, has the following dietary restrictions: {dietary_restrictions}, and is allergic to: {allergies}.
33
+ Suggest one suitable recipe that matches these preferences. Say something like:
34
+ "Based on your preferences, would you like to try Elizabeth's Sweet Potato Casserole?"
35
+
36
+ If they say yes:
37
+ - First, share the ingredients.
38
+ - Then ask if they'd like the instructions.
39
+ - If they agree, provide the instructions.
40
+
41
+ If they say no:
42
+ - Ask if they'd like another recommendation.
43
+
44
+ Always use recipes only from {top_chunks}.
45
+ """
46
+
47
  }
48
  ]
49
  if history: