Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -148,6 +148,10 @@ def parse(category, chatbot):
|
|
148 |
"""Takes the chatbot prompt and response and updates the extracted information"""
|
149 |
global PARSING_REGEXP
|
150 |
|
|
|
|
|
|
|
|
|
151 |
if chatbot:
|
152 |
if len(chatbot) > 0:
|
153 |
answer = chatbot[0][1]
|
|
|
148 |
"""Takes the chatbot prompt and response and updates the extracted information"""
|
149 |
global PARSING_REGEXP
|
150 |
|
151 |
+
if category not in Category.__members__:
|
152 |
+
# Handle the case when an invalid category is provided
|
153 |
+
return {"error": "Invalid category provided"}
|
154 |
+
|
155 |
if chatbot:
|
156 |
if len(chatbot) > 0:
|
157 |
answer = chatbot[0][1]
|