Spaces:
Runtime error
Runtime error
Upload tool
Browse filesFiles changed (4)
- agent.json+6-6
- app.py+16-17
- requirements.txt+3-3
- tools/visit_webpage.py+1-1
34 unmodified lines353637383940404142434445464445474748494849505134 unmodified lines "name": null, "description": null, "authorized_imports": [ "unicodedata", "datetime", "queue", "stat", "itertools", "stat", "time", "pandas", "re", "random", "collections", "math", "statistics", "unicodedata", "re", "time" "collections", "math" ]}1234167892311456789101112131415131415161718192016171819202122from smolagents import GradioUI, CodeAgent, HfApiModelfrom scripts.web_search import DuckDuckGoSearchToolfrom scripts.visit_webpage import VisitWebpageToolfrom scripts.final_answer import FinalAnswerTool
model = HfApiModel()web_search = DuckDuckGoSearchTool()visit_webpage = VisitWebpageTool()final_answer = FinalAnswerTool()from smolagents import GradioUI, {{ class_name }}, {{ agent_dict['model']['class'] }}
agent = CodeAgent({% for tool in tools.values() %}from scripts.{{ tool.name }} import {{ tool.__class__.__name__ }}{% endfor %}
model = {{ agent_dict['model']['class'] }}()
{% for tool in tools.values() %}{{ tool.name }} = {{ tool.__class__.__name__ }}(){% endfor %}
agent = {{ class_name }}( 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=['datetime', 'queue', 'stat', 'itertools', 'pandas', 'random', 'collections', 'math', 'statistics', 'unicodedata', 're', 'time'], tools=[{% for tool in tools.keys() %}{{ tool }}{% if not loop.last %}, {% endif %}{% endfor %}], {% for attribute_name, value in agent_dict.items() if attribute_name not in ["model", "tools", "prompt_templates"] %} {{ attribute_name }}={{ value }}, {% endfor %} prompts_path='./prompts.yaml')
11342345smolagentsrequestsduckduckgo_searchpandasmarkdownifypandassmolagentsduckduckgo_search123445678from typing import Any, Optionalfrom smolagents.tools import Toolimport markdownifyimport smolagentsimport requestsimport smolagents
class VisitWebpageTool(Tool): name = "visit_webpage"agent.json+6-6
app.py+16-17
requirements.txt+3-3
tools/visit_webpage.py+1-1