mou3az commited on
Commit
ceaa0db
1 Parent(s): bb2fbe5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -30,12 +30,16 @@ messages = [
30
  ]
31
 
32
  def handle_query(query: str, mode: str):
 
 
 
 
33
  if mode == "Chat":
34
  return chat_mode(query)
35
  elif mode == "Web-Search":
36
  return web_search(query)
37
  else:
38
- return "Invalid mode selected."
39
 
40
  def chat_mode(query: str):
41
  global messages
 
30
  ]
31
 
32
  def handle_query(query: str, mode: str):
33
+
34
+ # Check if query is empty
35
+ if not query.strip():
36
+ return "Enter a valid message."
37
  if mode == "Chat":
38
  return chat_mode(query)
39
  elif mode == "Web-Search":
40
  return web_search(query)
41
  else:
42
+ return "Select a valid mode."
43
 
44
  def chat_mode(query: str):
45
  global messages