zerito commited on
Commit
227f292
·
verified ·
1 Parent(s): ace15e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, load_tool, tool
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
- # Performing a DuckDuckGo search using the DuckDuckGoSearchTool
27
- search_results = DuckDuckGoSearchTool().run(search_query)
 
 
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: