Summary
After like button is pressed st.text_input should appear where user can type comment and it will be saved after enter is pressed to .txt file. The problem is after like is pressed, nothing happens, there is no text box, the streamlit just shows running for half sec and nothing else happens.
Steps to reproduce
Code snippet:
def save_likes_to_txt(answer,comment):
with open("likes.txt", 'a') as f:
f.write("Bot: " + answer + "\n")
f.write("Comment: " + comment + "\n\n")
f.write("\n" + "*" * 80 + "\n\n")
def likes(full_response):
user_comment = st.text_input("Add comment here: ")
if user_comment:
save_likes_to_txt(full_response,user_comment)
with st.chat_message("assistant"):
full_response = result["answer"]
st.markdown(full_response)
if st.button(":thumbsup:"):
likes(full_response)