Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,11 @@ def add_text_to_chatbot(chat_history, user_input):
|
|
54 |
|
55 |
chat_history = chat_history + [(user_input, None)]
|
56 |
return chat_history, ""
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
|
59 |
def main():
|
@@ -90,7 +95,7 @@ def main():
|
|
90 |
)
|
91 |
|
92 |
# Use the state to persist chat history between interactions
|
93 |
-
submit_btn.click(add_text_to_chatbot, [chat_history, user_txt], [chat_history, user_txt])
|
94 |
.then(bot_kadi, [chat_history], [chatbot])
|
95 |
|
96 |
clear_btn.click(lambda: ([], ""), None, [chat_history, chatbot, user_txt])
|
|
|
54 |
|
55 |
chat_history = chat_history + [(user_input, None)]
|
56 |
return chat_history, ""
|
57 |
+
|
58 |
+
def show_user(chat_history)
|
59 |
+
|
60 |
+
def show_history(chat_history):
|
61 |
+
return chat_history[-1][0], ""
|
62 |
|
63 |
|
64 |
def main():
|
|
|
95 |
)
|
96 |
|
97 |
# Use the state to persist chat history between interactions
|
98 |
+
submit_btn.click(add_text_to_chatbot, [chat_history, user_txt], [chat_history, user_txt]).then(show_history,[chat_history], [chatbot]
|
99 |
.then(bot_kadi, [chat_history], [chatbot])
|
100 |
|
101 |
clear_btn.click(lambda: ([], ""), None, [chat_history, chatbot, user_txt])
|