Spaces:
Sleeping
Sleeping
duckduckgo
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
from smolagents import CodeAgent,
|
|
|
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -25,7 +26,7 @@ def search_tool(query:str)-> str:
|
|
| 25 |
query: A string representing a query
|
| 26 |
"""
|
| 27 |
try:
|
| 28 |
-
search =
|
| 29 |
result = search.invoke(query)
|
| 30 |
return f"I have found on the internet that {result} "
|
| 31 |
except Exception as e:
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, HfApiModel,load_tool,tool
|
| 2 |
+
from langchain_community.tools import DuckDuckGoSearchRun
|
| 3 |
import datetime
|
| 4 |
import requests
|
| 5 |
import pytz
|
|
|
|
| 26 |
query: A string representing a query
|
| 27 |
"""
|
| 28 |
try:
|
| 29 |
+
search = DuckDuckGoSearchResults()
|
| 30 |
result = search.invoke(query)
|
| 31 |
return f"I have found on the internet that {result} "
|
| 32 |
except Exception as e:
|