Added alternate endings
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def get_reply(response, username = None, histories = {}):
|
|
| 12 |
if username == None or username == "": return "<div class='chatbot'>Enter a username</div>", histories
|
| 13 |
history = histories.get(username, [])
|
| 14 |
history.append(response)
|
| 15 |
-
if response.endswith(("bye", "Bye", "bye.", "Bye.")):
|
| 16 |
histories[username] = []
|
| 17 |
return "<div class='chatbot'>Chatbot restarted</div>", histories
|
| 18 |
if len(history) > 4: history = history[-4:]
|
|
|
|
| 12 |
if username == None or username == "": return "<div class='chatbot'>Enter a username</div>", histories
|
| 13 |
history = histories.get(username, [])
|
| 14 |
history.append(response)
|
| 15 |
+
if response.endswith(("bye", "Bye", "bye.", "Bye.", "bye!", "Bye!","Hello", "Hi", "hello")):
|
| 16 |
histories[username] = []
|
| 17 |
return "<div class='chatbot'>Chatbot restarted</div>", histories
|
| 18 |
if len(history) > 4: history = history[-4:]
|