saherPervaiz commited on
Commit
9b3b3ee
·
verified ·
1 Parent(s): b3cc614

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -10,8 +10,16 @@ client = Groq(api_key=groq_api_key)
10
  # Function to fetch personalized advice using Groq API
11
  def get_personalized_advice(user_data):
12
  """Fetch personalized advice using the Groq API based on user data."""
13
- query = f"Based on the user's data: anxiety level: {user_data['anxiety_level']}, self-esteem: {user_data['self_esteem']}, mental health history: {user_data['mental_health_history']}, stress level: {user_data['stress_level']}, provide personalized mental health advice."
14
-
 
 
 
 
 
 
 
 
15
  try:
16
  response = client.chat.completions.create(
17
  messages=[{"role": "user", "content": query}],
 
10
  # Function to fetch personalized advice using Groq API
11
  def get_personalized_advice(user_data):
12
  """Fetch personalized advice using the Groq API based on user data."""
13
+ query = f"""
14
+ Based on the following user's responses:
15
+ - Anxiety level: {user_data['anxiety_level']}
16
+ - Self-esteem: {user_data['self_esteem']}
17
+ - Mental health history: {user_data['mental_health_history']}
18
+ - Stress level: {user_data['stress_level']}
19
+
20
+ Please provide personalized mental health advice tailored to these responses.
21
+ """
22
+
23
  try:
24
  response = client.chat.completions.create(
25
  messages=[{"role": "user", "content": query}],