Rohan Kumar Singh commited on
Commit
6b278f6
·
1 Parent(s): 2607e34

added time

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -94,6 +94,7 @@ def generate_response(question):
94
  return "".join(preds)
95
 
96
  import uuid
 
97
  import os
98
  import streamlit as st
99
  from streamlit_chat import message
@@ -159,7 +160,8 @@ with container:
159
  chats.append("You: "+st.session_state['past'][i])
160
  chats.append("Bot: "+st.session_state['generated'][i])
161
  id=uuid.uuid4()
162
- info.insert_one({"message_id":str(id),"message":chats})
 
163
  st.success("Copy this id "+str(id)+" for downloading saved chat anytime anywhere and then paste it down below!")
164
  except Exception as e:
165
  st.error("Can't connect to MongoDB. Save Failed.")
 
94
  return "".join(preds)
95
 
96
  import uuid
97
+ import datetime
98
  import os
99
  import streamlit as st
100
  from streamlit_chat import message
 
160
  chats.append("You: "+st.session_state['past'][i])
161
  chats.append("Bot: "+st.session_state['generated'][i])
162
  id=uuid.uuid4()
163
+ time=datetime.datetime.now()
164
+ info.insert_one({"time of saving":time.strftime("%c"),"message_id":str(id),"message":chats})
165
  st.success("Copy this id "+str(id)+" for downloading saved chat anytime anywhere and then paste it down below!")
166
  except Exception as e:
167
  st.error("Can't connect to MongoDB. Save Failed.")