|
|
|
|
|
from smolagents import CodeAgent |
|
from smolagents.models import InferenceClientModel |
|
from smolagents.tools import DuckDuckGoSearchTool, RequestsTool, PythonREPLTool |
|
|
|
def make_agent(): |
|
""" |
|
Crea un CodeAgent con: |
|
- Búsqueda web (DuckDuckGo) |
|
- Requests para descargar attachments (imágenes, Excel…) |
|
- Python REPL para procesar datos/tablas |
|
- Herramientas base (filesystem, JSON, etc.) |
|
""" |
|
model = InferenceClientModel(model_id="google/flan-t5-large") |
|
tools = [ |
|
DuckDuckGoSearchTool(), |
|
RequestsTool(), |
|
PythonREPLTool(), |
|
] |
|
return CodeAgent( |
|
model=model, |
|
tools=tools, |
|
add_base_tools=True, |
|
max_steps=8, |
|
) |