Spaces:
No application file
No application file
import gradio as gr | |
import random | |
from smolagents import GradioUI, CodeAgent, HfApiModel | |
# Import our custom tools from their modules | |
from tools import DuckDuckGoSearchTool, CurrencyConverterTool | |
# Initialize the Hugging Face model | |
model = HfApiModel() | |
# Initialize the web search tool | |
search_tool = DuckDuckGoSearchTool() | |
# Initialize the weather tool | |
currency_converter_tool = CurrencyConverterTool() | |
# Load the guest dataset and initialize the guest info tool | |
guest_info_tool = load_guest_dataset() | |
# Create Alfred with all the tools | |
alfred = CodeAgent( | |
tools=[currency_converter_tool, search_tool], | |
model=model, | |
add_base_tools=True, # Add any additional base tools | |
planning_interval=3 # Enable planning every 3 steps | |
) | |
if __name__ == "__main__": | |
GradioUI(alfred).launch() |