Download app.py from Jeaninejuliette/First_agent_template: direct link, hf CLI and curl.
- Browser
- Download file 762 Bytes
-
https://huggingface.co/spaces/Jeaninejuliette/First_agent_template/resolve/fd18d939e335216347eaaaee1dc3ac51dd32971e/app.py
- Command line
-
hf download hf://spaces/Jeaninejuliette/First_agent_template@fd18d939e335216347eaaaee1dc3ac51dd32971e/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Jeaninejuliette/First_agent_template/resolve/fd18d939e335216347eaaaee1dc3ac51dd32971e/app.py
762 Bytes
| from smolagents import GradioUI, CodeAgent, HfApiModel | |
| from scripts.web_search import DuckDuckGoSearchTool | |
| from scripts.visit_webpage import VisitWebpageTool | |
| from scripts.final_answer import FinalAnswerTool | |
| model = HfApiModel() | |
| web_search = DuckDuckGoSearchTool() | |
| visit_webpage = VisitWebpageTool() | |
| final_answer = FinalAnswerTool() | |
| agent = CodeAgent( | |
| model=model, | |
| tools= [web_search, visit_webpage, final_answer], | |
| max_steps=6, | |
| verbosity_level=1, | |
| grammar=None, | |
| planning_interval=None, | |
| name=None, | |
| description=None, | |
| authorized_imports=['queue', 'stat', 'collections', 'unicodedata', 'itertools', 'math', 'pandas', 'random', 're', 'datetime', 'statistics', 'time'], | |
| prompts_path='./prompts.yaml' | |
| ) | |
| GradioUI(agent).launch() | |