smiquensi commited on
Commit
0305bdf
·
verified ·
1 Parent(s): 4754c4d
Files changed (1) hide show
  1. agent.py +13 -7
agent.py CHANGED
@@ -1,19 +1,25 @@
1
  # agent.py
 
2
  from smolagents import CodeAgent
3
  from smolagents.models import InferenceClientModel
4
  from smolagents.tools import DuckDuckGoSearchTool, RequestsTool, PythonREPLTool
5
 
6
  def make_agent():
7
- # Modelo instructivo mediano
8
- llm = InferenceClientModel(model_id="google/flan-t5-large")
 
 
 
 
 
 
9
  tools = [
10
- DuckDuckGoSearchTool(), # Búsqueda web
11
- RequestsTool(), # Descargar ficheros (imágenes, Excel, etc)
12
- PythonREPLTool(), # Procesar datos, cálculos, tablas...
13
  ]
14
- # add_base_tools=True para JSON, archivos, etc.
15
  return CodeAgent(
16
- model=llm,
17
  tools=tools,
18
  add_base_tools=True,
19
  max_steps=8,
 
1
  # agent.py
2
+
3
  from smolagents import CodeAgent
4
  from smolagents.models import InferenceClientModel
5
  from smolagents.tools import DuckDuckGoSearchTool, RequestsTool, PythonREPLTool
6
 
7
  def make_agent():
8
+ """
9
+ Crea un CodeAgent con:
10
+ - Búsqueda web (DuckDuckGo)
11
+ - Requests para descargar attachments (imágenes, Excel…)
12
+ - Python REPL para procesar datos/tablas
13
+ - Herramientas base (filesystem, JSON, etc.)
14
+ """
15
+ model = InferenceClientModel(model_id="google/flan-t5-large")
16
  tools = [
17
+ DuckDuckGoSearchTool(),
18
+ RequestsTool(),
19
+ PythonREPLTool(),
20
  ]
 
21
  return CodeAgent(
22
+ model=model,
23
  tools=tools,
24
  add_base_tools=True,
25
  max_steps=8,