blade57's picture
Update app.py
bd660e4 verified
raw
history blame contribute delete
684 Bytes
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()