Bey007 commited on
Commit
e2bfbca
·
verified ·
1 Parent(s): 08b8e7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
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
- "Sometimes, deep breathing exercises can help calm your mind. "
53
- "Try taking slow, deep breaths to regain a sense of calm and focus."
 
 
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
- "Try journaling as a way to process and release some of your emotions."
59
  )
60
  else:
61
  activity_suggestion = (
62
- "Finding a creative outlet like drawing or painting can help. "
63
- "Art is a way to express feelings that might be difficult to put into words."
64
  )
65
 
66
- # Append the activity suggestion to the generated response
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