Spaces:
Build error
Build error
Tobias Geisler commited on
Commit ·
8845a3f
1
Parent(s): e6d4d36
load chatbot: Check for empty chatbot ID
Browse files- tabs/chat.py +7 -0
tabs/chat.py
CHANGED
|
@@ -9,6 +9,13 @@ logger = logging.getLogger(__name__)
|
|
| 9 |
|
| 10 |
def load_chatbot(chatbot_id):
|
| 11 |
logger.info(f"Attempting to load chatbot with ID: {chatbot_id}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
try:
|
| 13 |
chatbot = get_chatbot(chatbot_id)
|
| 14 |
except Exception as e:
|
|
|
|
| 9 |
|
| 10 |
def load_chatbot(chatbot_id):
|
| 11 |
logger.info(f"Attempting to load chatbot with ID: {chatbot_id}")
|
| 12 |
+
if chatbot_id is None or chatbot_id == "":
|
| 13 |
+
return (
|
| 14 |
+
gr.update(value="# Chatbot\n\nWillkommen beim Chatbot"),
|
| 15 |
+
gr.update(value="", visible=True),
|
| 16 |
+
gr.update(value=""),
|
| 17 |
+
gr.update(value="Bitte gib eine Chatbot-ID ein.")
|
| 18 |
+
)
|
| 19 |
try:
|
| 20 |
chatbot = get_chatbot(chatbot_id)
|
| 21 |
except Exception as e:
|