Update app.py
Browse files
app.py
CHANGED
|
@@ -108,19 +108,27 @@ def handle_userinput(user_question):
|
|
| 108 |
|
| 109 |
for i, message in enumerate(st.session_state.chat_history):
|
| 110 |
if i % 2 == 0:
|
| 111 |
-
|
| 112 |
-
st.write(
|
| 113 |
else:
|
| 114 |
-
|
| 115 |
-
st.write(
|
| 116 |
-
|
| 117 |
# for i, message in enumerate(st.session_state.chat_history):
|
| 118 |
# if i % 2 == 0:
|
| 119 |
-
#
|
| 120 |
-
#
|
| 121 |
# else:
|
| 122 |
-
#
|
| 123 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
|
| 126 |
def main():
|
|
|
|
| 108 |
|
| 109 |
for i, message in enumerate(st.session_state.chat_history):
|
| 110 |
if i % 2 == 0:
|
| 111 |
+
st.write(user_template.replace("{{MSG}}", message.content), unsafe_allow_html=True
|
| 112 |
+
# st.write(f"<div style='color: gray;'>User: {message['content']}</div>", unsafe_allow_html=True)
|
| 113 |
else:
|
| 114 |
+
st.write(bot_template.replace("{{MSG}}", message.content), unsafe_allow_html=True
|
| 115 |
+
# st.write(f"<div style='color: black;'>Bot: {message['content']}</div>", unsafe_allow_html=True)
|
| 116 |
+
|
| 117 |
# for i, message in enumerate(st.session_state.chat_history):
|
| 118 |
# if i % 2 == 0:
|
| 119 |
+
# # Display user messages
|
| 120 |
+
# st.write(user_template.replace("{{MSG}}", message["content"]), unsafe_allow_html=True)
|
| 121 |
# else:
|
| 122 |
+
# # Display assistant messages
|
| 123 |
+
# st.write(bot_template.replace("{{MSG}}", message["content"]), unsafe_allow_html=True)
|
| 124 |
+
|
| 125 |
+
for i, message in enumerate(st.session_state.chat_history):
|
| 126 |
+
if i % 2 == 0:
|
| 127 |
+
st.write(user_template.replace("{{MSG}}", message.content), unsafe_allow_html=True
|
| 128 |
+
# st.write(f"<div style='color: gray;'>User: {message['content']}</div>", unsafe_allow_html=True)
|
| 129 |
+
else:
|
| 130 |
+
st.write(bot_template.replace("{{MSG}}", message.content), unsafe_allow_html=True
|
| 131 |
+
# st.write(f"<div style='color: black;'>Bot: {message['content']}</div>", unsafe_allow_html=True)
|
| 132 |
|
| 133 |
|
| 134 |
def main():
|