Laura Biester
commited on
Commit
·
c78fdcb
1
Parent(s):
8ad0b98
Update bots option
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ def middchat(bot_cache: BotCache, message: str, history: List[Tuple[str, str]])
|
|
| 21 |
"""
|
| 22 |
# get the bot options
|
| 23 |
# for new chats, fetch new bots
|
| 24 |
-
if
|
| 25 |
all_bots = bot_cache.update()
|
| 26 |
else:
|
| 27 |
all_bots = bot_cache.bots
|
|
@@ -68,7 +68,7 @@ def middchat(bot_cache: BotCache, message: str, history: List[Tuple[str, str]])
|
|
| 68 |
|
| 69 |
cache = BotCache()
|
| 70 |
chat_partial = partial(middchat, cache)
|
| 71 |
-
initial_msg = "Welcome to MiddChat!\n" + chat_partial("", []) + "\nPlease note that if you want to reset your chat, you should refresh this page
|
| 72 |
chatbot = gr.Chatbot([(initial_msg, None)])
|
| 73 |
demo = gr.ChatInterface(
|
| 74 |
fn=chat_partial,
|
|
|
|
| 21 |
"""
|
| 22 |
# get the bot options
|
| 23 |
# for new chats, fetch new bots
|
| 24 |
+
if message == "update bots":
|
| 25 |
all_bots = bot_cache.update()
|
| 26 |
else:
|
| 27 |
all_bots = bot_cache.bots
|
|
|
|
| 68 |
|
| 69 |
cache = BotCache()
|
| 70 |
chat_partial = partial(middchat, cache)
|
| 71 |
+
initial_msg = "Welcome to MiddChat!\n" + chat_partial("", []) + "\n\nPlease note that if you want to reset your chat, you should refresh this page!\nIf you want to update the bot list, type \"update bots\""
|
| 72 |
chatbot = gr.Chatbot([(initial_msg, None)])
|
| 73 |
demo = gr.ChatInterface(
|
| 74 |
fn=chat_partial,
|