zerito commited on
Commit
1ef3034
·
verified ·
1 Parent(s): f755820

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from smolagents import CodeAgent, HfApiModel, load_tool, tool
2
  import requests
3
  from tools.final_answer import FinalAnswerTool
4
  from Gradio_UI import GradioUI
@@ -36,9 +36,6 @@ def get_btc_data(query: str) -> str:
36
  # Initialize the FinalAnswerTool
37
  final_answer = FinalAnswerTool()
38
 
39
- # Load the DuckDuckGoSearchTool
40
- duckduckgo_search_tool = load_tool("smolai/duckduckgo-search-tool", trust_remote_code=True)
41
-
42
  # Initialize the model
43
  model = HfApiModel(
44
  max_tokens=2096,
@@ -50,7 +47,7 @@ model = HfApiModel(
50
  # Create the agent
51
  agent = CodeAgent(
52
  model=model,
53
- tools=[get_btc_price, get_btc_data, duckduckgo_search_tool, final_answer], # Add your tools here
54
  max_steps=6,
55
  verbosity_level=1,
56
  grammar=None,
@@ -61,4 +58,4 @@ agent = CodeAgent(
61
  )
62
 
63
  # Launch the Gradio interface
64
- GradioUI(agent).launch()
 
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
 
36
  # Initialize the FinalAnswerTool
37
  final_answer = FinalAnswerTool()
38
 
 
 
 
39
  # Initialize the model
40
  model = HfApiModel(
41
  max_tokens=2096,
 
47
  # Create the agent
48
  agent = CodeAgent(
49
  model=model,
50
+ tools=[get_btc_price, get_btc_data, DuckDuckGoSearchTool(), final_answer], # Add your tools here
51
  max_steps=6,
52
  verbosity_level=1,
53
  grammar=None,
 
58
  )
59
 
60
  # Launch the Gradio interface
61
+ GradioUI(agent).launch()