from smolagents import ( HfApiModel, CodeAgent, load_tool, Tool, InferenceClientModel, ToolCallingAgent, FinalAnswerTool, DuckDuckGoSearchTool, VisitWebpageTool, GoogleSearchTool, PythonInterpreterTool, ) import os from huggingface_hub import login from dotenv import load_dotenv from sample_questions import QUESTIONS # from tools.visit_website import VisitWebpageTool load_dotenv() login(os.environ["HF_API_KEY"]) # Tools # wikipedia = Tool.from_langchain(load_tool("wikipedia", trust_remote_code=True)) tools = [ DuckDuckGoSearchTool(), VisitWebpageTool(), PythonInterpreterTool(), FinalAnswerTool(), # wikipedia ] question = QUESTIONS[0] # LLM Model model = HfApiModel( "Qwen/Qwen2.5-72B-Instruct", provider="together", # max_tokens=40096, temperature=0.1, # token=get_huggingface_token(), ) # Code Agent codeAgent = CodeAgent( model=model, tools=tools, max_steps=10, additional_authorized_imports=["pandas", "numpy"], verbosity_level=2, ) codeAgent.logger.console.width = 66 # answer = codeAgent.run( # "Who are the pitchers with the number before and after Taishō Tamai's number as of July 2023? Give them to me in the form Pitcher Before, Pitcher After, use their last names only, in Roman characters." # ) # answer = codeAgent.run("search wikipedia for: what the name of the main character of the fast and furious movie") # print(answer)