Spaces:
Runtime error
Runtime error
Deploy GAIA agent
Browse files
app.py
CHANGED
@@ -32,12 +32,13 @@ def web_search_tool(query: str) -> str:
|
|
32 |
String containing search results
|
33 |
"""
|
34 |
try:
|
35 |
-
#
|
|
|
|
|
|
|
36 |
results = []
|
37 |
-
|
38 |
-
|
39 |
-
for r in search_results:
|
40 |
-
results.append(f"Title: {r['title']}\nURL: {r['href']}\nSnippet: {r['body']}")
|
41 |
|
42 |
if not results:
|
43 |
return "No search results found."
|
|
|
32 |
String containing search results
|
33 |
"""
|
34 |
try:
|
35 |
+
# Simplified DDGS usage without any arguments
|
36 |
+
ddgs = DDGS()
|
37 |
+
search_results = ddgs.text(query, max_results=5)
|
38 |
+
|
39 |
results = []
|
40 |
+
for r in search_results:
|
41 |
+
results.append(f"Title: {r['title']}\nURL: {r['href']}\nSnippet: {r['body']}")
|
|
|
|
|
42 |
|
43 |
if not results:
|
44 |
return "No search results found."
|