I want to add a like and option for each answer in a chatbot (like ChatGPT) to collect feedback and use that for fine tuning. I need ideas for how I can do this?
Expected behavior:
When user clicks , it should highlight and vice versa, just like radio buttons! I should also be able to receive input in variables so that I can use that to store feedback to a CSV.
What I have tried:
I tried using button group component - New Component: Button Group
As soon as it reaches the code block for st_btn_group, the app reruns MULTIPLE times, that makes it very glitchy. Is there any possible solution for this?
user_input = st.chat_input("Type your question here or type an SQL query to run...")
if user_input:
logging.info(f"Received new user input - {user_input}")
# Processing the user input here ---
# After processing -
with st.chat_message("assistant"):
st.markdown("answer from LLM")
# Feedback code
feedback = streamlit_feedback(feedback_type="thumbs", key=query_id_key)
print(feedback)
Sorry this is a very small part of the code because the code is v large. Now here if I click on either like or dislike, the app reruns without storing the feedback and goes to my history display loop. How do I store this feedback? Any ideas?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking โAccept allโ, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.