Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
import os
|
| 2 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, GradioUI, InferenceClientModel
|
| 3 |
|
| 4 |
-
# 1. THE BRAIN
|
|
|
|
| 5 |
model = InferenceClientModel(
|
| 6 |
model_id="deepseek-ai/DeepSeek-R1",
|
| 7 |
token=os.getenv("HF_TOKEN")
|
|
@@ -12,22 +13,22 @@ researcher = CodeAgent(
|
|
| 12 |
tools=[DuckDuckGoSearchTool()],
|
| 13 |
model=model,
|
| 14 |
name="research_specialist",
|
| 15 |
-
description="
|
| 16 |
)
|
| 17 |
|
| 18 |
# 3. THE BOSS (Manager)
|
| 19 |
-
#
|
| 20 |
-
#
|
| 21 |
manager = CodeAgent(
|
| 22 |
tools=[],
|
| 23 |
model=model,
|
| 24 |
managed_agents=[researcher],
|
| 25 |
add_base_tools=True,
|
| 26 |
-
|
| 27 |
-
1.
|
| 28 |
-
2. Use your internal Python tools for
|
| 29 |
-
3.
|
| 30 |
-
4.
|
| 31 |
)
|
| 32 |
|
| 33 |
if __name__ == "__main__":
|
|
|
|
| 1 |
import os
|
| 2 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, GradioUI, InferenceClientModel
|
| 3 |
|
| 4 |
+
# 1. INITIALIZE THE BRAIN
|
| 5 |
+
# InferenceClientModel is the 2026 standard for HF API access.
|
| 6 |
model = InferenceClientModel(
|
| 7 |
model_id="deepseek-ai/DeepSeek-R1",
|
| 8 |
token=os.getenv("HF_TOKEN")
|
|
|
|
| 13 |
tools=[DuckDuckGoSearchTool()],
|
| 14 |
model=model,
|
| 15 |
name="research_specialist",
|
| 16 |
+
description="Expert at web search and data retrieval."
|
| 17 |
)
|
| 18 |
|
| 19 |
# 3. THE BOSS (Manager)
|
| 20 |
+
# We use 'instructions' to pass your PhD-level logic.
|
| 21 |
+
# We use 'managed_agents' to give the Boss control over the Specialist.
|
| 22 |
manager = CodeAgent(
|
| 23 |
tools=[],
|
| 24 |
model=model,
|
| 25 |
managed_agents=[researcher],
|
| 26 |
add_base_tools=True,
|
| 27 |
+
instructions="""You are the BOSS OPERATOR (Elite PhD Level).
|
| 28 |
+
1. Delegate sub-tasks to 'research_specialist' for any web-based data.
|
| 29 |
+
2. Use your internal Python tools for calculation, logic, and data processing.
|
| 30 |
+
3. Use LaTeX for all mathematical formulas ($E=mc^2$).
|
| 31 |
+
4. Provide clear, data-backed conclusions in Markdown tables."""
|
| 32 |
)
|
| 33 |
|
| 34 |
if __name__ == "__main__":
|