sadff
Browse files
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 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
tools = [
|
| 10 |
-
DuckDuckGoSearchTool(),
|
| 11 |
-
RequestsTool(),
|
| 12 |
-
PythonREPLTool(),
|
| 13 |
]
|
| 14 |
-
# add_base_tools=True para JSON, archivos, etc.
|
| 15 |
return CodeAgent(
|
| 16 |
-
model=
|
| 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,
|