|
14 | 14 | from components.sidebar import render_sidebar
|
15 | 15 | from components.chat_interface import render_chat_interface, handle_chat_input
|
16 | 16 | from components.emergency_page import render_emergency_page
|
| 17 | +from components.profile import apply_global_font_size |
17 | 18 |
|
18 | 19 | # --- 1. PAGE CONFIG & CSS ---
|
19 | 20 | apply_custom_css()
|
|
34 | 35 | "PTSD & Trauma", "OCD & Related Disorders", "Eating Disorders",
|
35 | 36 | "Substance Use Disorders", "ADHD & Neurodevelopmental", "Personality Disorders",
|
36 | 37 | "Sleep Disorders"
|
37 |
| - ], |
| 38 | +< ], |
38 | 39 | "selected_tone": "Compassionate Listener",
|
39 | 40 | "selected_mood": "🙂"
|
40 | 41 | }
|
41 | 42 |
|
| 43 | +# --- 2. SET PAGE CONFIG --- |
| 44 | +if "selected_tone" not in st.session_state: |
| 45 | + st.session_state.selected_tone = "Compassionate Listener" |
| 46 | + |
| 47 | +apply_global_font_size() |
| 48 | + |
| 49 | +# --- 3. APPLY STYLES & CONFIGURATIONS --- |
| 50 | +apply_custom_css() |
| 51 | +model = configure_gemini() |
| 52 | + |
| 53 | +# --- 4. TONE SELECTION DROPDOWN IN SIDEBAR --- |
| 54 | +TONE_OPTIONS = { |
| 55 | + "Compassionate Listener": "You are a compassionate listener — soft, empathetic, patient — like a therapist who listens without judgment.", |
| 56 | + "Motivating Coach": "You are a motivating coach — energetic, encouraging, and action-focused — helping the user push through rough days.", |
| 57 | + "Wise Friend": "You are a wise friend — thoughtful, poetic, and reflective — giving soulful responses and timeless advice.", |
| 58 | + "Neutral Therapist": "You are a neutral therapist — balanced, logical, and non-intrusive — asking guiding questions using CBT techniques.", |
| 59 | + "Mindfulness Guide": "You are a mindfulness guide — calm, slow, and grounding — focused on breathing, presence, and awareness." |
| 60 | +} |
| 61 | + |
| 62 | +} |
| 63 | + |
42 | 64 | for key, val in default_values.items():
|
43 | 65 | if key not in st.session_state:
|
44 | 66 | st.session_state[key] = val
|
|
70 | 92 | render_emergency_page()
|
71 | 93 | else:
|
72 | 94 | render_header()
|
73 |
| - st.subheader(f"🗣️ Current Chatbot Tone: **{st.session_state['selected_tone']}**") |
74 |
| - st.markdown(f"**🧠 Mood Selected:** {get_selected_mood()}") |
| 95 | + st.markdown(f""" |
| 96 | +<div style="text-align: center; margin: 20px 0;"> |
| 97 | + <h3>🗣️ Current Chatbot Tone: <strong>{st.session_state['selected_tone']}</strong></h3> |
| 98 | + <p><strong>🧠 Mood Selected:</strong> {get_selected_mood()}</p> |
| 99 | +</div> |
| 100 | +""", unsafe_allow_html=True) |
| 101 | + |
75 | 102 | render_chat_interface()
|
76 | 103 | handle_chat_input(model=model, system_prompt=get_tone_prompt())
|
77 | 104 |
|
|
0 commit comments