ogegadavis254 commited on
Commit
81adcc7
·
verified ·
1 Parent(s): c4d0157

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
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
- with st.sidebar.beta_container():
119
- st.subheader("Diagnosis")
120
-
121
- diagnosis = analyze_diagnosis(st.session_state.messages, model_links[selected_model])
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 history
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))