Update app.py
Browse files
app.py
CHANGED
@@ -192,13 +192,16 @@ class ChatbotAPP:
|
|
192 |
self.chat_history.append((prompt,output))
|
193 |
return self.chat_history
|
194 |
|
|
|
|
|
|
|
195 |
|
196 |
def start_chat_button_fn(self,agree_status): # Method to handle the start chat button action
|
197 |
|
198 |
if agree_status:
|
199 |
self.agreed = agree_status
|
200 |
-
self.
|
201 |
-
return f"You can start chatting now"
|
202 |
else:
|
203 |
return "You must agree to the terms and conditions to proceed"
|
204 |
|
@@ -226,6 +229,7 @@ class ChatbotAPP:
|
|
226 |
#message2 = reset_name_interface()
|
227 |
#message3 = load_model()
|
228 |
self.unique_id = self.generate_unique_id()
|
|
|
229 |
return f"All Chat components have been rest. Uniqe ID for this session is, {self.unique_id}. Please note this down.",self.unique_id
|
230 |
|
231 |
|
|
|
192 |
self.chat_history.append((prompt,output))
|
193 |
return self.chat_history
|
194 |
|
195 |
+
def update_chatlog_name(self):
|
196 |
+
self.chat_log_name = f'chat_log_for_{self.unique_id}_{datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}.json'
|
197 |
+
return self.chat_log_name
|
198 |
|
199 |
def start_chat_button_fn(self,agree_status): # Method to handle the start chat button action
|
200 |
|
201 |
if agree_status:
|
202 |
self.agreed = agree_status
|
203 |
+
self.update_chatlog_name()
|
204 |
+
return f"You can start chatting now."
|
205 |
else:
|
206 |
return "You must agree to the terms and conditions to proceed"
|
207 |
|
|
|
229 |
#message2 = reset_name_interface()
|
230 |
#message3 = load_model()
|
231 |
self.unique_id = self.generate_unique_id()
|
232 |
+
self.update_chatlog_name()
|
233 |
return f"All Chat components have been rest. Uniqe ID for this session is, {self.unique_id}. Please note this down.",self.unique_id
|
234 |
|
235 |
|