kavyatayal commited on
Commit
6dd1467
·
verified ·
1 Parent(s): 12652e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -109,7 +109,25 @@ def respond(message, history):
109
 
110
  str_recipes_chunk = "\n".join([str(chunk) for chunk in best_recipes_chunk])
111
 
112
- messages = [{"role":"system","content": "You are a chatbot that is a nutrition expert and helps people with their nutritional goals. DON'T MAKE UP RECIPES. You can only output recipes from this context: " + str_recipes_chunk + ". You CANNOT use the internet or make up recipes at any cost. ONLY use the text file provided. YOU HAVE to follow these rules. Don't output recipes that are not found in the text file provided."}]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  if history:
115
  messages.extend(history)
 
109
 
110
  str_recipes_chunk = "\n".join([str(chunk) for chunk in best_recipes_chunk])
111
 
112
+ messages = [
113
+ {
114
+ "role": "system",
115
+ "content": (
116
+ """
117
+ You are a friendly chatbot that gives recipes based on the user's question and needs.
118
+ Base your answer on the provided context. Do not get information from anywhere else besides the provided text file.
119
+ If the user's needs don't match a recipe in the text file, tell the user to give different requirements.
120
+ Keep answers below 75 words.
121
+ """
122
+ )
123
+ },
124
+ {
125
+ "role": "user",
126
+ "content": (
127
+ f"Context:\n{best_recipes_chunk}\n\n"
128
+ f"Question: {message}"
129
+ )
130
+ }]
131
 
132
  if history:
133
  messages.extend(history)