Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,21 +49,23 @@ def generate_response(user_input):
|
|
49 |
# Add a suggestion for coping activity based on keywords in user input
|
50 |
if "angry" in user_input.lower() or "frustrated" in user_input.lower():
|
51 |
activity_suggestion = (
|
52 |
-
"
|
53 |
-
"
|
|
|
|
|
54 |
)
|
55 |
elif "sad" in user_input.lower() or "lonely" in user_input.lower():
|
56 |
activity_suggestion = (
|
57 |
-
"Writing about your feelings can be very therapeutic. "
|
58 |
-
"
|
59 |
)
|
60 |
else:
|
61 |
activity_suggestion = (
|
62 |
-
"
|
63 |
-
"Art
|
64 |
)
|
65 |
|
66 |
-
#
|
67 |
response = f"{response_text}\n\nHere's something you could try to help cope with how you're feeling:\n{activity_suggestion}"
|
68 |
|
69 |
return response
|
|
|
49 |
# Add a suggestion for coping activity based on keywords in user input
|
50 |
if "angry" in user_input.lower() or "frustrated" in user_input.lower():
|
51 |
activity_suggestion = (
|
52 |
+
"When feeling angry or overwhelmed by work, it’s important to take a step back. "
|
53 |
+
"Deep breathing exercises can help calm your mind and regain some control. "
|
54 |
+
"Try inhaling for four counts, holding for four counts, and exhaling for four counts. "
|
55 |
+
"Doing this for a few minutes can make a world of difference."
|
56 |
)
|
57 |
elif "sad" in user_input.lower() or "lonely" in user_input.lower():
|
58 |
activity_suggestion = (
|
59 |
+
"Writing about your feelings can be very therapeutic. Try journaling as a way to process and release some of your emotions. "
|
60 |
+
"You don’t need to worry about grammar or structure—just let your thoughts flow."
|
61 |
)
|
62 |
else:
|
63 |
activity_suggestion = (
|
64 |
+
"Sometimes, a creative outlet can be a great way to cope with overwhelming feelings. "
|
65 |
+
"Art, whether it’s drawing, painting, or even coloring, allows you to express what you might not be able to say out loud."
|
66 |
)
|
67 |
|
68 |
+
# Add a closing empathetic sentence
|
69 |
response = f"{response_text}\n\nHere's something you could try to help cope with how you're feeling:\n{activity_suggestion}"
|
70 |
|
71 |
return response
|