(user_question)
| 52 | |
| 53 | |
| 54 | def handle_userinput(user_question): |
| 55 | response = st.session_state.conversation({'question': user_question}) |
| 56 | st.session_state.chat_history = response['chat_history'] |
| 57 | |
| 58 | for i, message in enumerate(st.session_state.chat_history): |
| 59 | if i % 2 == 0: |
| 60 | st.write(user_template.replace( |
| 61 | "{{MSG}}", message.content), unsafe_allow_html=True) |
| 62 | else: |
| 63 | st.write(bot_template.replace( |
| 64 | "{{MSG}}", message.content), unsafe_allow_html=True) |
| 65 | |
| 66 | |
| 67 | def main(): |