Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, tool, VisitWebpageTool, Tool, FinalAnswerTool, WebSearchTool
|
| 2 |
+
import numpy as np
|
| 3 |
+
import time
|
| 4 |
+
import datetime
|
| 5 |
+
|
| 6 |
+
#Creating multyagent structure
|
| 7 |
+
web_agent = CodeAgent(
|
| 8 |
+
tools=[
|
| 9 |
+
DuckDuckGoSearchTool(),
|
| 10 |
+
VisitWebpageTool(),
|
| 11 |
+
FinalAnswerTool()
|
| 12 |
+
],
|
| 13 |
+
model=InferenceClientModel(),
|
| 14 |
+
name="web_agent",
|
| 15 |
+
description="Brows the web to find information",
|
| 16 |
+
max_steps=10,
|
| 17 |
+
verbosity_level=0,
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
manager_agent = CodeAgent(
|
| 21 |
+
model=InferenceClientModel("deepseek-ai/DeepSeek-R1", provider="together", max_tokens=8096),
|
| 22 |
+
managed_agent=[web_agent],
|
| 23 |
+
additional_authorized_imports=[
|
| 24 |
+
"datetime",
|
| 25 |
+
"pandas",
|
| 26 |
+
"numpy",
|
| 27 |
+
"json"
|
| 28 |
+
],
|
| 29 |
+
planning_intervals=5,
|
| 30 |
+
verbosity_level=2,
|
| 31 |
+
max_steps=15,
|
| 32 |
+
)
|
| 33 |
+
|