Update main.py
Browse files
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="
|
227 |
description="Search Google for recent results.",
|
228 |
-
func=
|
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 |
|