John Graham Reynolds commited on
Commit
2ee18f4
Β·
1 Parent(s): 6c2280c

confirm user feedback after being entered in form

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -215,7 +215,7 @@ def handle_user_input(user_input):
215
  def feedback():
216
  with st.form("feedback_form"):
217
  st.title("Feedback Form")
218
- sentiment_mapping = [":material/thumb_down:", ":material/thumb_up:"]
219
  # rating = None
220
  # while not rating:
221
  rating = st.feedback()
@@ -228,8 +228,8 @@ def feedback():
228
  # # rating = st.radio("Rate your experience:", ["πŸ‘", "Neutral", "πŸ‘Ž"])
229
  # review = {"rating": {rating}, "feedback": {feedback}}
230
  submitted = st.form_submit_button("Submit Feedback")
231
- if submitted:
232
- st.write(f"The feedback was: {sentiment_mapping[rating]} : {feedback}")
233
 
234
  # st.markdown(review)
235
  # time.sleep(5)
@@ -262,7 +262,10 @@ with main:
262
  handle_user_input(prompt)
263
  st.markdown("\n") #add some space for iphone users
264
  # with st.container():
265
- st.button('Give Feedback on Last Response', on_click=feedback)
 
 
 
266
 
267
  with st.sidebar:
268
  with st.container():
 
215
  def feedback():
216
  with st.form("feedback_form"):
217
  st.title("Feedback Form")
218
+ # sentiment_mapping = [":material/thumb_down:", ":material/thumb_up:"]
219
  # rating = None
220
  # while not rating:
221
  rating = st.feedback()
 
228
  # # rating = st.radio("Rate your experience:", ["πŸ‘", "Neutral", "πŸ‘Ž"])
229
  # review = {"rating": {rating}, "feedback": {feedback}}
230
  submitted = st.form_submit_button("Submit Feedback")
231
+ # if submitted:
232
+ # st.write(f"The feedback was: {sentiment_mapping[rating]} : {feedback}")
233
 
234
  # st.markdown(review)
235
  # time.sleep(5)
 
262
  handle_user_input(prompt)
263
  st.markdown("\n") #add some space for iphone users
264
  # with st.container():
265
+ gave_feedback = st.button('Give Feedback on Last Response', on_click=feedback)
266
+ if gave_feedback:
267
+ st.markdown("Feedback received! Thank you for your insight.")
268
+
269
 
270
  with st.sidebar:
271
  with st.container():