Spaces:
Sleeping
Sleeping
Shane commited on
Commit ·
9778322
1
Parent(s): d0f59f2
use different python syntax, no test though...
Browse files- tools/web_search.py +1 -6
tools/web_search.py
CHANGED
|
@@ -54,11 +54,6 @@ class GoogleSearchTool(Tool):
|
|
| 54 |
if len(search_results) == 0:
|
| 55 |
raise Exception("No results found! Try a less restrictive/shorter query.")
|
| 56 |
|
| 57 |
-
#
|
| 58 |
-
for i, url in enumerate(search_results):
|
| 59 |
-
title = f"Result {i+1}" # Basic title since we don't get title data from this library
|
| 60 |
-
results.append(f"[{title}]({url})\n{url}")
|
| 61 |
-
|
| 62 |
-
return "## Search Results\n\n" + "\n\n".join(results)
|
| 63 |
except Exception as e:
|
| 64 |
return f"Error performing search: {str(e)}"
|
|
|
|
| 54 |
if len(search_results) == 0:
|
| 55 |
raise Exception("No results found! Try a less restrictive/shorter query.")
|
| 56 |
|
| 57 |
+
return "## Search Results\n\n" + "\n\n".join([f"[Result {i+1}]({url})\n{url}" for i, url in enumerate(search_results)])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
except Exception as e:
|
| 59 |
return f"Error performing search: {str(e)}"
|