update ddgs
Browse files
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 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
| 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):
|