hardknee commited on
Commit
b8ac183
·
verified ·
1 Parent(s): 620cedc

Update app.py

Browse files

Updated error messages get_web_search_results

Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -24,14 +24,13 @@ def get_web_search_results(query: str)-> str: #it's import to specify the return
24
  """A tool that searchs the web using a query.
25
  Args:
26
  query: A string representing a valid web query. IMPORTANT: Follow type str format strictly e.g. 'pictures of cats'.
27
- Incorrect formatting (such as, query='picture of cats') will result in None being returned.
28
  """
29
  try:
30
  results = DuckDuckGoSearchTool.forward(query)
31
  if results and results != "None":
32
  return results
33
  else:
34
- return "Your query may be incorrectly formatted. Ensure it is of type str e.g. 'bananas'"
35
  except Exception as e:
36
  return f"{query} is an invalid query"
37
 
 
24
  """A tool that searchs the web using a query.
25
  Args:
26
  query: A string representing a valid web query. IMPORTANT: Follow type str format strictly e.g. 'pictures of cats'.
 
27
  """
28
  try:
29
  results = DuckDuckGoSearchTool.forward(query)
30
  if results and results != "None":
31
  return results
32
  else:
33
+ return "Your query may be incorrectly formatted or there may be an issue with search engine."
34
  except Exception as e:
35
  return f"{query} is an invalid query"
36