Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,12 @@ def get_personalized_advice(user_data):
|
|
30 |
|
31 |
# Function to display the chatbot interface
|
32 |
def chatbot_interface():
|
|
|
33 |
st.title("π Professional Student Well-being Chatbot")
|
34 |
-
st.markdown("
|
|
|
|
|
|
|
35 |
|
36 |
# Initialize session state
|
37 |
if 'step' not in st.session_state:
|
@@ -53,7 +57,7 @@ def chatbot_interface():
|
|
53 |
|
54 |
# Step 1: Greet the user
|
55 |
if st.session_state.step == 0:
|
56 |
-
st.session_state.chat_history.append({"role": "assistant", "content": "Hello! How are you feeling today? π
|
57 |
user_input = st.text_input("You:", "")
|
58 |
if user_input:
|
59 |
st.session_state.chat_history.append({"role": "user", "content": user_input})
|
@@ -61,7 +65,7 @@ def chatbot_interface():
|
|
61 |
|
62 |
# Step 2: Form to collect data (Anxiety Level, Self-Esteem, Mental Health, Stress)
|
63 |
elif st.session_state.step == 1:
|
64 |
-
st.session_state.chat_history.append({"role": "assistant", "content": "Please
|
65 |
|
66 |
with st.form("Well-being Form"):
|
67 |
anxiety_level = st.slider("Anxiety Level (1 to 10)", 1, 10, 5)
|
@@ -84,7 +88,7 @@ def chatbot_interface():
|
|
84 |
|
85 |
# Step 3: Provide Personalized Advice
|
86 |
elif st.session_state.step == 2:
|
87 |
-
st.session_state.chat_history.append({"role": "assistant", "content": "Thank you for
|
88 |
user_data = st.session_state.user_data
|
89 |
st.write(f"Anxiety Level: {user_data['anxiety_level']}")
|
90 |
st.write(f"Self-Esteem Level: {user_data['self_esteem']}")
|
|
|
30 |
|
31 |
# Function to display the chatbot interface
|
32 |
def chatbot_interface():
|
33 |
+
st.set_page_config(page_title="Student Well-being Chatbot", page_icon="π", layout="centered")
|
34 |
st.title("π Professional Student Well-being Chatbot")
|
35 |
+
st.markdown("""
|
36 |
+
#### Welcome! Let's assess your well-being and provide some helpful advice.
|
37 |
+
Fill in the details below, and we'll tailor our suggestions based on your inputs.
|
38 |
+
""")
|
39 |
|
40 |
# Initialize session state
|
41 |
if 'step' not in st.session_state:
|
|
|
57 |
|
58 |
# Step 1: Greet the user
|
59 |
if st.session_state.step == 0:
|
60 |
+
st.session_state.chat_history.append({"role": "assistant", "content": "Hello! How are you feeling today? π Let's start your well-being assessment!"})
|
61 |
user_input = st.text_input("You:", "")
|
62 |
if user_input:
|
63 |
st.session_state.chat_history.append({"role": "user", "content": user_input})
|
|
|
65 |
|
66 |
# Step 2: Form to collect data (Anxiety Level, Self-Esteem, Mental Health, Stress)
|
67 |
elif st.session_state.step == 1:
|
68 |
+
st.session_state.chat_history.append({"role": "assistant", "content": "Please provide the following details to help me understand your well-being:"})
|
69 |
|
70 |
with st.form("Well-being Form"):
|
71 |
anxiety_level = st.slider("Anxiety Level (1 to 10)", 1, 10, 5)
|
|
|
88 |
|
89 |
# Step 3: Provide Personalized Advice
|
90 |
elif st.session_state.step == 2:
|
91 |
+
st.session_state.chat_history.append({"role": "assistant", "content": "Thank you for submitting your information! Here's a summary of your well-being:"})
|
92 |
user_data = st.session_state.user_data
|
93 |
st.write(f"Anxiety Level: {user_data['anxiety_level']}")
|
94 |
st.write(f"Self-Esteem Level: {user_data['self_esteem']}")
|