ECUiVADE commited on
Commit
aecf31a
1 Parent(s): e5f51b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -143,6 +143,9 @@ class ChatbotAPP:
143
 
144
  #if not len(Name) == 0 and not len(Occupation) == 0 and not len(Ethnicity) == 0 and not len(Gender) == 0 and not len(Age) == 0 and not len(YearsOfExp):
145
  if self.agreed:
 
 
 
146
  firstmsg =""
147
  if self.isFirstRun:
148
  self.context = self.initContext
@@ -174,10 +177,13 @@ class ChatbotAPP:
174
  # yield response
175
 
176
  cleaned_response = self.strip_text(response)
 
 
 
177
 
178
  self.chat_history.append((prompt,cleaned_response))
179
  if not self.isFirstRun:
180
- self.chat_log_history.append({"user": prompt, "bot": cleaned_response})
181
  self.upload_to_google_drive()
182
 
183
  else:
 
143
 
144
  #if not len(Name) == 0 and not len(Occupation) == 0 and not len(Ethnicity) == 0 and not len(Gender) == 0 and not len(Age) == 0 and not len(YearsOfExp):
145
  if self.agreed:
146
+
147
+ user_msg_timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") #capture timestamp the user message is recieved.
148
+
149
  firstmsg =""
150
  if self.isFirstRun:
151
  self.context = self.initContext
 
177
  # yield response
178
 
179
  cleaned_response = self.strip_text(response)
180
+
181
+ bot_msg_timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") #Time stamp after the generating response.
182
+
183
 
184
  self.chat_history.append((prompt,cleaned_response))
185
  if not self.isFirstRun:
186
+ self.chat_log_history.append({"user": "("+user_msg_timestamp+")"+prompt, "bot": "("+bot_msg_timestamp+")"+cleaned_response})
187
  self.upload_to_google_drive()
188
 
189
  else: