Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import CodeAgent,
|
| 2 |
import requests
|
| 3 |
from tools.final_answer import FinalAnswerTool
|
| 4 |
from Gradio_UI import GradioUI
|
|
@@ -23,8 +23,10 @@ def get_btc_price() -> str:
|
|
| 23 |
def get_btc_news() -> str:
|
| 24 |
"""Fetches the latest Bitcoin news from DuckDuckGo search."""
|
| 25 |
search_query = "latest Bitcoin news"
|
| 26 |
-
#
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
|
| 29 |
# Ensure search_results is a list of articles with titles and meta descriptions
|
| 30 |
try:
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, HfApiModel, load_tool, tool, DuckDuckGoSearchTool
|
| 2 |
import requests
|
| 3 |
from tools.final_answer import FinalAnswerTool
|
| 4 |
from Gradio_UI import GradioUI
|
|
|
|
| 23 |
def get_btc_news() -> str:
|
| 24 |
"""Fetches the latest Bitcoin news from DuckDuckGo search."""
|
| 25 |
search_query = "latest Bitcoin news"
|
| 26 |
+
# Initialize the DuckDuckGoSearchTool
|
| 27 |
+
search_tool = DuckDuckGoSearchTool()
|
| 28 |
+
# Perform the search
|
| 29 |
+
search_results = search_tool.run(search_query)
|
| 30 |
|
| 31 |
# Ensure search_results is a list of articles with titles and meta descriptions
|
| 32 |
try:
|