Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,14 +4,15 @@ import requests
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
import sympy
|
| 7 |
-
from duckduckgo_search import
|
| 8 |
from langgraph.graph import StateGraph, END
|
| 9 |
from typing import TypedDict
|
| 10 |
|
| 11 |
# --- Tools ---
|
| 12 |
|
| 13 |
def wikipedia_search_tool(input: str) -> str:
|
| 14 |
-
|
|
|
|
| 15 |
if results:
|
| 16 |
return results[0].get("body", "No information found.")
|
| 17 |
return "No information found."
|
|
|
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
import sympy
|
| 7 |
+
from duckduckgo_search import DDGS
|
| 8 |
from langgraph.graph import StateGraph, END
|
| 9 |
from typing import TypedDict
|
| 10 |
|
| 11 |
# --- Tools ---
|
| 12 |
|
| 13 |
def wikipedia_search_tool(input: str) -> str:
|
| 14 |
+
ddgs = DDGS()
|
| 15 |
+
results = ddgs.text(input, max_results=3)
|
| 16 |
if results:
|
| 17 |
return results[0].get("body", "No information found.")
|
| 18 |
return "No information found."
|