Spaces:
Paused
Paused
sonthaiha
commited on
Commit
·
5c25aef
1
Parent(s):
052b809
Fix: Correct duckduckgo_search import
Browse files- src/agents/researcher.py +3 -2
src/agents/researcher.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
from src.agents.base import BaseAgent
|
| 2 |
-
from
|
| 3 |
|
| 4 |
class ResearcherAgent(BaseAgent):
|
| 5 |
def __init__(self, engine):
|
| 6 |
-
super().__init__(engine, "researcher")
|
| 7 |
|
| 8 |
def search(self, query: str):
|
| 9 |
try:
|
| 10 |
with DDGS() as ddgs:
|
|
|
|
| 11 |
results = list(ddgs.text(query, max_results=4))
|
| 12 |
if not results: return "Search returned no results."
|
| 13 |
return str(results)
|
|
|
|
| 1 |
from src.agents.base import BaseAgent
|
| 2 |
+
from duckduckgo_search import DDGS # <--- FIXED IMPORT
|
| 3 |
|
| 4 |
class ResearcherAgent(BaseAgent):
|
| 5 |
def __init__(self, engine):
|
| 6 |
+
super().__init__(engine, "researcher")
|
| 7 |
|
| 8 |
def search(self, query: str):
|
| 9 |
try:
|
| 10 |
with DDGS() as ddgs:
|
| 11 |
+
# Max results 4 is usually enough for context
|
| 12 |
results = list(ddgs.text(query, max_results=4))
|
| 13 |
if not results: return "Search returned no results."
|
| 14 |
return str(results)
|