File size: 724 Bytes
4754c4d
0305bdf
4754c4d
 
 
 
 
0305bdf
 
 
 
 
 
 
 
4754c4d
0305bdf
 
 
4754c4d
 
0305bdf
4754c4d
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# agent.py

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,
    )