Update app.py
Browse files
app.py
CHANGED
@@ -95,16 +95,13 @@ def handle_userinput(user_question,vectorstore):
|
|
95 |
)["answer"]
|
96 |
|
97 |
st.session_state.chat_history = response['chat_history']
|
98 |
-
|
99 |
-
|
100 |
|
|
|
101 |
for i, message in enumerate(st.session_state.chat_history):
|
102 |
if i % 2 == 0:
|
103 |
-
st.write(user_template.replace(
|
104 |
-
"{{MSG}}", message.content), unsafe_allow_html=True)
|
105 |
else:
|
106 |
-
st.write(bot_template.replace(
|
107 |
-
"{{MSG}}", message.content), unsafe_allow_html=True)
|
108 |
|
109 |
if 'retrieved_documents' in response:
|
110 |
st.subheader("Retrieved Documents")
|
|
|
95 |
)["answer"]
|
96 |
|
97 |
st.session_state.chat_history = response['chat_history']
|
|
|
|
|
98 |
|
99 |
+
# Display messages in chat history
|
100 |
for i, message in enumerate(st.session_state.chat_history):
|
101 |
if i % 2 == 0:
|
102 |
+
st.write(user_template.replace("{{MSG}}", message.content), unsafe_allow_html=True)
|
|
|
103 |
else:
|
104 |
+
st.write(bot_template.replace("{{MSG}}", message.content), unsafe_allow_html=True)
|
|
|
105 |
|
106 |
if 'retrieved_documents' in response:
|
107 |
st.subheader("Retrieved Documents")
|