Streamlit chat feature with answer feedback

Hi. I’m building a chatbot with LLM in streamlit, and I’m including thumbs up/down buttons for the user to vote on every answer provided. In addition, I want the user to submit feedback on every answer, is it feasible?

if st.button(f"👍 Like"):
       #do something
    if st.button(f"👎 Dislike"):
        #do something

    feedback_text = st.text_input("Submit Feedback:")
    if st.button("Submit Feedback"):
        #do something
   else:
      # expecting feedback on every answer
      st.stop()


1 Like

Thanks. That worked well!

1 Like

Hi All,

I am new to Streamlit. I have a similar use case and I am facing below issues

  1. Inside a sidebar, I have a text box input to get the feedback and on pressing enter or submit button the sidebar closes. So even though I have written the if section of the code, it doesnt write back to the screen as sidebar closes.
  2. I want to use edit_stream_response to write this feedback as a field to my csv file

Any help would be appreciated. Thank you!