datacipen commited on
Commit
e7fc1d5
·
verified ·
1 Parent(s): 0c71df4

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -7
main.py CHANGED
@@ -217,15 +217,11 @@ async def on_message(message: cl.Message):
217
 
218
  os.environ["GOOGLE_CSE_ID"] = os.getenv('GOOGLE_CSE_ID')
219
  os.environ["GOOGLE_API_KEY"] = os.getenv('GOOGLE_API_KEY')
220
- searchAPI = GoogleSearchAPIWrapper()
221
-
222
- def top5_results(query):
223
- return searchAPI.results(query, 5)
224
-
225
  tool = Tool(
226
- name="Google Search Snippets",
227
  description="Search Google for recent results.",
228
- func=top5_results,
229
  )
230
  print(tool.run(str(message.content)))
231
 
 
217
 
218
  os.environ["GOOGLE_CSE_ID"] = os.getenv('GOOGLE_CSE_ID')
219
  os.environ["GOOGLE_API_KEY"] = os.getenv('GOOGLE_API_KEY')
220
+ searchAPI = GoogleSearchAPIWrapper(k=10)
 
 
 
 
221
  tool = Tool(
222
+ name="google_search",
223
  description="Search Google for recent results.",
224
+ func=search.run,
225
  )
226
  print(tool.run(str(message.content)))
227