Paperbag commited on
Commit
6a9721c
·
1 Parent(s): 26c24d0

update ddgs

Browse files
Files changed (1) hide show
  1. agent.py +5 -2
agent.py CHANGED
@@ -42,8 +42,11 @@ def web_search(keywords: str, max_results:int = 5) -> str:
42
  """
43
  with DDGS() as ddgs:
44
  # Perform a text search
45
- results = ddgs.text(keywords, max_results)
46
- print(results)
 
 
 
47
 
48
 
49
  class AgentState(TypedDict):
 
42
  """
43
  with DDGS() as ddgs:
44
  # Perform a text search
45
+ output = ""
46
+ results = ddgs.text(keywords, max_results = max_results)
47
+ for result in results:
48
+ output += f"{result['title']}\n{result['body']}\n{result['url']}\n\n"
49
+ return(output)
50
 
51
 
52
  class AgentState(TypedDict):