riyamalshe commited on
Commit
1165c6e
·
verified ·
1 Parent(s): cb9fc1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -117,16 +117,26 @@ def respond(message, history, mom_type) :
117
  # NN changed from mom_type to selected in each if statement
118
  if selected == "Cool Mom" :
119
  top_results = get_top_chunks(message, cool_chunk_embeddings, cleaned_cool_chunks)
 
 
 
 
 
120
  elif selected == "Tutor Mom" :
121
  top_results = get_top_chunks(message, tutor_chunk_embeddings, cleaned_tutor_chunks)
 
 
 
 
 
122
  elif selected == "Strict Mom":
123
  top_results = get_top_chunks(message, strict_chunk_embeddings, cleaned_strict_chunks)
124
-
125
- messages = [{"role": "system", "content": f"You are a chatbot that plays the role of the user's mom. Respond in full sentences, don't cut yourself off. Base your response on the provided context: {top_results}"},
126
  {"role": "user",
127
  "content": (
128
  f"Question{message}"
129
  )}]
 
130
  if history:
131
  messages.extend(history)
132
 
 
117
  # NN changed from mom_type to selected in each if statement
118
  if selected == "Cool Mom" :
119
  top_results = get_top_chunks(message, cool_chunk_embeddings, cleaned_cool_chunks)
120
+ messages = [{"role": "system", "content": f"You are a chatbot that plays the role of the user's cool, friendly, extremely nice and supportive mom. Respond in full sentences and use really nice and sweet language, don't cut yourself off. Base your response on the provided context: {top_results}"},
121
+ {"role": "user",
122
+ "content": (
123
+ f"Question{message}"
124
+ )}]
125
  elif selected == "Tutor Mom" :
126
  top_results = get_top_chunks(message, tutor_chunk_embeddings, cleaned_tutor_chunks)
127
+ messages = [{"role": "system", "content": f"You are a chatbot that plays the role of the user's tutor-like mom who knows how to help and teaches her kid everything. Respond in full sentences, speak very knowledgeable and don't cut yourself off. Base your response on the provided context: {top_results}"},
128
+ {"role": "user",
129
+ "content": (
130
+ f"Question{message}"
131
+ )}]
132
  elif selected == "Strict Mom":
133
  top_results = get_top_chunks(message, strict_chunk_embeddings, cleaned_strict_chunks)
134
+ messages = [{"role": "system", "content": f"You are a chatbot that plays the role of the user's extremely strict mom who is focused on doing well in school, studies, and academics. Respond in action-oriented and stern full sentences, don't cut yourself off. Base your response on the provided context: {top_results}"},
 
135
  {"role": "user",
136
  "content": (
137
  f"Question{message}"
138
  )}]
139
+
140
  if history:
141
  messages.extend(history)
142