Spaces:
Sleeping
Sleeping
Upload tool
Browse filesFiles changed (4)
- agent.json+7-7
- app.py+34-14
- requirements.txt+3-3
- tools/visit_webpage.py+2-2
34 unmodified lines35363738394038423940414243464744454649474849505134 unmodified lines "name": null, "description": null, "authorized_imports": [ "time", "datetime", "pandas", "collections", "unicodedata", "itertools", "statistics", "stat", "random", "math", "itertools", "statistics", "pandas", "datetime", "queue", "re" "re", "unicodedata", "time" ]}1223456485610111278149101112131415161718192021222316171819242526272829303132333435363738394041422343
from smolagents import GradioUI, {{ class_name }}, {{ agent_dict['model']['class'] }}from smolagents import GradioUI, CodeAgent, HfApiModel
{% for tool in tools.values() %}from scripts.{{ tool.name }} import {{ tool.__class__.__name__ }}{% endfor %}
model = {{ agent_dict['model']['class'] }}()from scripts.web_search import DuckDuckGoSearchTool
{% for tool in tools.values() %}{{ tool.name }} = {{ tool.__class__.__name__ }}(){% endfor %}from scripts.visit_webpage import VisitWebpageTool
agent = {{ class_name }}(from scripts.final_answer import FinalAnswerTool
model = HfApiModel()
web_search = DuckDuckGoSearchTool()
visit_webpage = VisitWebpageTool()
final_answer = FinalAnswerTool()
agent = CodeAgent( model=model, 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 %} tools=[web_search, visit_webpage, final_answer], max_steps=6, verbosity_level=1, grammar=None, planning_interval=None, name=None, description=None, authorized_imports=['collections', 'itertools', 'statistics', 'stat', 'random', 'math', 'pandas', 'datetime', 'queue', 're', 'unicodedata', 'time'], prompts_path='./prompts.yaml')
GradioUI(agent).launch()GradioUI(agent).launch()12142345smolagentsduckduckgo_searchmarkdownifypandasrequestspandasduckduckgo_searchsmolagents1234345678from typing import Any, Optionalfrom smolagents.tools import Toolimport smolagentsimport requestsimport markdownifyimport requestsimport smolagents
class VisitWebpageTool(Tool): name = "visit_webpage"agent.json+7-7
app.py+34-14
requirements.txt+3-3
tools/visit_webpage.py+2-2