So I am creating a chatbot with a group of people. One of the features that I am trying to implement is a feedback system. I am trying to print the feedback to the console for debugging purposes but no matter what i do it doesnt seem to print, Here is the snippet code for the feedback:
# Accept user input
if prompt:
# Add user message to chat history
st.session_state.messages.append({"role": "user", "content": prompt})
# Display user message in chat message container
with st.chat_message("user"):
st.markdown(prompt)
# Display assistant response in chat message container
with st.chat_message("assistant"):
message_placeholder = st.empty()
result = qa.invoke({"question": prompt, "chat_history": st.session_state['history']})
st.session_state['history'].append((prompt, result['answer']))
if verbose:
message_placeholder.markdown(result['answer'], help=extract_chunks_from_result(result))
else:
message_placeholder.markdown(result['answer'])
show_feedback = not show_feedback
st.session_state.messages.append({"role": "assistant", "content": result['answer']})
if show_feedback:
feedback = streamlit_feedback(feedback_type="thumbs",optional_text_label="[Optional] Please provide an explanation",)
if feedback:
print(feedback)
Python 3.11.4 and Streamlit 1.32.1