Spaces:
Sleeping
Sleeping
| 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() |