LamiaYT commited on
Commit
a5165c0
·
1 Parent(s): 5c82e33
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -24,10 +24,10 @@ class Toolbox:
24
  "gl": "us"
25
  }
26
  try:
27
- search = GoogleSearch(params)
28
- results = search.get_dict()
29
- if 'answerBox' in results:
30
- return results['answerBox'].get('snippet', results['answerBox'].get('answer'))
31
  elif 'organic_results' in results:
32
  return "\n".join([f"{res['title']}: {res['snippet']}" for res in results['organic_results'][:3]])
33
  return "No relevant results found."
 
24
  "gl": "us"
25
  }
26
  try:
27
+ client = GoogleSearch(params)
28
+ results = client.get_dict()
29
+ if 'answer_box' in results:
30
+ return results['answer_box'].get('snippet', results['answer_box'].get('answer'))
31
  elif 'organic_results' in results:
32
  return "\n".join([f"{res['title']}: {res['snippet']}" for res in results['organic_results'][:3]])
33
  return "No relevant results found."