qq1023 commited on
Commit
d5e8f61
·
1 Parent(s): fd331b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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]