renwei2024 commited on
Commit
ac74b6c
·
verified ·
1 Parent(s): 50edfc3

Add the soccer news tool to the agent Alfred

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -4,7 +4,7 @@ import random
4
  from smolagents import DuckDuckGoSearchTool, GradioUI, CodeAgent, HfApiModel, LiteLLMModel
5
 
6
  # Import our custom tools from their modules
7
- from tools import WeatherInfoTool, HubStatsTool
8
  from retriever import load_guest_dataset
9
 
10
  # Initialize the Hugging Face model
@@ -25,9 +25,12 @@ hub_stats_tool = HubStatsTool()
25
  # Load the guest dataset and initialize the guest info tool
26
  guest_info_tool = load_guest_dataset()
27
 
 
 
 
28
  # Create Alfred with all the tools
29
  alfred = CodeAgent(
30
- tools=[guest_info_tool, weather_info_tool, hub_stats_tool, search_tool],
31
  model=model,
32
  add_base_tools=True, # Add any additional base tools
33
  planning_interval=3 # Enable planning every 3 steps
 
4
  from smolagents import DuckDuckGoSearchTool, GradioUI, CodeAgent, HfApiModel, LiteLLMModel
5
 
6
  # Import our custom tools from their modules
7
+ from tools import WeatherInfoTool, HubStatsTool, SoccerNewsTool
8
  from retriever import load_guest_dataset
9
 
10
  # Initialize the Hugging Face model
 
25
  # Load the guest dataset and initialize the guest info tool
26
  guest_info_tool = load_guest_dataset()
27
 
28
+ # Initialize the soccre news tool
29
+ soccer_news_tool = SoccerNewsTool()
30
+
31
  # Create Alfred with all the tools
32
  alfred = CodeAgent(
33
+ tools=[guest_info_tool, weather_info_tool, hub_stats_tool, soccer_news_tool, search_tool],
34
  model=model,
35
  add_base_tools=True, # Add any additional base tools
36
  planning_interval=3 # Enable planning every 3 steps