File size: 706 Bytes
10e9b7d
9825718
 
10e9b7d
9825718
 
e80aab9
9825718
 
4021bf3
9825718
 
3c4371f
9825718
 
3c4371f
9825718
 
 
 
 
 
 
e80aab9
 
9825718
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 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()

# 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()