mmargg commited on
Commit
17b2c46
·
verified ·
1 Parent(s): 08547f4

added modes

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -158,7 +158,16 @@ def respond(message,history):
158
  information="\n".join(topic_chunks)
159
  #return information
160
  #return topic_chunks
161
-
 
 
 
 
 
 
 
 
 
162
  messages = [{"role": "assistant", "content": f"You are a friendly, helpful chatbot that gives academic advice to disadvantaged students about their education based on their question. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
163
 
164
  if history:
@@ -220,6 +229,8 @@ with gr.Blocks(
220
  )
221
  with gr.Row(scale=1):
222
  chatbot_topic=gr.CheckboxGroup(["Academia", "Extracurriculars", "Time Management", "Financial Aid"], label="What would you like advice about?")
 
 
223
 
224
  #demo.css = """
225
  #.download-btn {
 
158
  information="\n".join(topic_chunks)
159
  #return information
160
  #return topic_chunks
161
+ if chatbot_mode=="Peer Mode":
162
+ messages = [{"role": "assistant", "content": f"You are a casual, sometimes funny chatbot who acts like a peer of the person who is asking the question. You relate to their situation and give them relevant advice. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
163
+
164
+ if chatbot_mode=="Guidance Counselor Mode":
165
+ messages = [{"role": "assistant", "content": f"You act as a helpful guidance counselor with an educated understanding of high school life and college admissions. You guide the student to consider their academic potential, while maintaining the passion and balance they need. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
166
+
167
+ if chatbot_mode=="Parent Mode":
168
+ messages = [{"role": "assistant", "content": f"You are a guiding, nurturing, and protective parent who wants their student to reach their fullest potential while learning to grow up with the proper physical, emotional, and social development. You want to build your student into a responsible adult, but also want them to pursue success in their life and establish a good future. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
169
+
170
+ else:
171
  messages = [{"role": "assistant", "content": f"You are a friendly, helpful chatbot that gives academic advice to disadvantaged students about their education based on their question. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
172
 
173
  if history:
 
229
  )
230
  with gr.Row(scale=1):
231
  chatbot_topic=gr.CheckboxGroup(["Academia", "Extracurriculars", "Time Management", "Financial Aid"], label="What would you like advice about?")
232
+ with gr.Row(scale=1):
233
+ chatbot_mode=gr.CheckboxGroup(["Guidance Counselor Mode", "Peer Mode", "Parent Mode"], label="How would you like the chatbot to respond?")
234
 
235
  #demo.css = """
236
  #.download-btn {