import yaml import os from smolagents import GradioUI, CodeAgent, HfApiModel # Get current directory path CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) from tools.search_hf_ressources import SearchHfRessourcesTool from tools.generate_learning_path import GenerateLearningPathTool from tools.final_answer import FinalAnswerTool model = HfApiModel( model_id='Qwen/Qwen2.5-Coder-32B-Instruct', provider=None, ) search_hf_ressources = SearchHfRessourcesTool() generate_learning_path = GenerateLearningPathTool() final_answer = FinalAnswerTool() with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream: prompt_templates = yaml.safe_load(stream) agent = CodeAgent( model=model, tools=[search_hf_ressources, generate_learning_path, final_answer], managed_agents=[], max_steps=10, verbosity_level=2, grammar=None, planning_interval=None, name="Guido", description=None, prompt_templates=prompt_templates ) if __name__ == "__main__": GradioUI(agent).launch()