Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -229,7 +229,12 @@ def save_conversation(chat_histories, session_id):
|
|
229 |
except Exception as e:
|
230 |
st.error(f"Error during Git operations: {e}")
|
231 |
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
233 |
|
234 |
def page1():
|
235 |
try:
|
@@ -328,12 +333,6 @@ def page1():
|
|
328 |
new_messages_placeholder.markdown(f"<div style='background-color: {background_color}; padding: 10px; border-radius: 10px; margin: 10px;'>{chat[0]}: {chat[1]}</div>", unsafe_allow_html=True)
|
329 |
|
330 |
|
331 |
-
# Combine chat histories from all pages
|
332 |
-
all_chat_histories = [
|
333 |
-
st.session_state['chat_history_page1'],
|
334 |
-
st.session_state['chat_history_page2'],
|
335 |
-
st.session_state['chat_history_page3']
|
336 |
-
]
|
337 |
|
338 |
# Save the combined chat histories
|
339 |
save_conversation(all_chat_histories, st.session_state['session_id'])
|
@@ -444,13 +443,6 @@ def page2():
|
|
444 |
st.text(f"Response time: {duration:.2f} seconds")
|
445 |
|
446 |
st.session_state['chat_history_page2'].append(("Bot", response, "new"))
|
447 |
-
|
448 |
-
# Combine chat histories from all pages
|
449 |
-
all_chat_histories = [
|
450 |
-
st.session_state['chat_history_page1'],
|
451 |
-
st.session_state['chat_history_page2'],
|
452 |
-
st.session_state['chat_history_page3']
|
453 |
-
]
|
454 |
|
455 |
save_conversation(st.session_state['chat_history_page2'], st.session_state['session_id'], 2)
|
456 |
|
@@ -569,12 +561,6 @@ def page3():
|
|
569 |
background_color = "#ffeecf" if chat[2] == "new" else "#ffeecf" if chat[0] == "User" else "#ffeecf"
|
570 |
new_messages_placeholder.markdown(f"<div style='background-color: {background_color}; padding: 10px; border-radius: 10px; margin: 10px;'>{chat[0]}: {chat[1]}</div>", unsafe_allow_html=True)
|
571 |
|
572 |
-
# Combine chat histories from all pages
|
573 |
-
all_chat_histories = [
|
574 |
-
st.session_state['chat_history_page1'],
|
575 |
-
st.session_state['chat_history_page2'],
|
576 |
-
st.session_state['chat_history_page3']
|
577 |
-
]
|
578 |
|
579 |
save_conversation(st.session_state['chat_history_page3'], st.session_state['session_id'], 3)
|
580 |
|
|
|
229 |
except Exception as e:
|
230 |
st.error(f"Error during Git operations: {e}")
|
231 |
|
232 |
+
# Combine chat histories from all pages
|
233 |
+
all_chat_histories = [
|
234 |
+
st.session_state['chat_history_page1'],
|
235 |
+
st.session_state['chat_history_page2'],
|
236 |
+
st.session_state['chat_history_page3']
|
237 |
+
]
|
238 |
|
239 |
def page1():
|
240 |
try:
|
|
|
333 |
new_messages_placeholder.markdown(f"<div style='background-color: {background_color}; padding: 10px; border-radius: 10px; margin: 10px;'>{chat[0]}: {chat[1]}</div>", unsafe_allow_html=True)
|
334 |
|
335 |
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
|
337 |
# Save the combined chat histories
|
338 |
save_conversation(all_chat_histories, st.session_state['session_id'])
|
|
|
443 |
st.text(f"Response time: {duration:.2f} seconds")
|
444 |
|
445 |
st.session_state['chat_history_page2'].append(("Bot", response, "new"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
|
447 |
save_conversation(st.session_state['chat_history_page2'], st.session_state['session_id'], 2)
|
448 |
|
|
|
561 |
background_color = "#ffeecf" if chat[2] == "new" else "#ffeecf" if chat[0] == "User" else "#ffeecf"
|
562 |
new_messages_placeholder.markdown(f"<div style='background-color: {background_color}; padding: 10px; border-radius: 10px; margin: 10px;'>{chat[0]}: {chat[1]}</div>", unsafe_allow_html=True)
|
563 |
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
|
565 |
save_conversation(st.session_state['chat_history_page3'], st.session_state['session_id'], 3)
|
566 |
|