mery22 commited on
Commit
edb146d
·
verified ·
1 Parent(s): 6bc114e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -115,22 +115,19 @@ with st.form(key='interaction_form'):
115
  st.markdown("### Bot:")
116
  st.text_area("", value=bot_response, height=600)
117
 
118
- # Feedback form
119
  st.markdown("### Rate the response:")
120
  rating = st.slider("Select a rating:", min_value=1, max_value=5, value=1, key="rating")
121
 
122
  st.markdown("### Leave a comment:")
123
  comment = st.text_area("", key="comment")
124
 
125
- # Feedback submission
126
- feedback_submit_button = st.form_submit_button("Submit Feedback")
127
-
128
- if feedback_submit_button:
129
- if user_input.strip() and comment.strip():
130
- save_feedback(user_input, bot_response, rating, comment)
131
- st.success("Thank you for your feedback!")
132
- else:
133
- st.warning("Please provide both input and comment.")
134
 
135
  st.markdown("---")
136
  st.markdown("Collaboration is the key to success. Each question finds its answer, each challenge becomes an opportunity.")
 
115
  st.markdown("### Bot:")
116
  st.text_area("", value=bot_response, height=600)
117
 
118
+ # Feedback form within the same interaction form
119
  st.markdown("### Rate the response:")
120
  rating = st.slider("Select a rating:", min_value=1, max_value=5, value=1, key="rating")
121
 
122
  st.markdown("### Leave a comment:")
123
  comment = st.text_area("", key="comment")
124
 
125
+ # Feedback submission handled in the same form
126
+ if user_input.strip() and comment.strip():
127
+ save_feedback(user_input, bot_response, rating, comment)
128
+ st.success("Thank you for your feedback!")
129
+ else:
130
+ st.warning("Please provide both input and comment.")
 
 
 
131
 
132
  st.markdown("---")
133
  st.markdown("Collaboration is the key to success. Each question finds its answer, each challenge becomes an opportunity.")