Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
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.")
|