Update app.py
Browse files
app.py
CHANGED
|
@@ -6,12 +6,12 @@ import os
|
|
| 6 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
| 7 |
|
| 8 |
# Initialize paths and model identifiers for easy configuration and maintenance
|
| 9 |
-
filename = "output_topic_details.txt" # Path to the file storing
|
| 10 |
retrieval_model_name = 'output/sentence-transformer-finetuned/'
|
| 11 |
|
| 12 |
openai.api_key = os.environ["OPENAI_API_KEY"]
|
| 13 |
|
| 14 |
-
system_message = "You are a
|
| 15 |
# Initial system message to set the behavior of the assistant
|
| 16 |
messages = [{"role": "system", "content": system_message}]
|
| 17 |
|
|
@@ -64,7 +64,7 @@ def find_relevant_segment(user_query, segments):
|
|
| 64 |
|
| 65 |
def generate_response(user_query, relevant_segment):
|
| 66 |
"""
|
| 67 |
-
Generate a response emphasizing the bot's capability in providing
|
| 68 |
"""
|
| 69 |
try:
|
| 70 |
user_message = f"Here's the information on your request: {relevant_segment}"
|
|
|
|
| 6 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
| 7 |
|
| 8 |
# Initialize paths and model identifiers for easy configuration and maintenance
|
| 9 |
+
filename = "output_topic_details.txt" # Path to the file storing destress-specific details
|
| 10 |
retrieval_model_name = 'output/sentence-transformer-finetuned/'
|
| 11 |
|
| 12 |
openai.api_key = os.environ["OPENAI_API_KEY"]
|
| 13 |
|
| 14 |
+
system_message = "You are a comfort chatbot specialized in providing information on therapy, destressing activites, and student opportunities."
|
| 15 |
# Initial system message to set the behavior of the assistant
|
| 16 |
messages = [{"role": "system", "content": system_message}]
|
| 17 |
|
|
|
|
| 64 |
|
| 65 |
def generate_response(user_query, relevant_segment):
|
| 66 |
"""
|
| 67 |
+
Generate a response emphasizing the bot's capability in providing therapy, destressing activites, and student opportunities information.
|
| 68 |
"""
|
| 69 |
try:
|
| 70 |
user_message = f"Here's the information on your request: {relevant_segment}"
|