Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -113,14 +113,12 @@ if "messages" not in st.session_state:
|
|
113 |
selected_model = st.sidebar.selectbox("Select Model", list(model_links.keys()))
|
114 |
reset_button = st.sidebar.button('Reset Chat', on_click=reset_conversation)
|
115 |
|
116 |
-
# Add diagnostic feature to the sidebar
|
117 |
if len(st.session_state.messages) >= 3:
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
if diagnosis:
|
123 |
-
st.write(diagnosis)
|
124 |
|
125 |
# Add cautionary message about testing phase at the bottom of the sidebar
|
126 |
st.sidebar.markdown("**Note**: This model is still in the beta phase. Responses may be inaccurate or undesired. Use it cautiously, especially for critical issues.")
|
@@ -154,5 +152,5 @@ if prompt := st.chat_input(f"Hi, I'm {selected_model}, let's chat"):
|
|
154 |
if st.button("After the analysing our session you may need some extra help, so you can reach out to a certified therapist at +25493609747 Name: Ogega feel free to talk"):
|
155 |
st.write("You can reach out to a certified therapist at +25493609747.")
|
156 |
|
157 |
-
# Add assistant response to chat
|
158 |
st.session_state.messages.append(("assistant", assistant_response))
|
|
|
113 |
selected_model = st.sidebar.selectbox("Select Model", list(model_links.keys()))
|
114 |
reset_button = st.sidebar.button('Reset Chat', on_click=reset_conversation)
|
115 |
|
116 |
+
# Add diagnostic feature to the sidebar after at least 3 messages are input by the user
|
117 |
if len(st.session_state.messages) >= 3:
|
118 |
+
diagnosis = analyze_diagnosis(st.session_state.messages, model_links[selected_model])
|
119 |
+
if diagnosis:
|
120 |
+
st.sidebar.subheader("Diagnosis")
|
121 |
+
st.sidebar.write(diagnosis)
|
|
|
|
|
122 |
|
123 |
# Add cautionary message about testing phase at the bottom of the sidebar
|
124 |
st.sidebar.markdown("**Note**: This model is still in the beta phase. Responses may be inaccurate or undesired. Use it cautiously, especially for critical issues.")
|
|
|
152 |
if st.button("After the analysing our session you may need some extra help, so you can reach out to a certified therapist at +25493609747 Name: Ogega feel free to talk"):
|
153 |
st.write("You can reach out to a certified therapist at +25493609747.")
|
154 |
|
155 |
+
# Add assistant response to chat histor
|
156 |
st.session_state.messages.append(("assistant", assistant_response))
|