Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -155,20 +155,19 @@ def respond(message,history):
|
|
| 155 |
topic_chunks=get_top_chunks(message, chunk_embeddings4, cleaned_chunks4)
|
| 156 |
print(topic_chunks)
|
| 157 |
|
| 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 {
|
| 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 {
|
| 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 {
|
| 172 |
|
| 173 |
if history:
|
| 174 |
messages.extend(history) #keep adding history
|
|
|
|
| 155 |
topic_chunks=get_top_chunks(message, chunk_embeddings4, cleaned_chunks4)
|
| 156 |
print(topic_chunks)
|
| 157 |
|
|
|
|
| 158 |
#return information
|
| 159 |
#return topic_chunks
|
| 160 |
if chatbot_mode=="Peer Mode":
|
| 161 |
+
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 {topic_chunks}"}]
|
| 162 |
|
| 163 |
if chatbot_mode=="Guidance Counselor Mode":
|
| 164 |
+
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 {topic_chunks}"}]
|
| 165 |
|
| 166 |
if chatbot_mode=="Parent Mode":
|
| 167 |
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}"}]
|
| 168 |
|
| 169 |
else:
|
| 170 |
+
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 {topic_chunks}"}]
|
| 171 |
|
| 172 |
if history:
|
| 173 |
messages.extend(history) #keep adding history
|