Spaces:
Sleeping
Sleeping
File size: 895 Bytes
9917822 e0836a3 516b836 7301089 31045f2 9826282 9917822 e0836a3 de8a914 9917822 e0836a3 31045f2 e0836a3 31045f2 e0836a3 |
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 27 28 29 30 |
import gradio as gr
from retriever import load_guest_dataset
from smolagents import GradioUI, CodeAgent
from smolagents import LiteLLMModel # For Gemini
from tools import DuckDuckGoSearchTool, WeatherInfoTool, HubStatsTool
import os
# Initialize the Hugging Face model
model = LiteLLMModel(model_id="gemini/gemini-2.5-pro-preview-05-06", api_key=os.getenv(key="GEMINI_API_KEY"))
# Load the guest dataset and initialize the guest info tool
guest_info_tool = load_guest_dataset()
# Initialize the web search tool
search_tool = DuckDuckGoSearchTool()
# Initialize the weather tool
weather_info_tool = WeatherInfoTool()
# Initialize the Hub stats tool
hub_stats_tool = HubStatsTool()
# Create Alfred with all the tools
alfred = CodeAgent(
tools=[guest_info_tool, weather_info_tool, hub_stats_tool, search_tool],
model=model,
)
if __name__ == "__main__":
GradioUI(alfred).launch() |