LamiaYT commited on
Commit
1bb2a88
·
1 Parent(s): 789c39e

Deploy GAIA agent

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -32,12 +32,13 @@ def web_search_tool(query: str) -> str:
32
  String containing search results
33
  """
34
  try:
35
- # Use duckduckgo_search directly with the current API
 
 
 
36
  results = []
37
- with DDGS() as ddgs:
38
- search_results = ddgs.text(query, max_results=5)
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."