Update tools.py
Browse files
tools.py
CHANGED
@@ -70,7 +70,6 @@ def create_search_tool() -> Graph:
|
|
70 |
|
71 |
def search_function(state: Dict[str, Any]) -> dict:
|
72 |
with DDGS() as ddgs:
|
73 |
-
# Run search
|
74 |
raw_results = list(ddgs.text(
|
75 |
state["input"]["query"],
|
76 |
max_results=state["input"].get("max_results", 3)
|
@@ -81,7 +80,7 @@ def create_search_tool() -> Graph:
|
|
81 |
try:
|
82 |
results.append({
|
83 |
"title": r.get("title", ""),
|
84 |
-
"link": r.get("href", r.get("link", "")),
|
85 |
"snippet": r.get("body", r.get("snippet", ""))
|
86 |
})
|
87 |
except Exception as e:
|
|
|
70 |
|
71 |
def search_function(state: Dict[str, Any]) -> dict:
|
72 |
with DDGS() as ddgs:
|
|
|
73 |
raw_results = list(ddgs.text(
|
74 |
state["input"]["query"],
|
75 |
max_results=state["input"].get("max_results", 3)
|
|
|
80 |
try:
|
81 |
results.append({
|
82 |
"title": r.get("title", ""),
|
83 |
+
"link": r.get("href", r.get("link", "")),
|
84 |
"snippet": r.get("body", r.get("snippet", ""))
|
85 |
})
|
86 |
except Exception as e:
|