File size: 684 Bytes
a8491fd
06c2786
 
a8491fd
06c2786
 
 
a8491fd
06c2786
 
 
bd660e4
 
06c2786
 
 
 
bd660e4
06c2786
 
 
 
 
 
bd660e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import gradio as gr
import random
from smolagents import GradioUI, CodeAgent, HfApiModel

# import tools created from their py files
from retriever import load_guest_dataset
from tools import DuckDuckGoSearchTool, WeatherInfoTool, HubStatsTool

# initialize required objects
model = HfApiModel()
search_tool = DuckDuckGoSearchTool()
weather_info_tool = WeatherInfoTool()
hub_stats_tool = HubStatsTool()
guest_info_tool = load_guest_dataset()  

# create agent
alfred_agent = CodeAgent(
    tools=[search_tool, weather_info_tool, hub_stats_tool],
    model=model,
    add_base_tools=True,
    planning_interval=3   # ?
)

if __name__ == "__main__":
    GradioUI(alfred_agent).launch()