Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import os
|
| 2 |
-
from smolagents import CodeAgent,
|
| 3 |
|
| 4 |
# Define a safety math helper because raw string math can confuse LLMs
|
| 5 |
@tool
|
|
@@ -21,12 +21,11 @@ class CourseEvaluationAgent:
|
|
| 21 |
def __init__(self):
|
| 22 |
print("[Agent System] Booting Engine...")
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
# It automatically
|
| 26 |
-
self.model =
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
# Using correct 'model=' parameter rather than legacy 'engine='
|
| 30 |
self.agent = CodeAgent(
|
| 31 |
tools=[DuckDuckGoSearchTool(), calculate_math],
|
| 32 |
model=self.model,
|
|
|
|
| 1 |
import os
|
| 2 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, tool, ApiModel
|
| 3 |
|
| 4 |
# Define a safety math helper because raw string math can confuse LLMs
|
| 5 |
@tool
|
|
|
|
| 21 |
def __init__(self):
|
| 22 |
print("[Agent System] Booting Engine...")
|
| 23 |
|
| 24 |
+
# FIX: Swapped out HfApiModel for ApiModel to match your current package version.
|
| 25 |
+
# It automatically detects your HF_TOKEN secret behind the scenes.
|
| 26 |
+
self.model = ApiModel(model_id="meta-llama/Llama-3.3-70B-Instruct")
|
| 27 |
|
| 28 |
+
# Build the functional CodeAgent
|
|
|
|
| 29 |
self.agent = CodeAgent(
|
| 30 |
tools=[DuckDuckGoSearchTool(), calculate_math],
|
| 31 |
model=self.model,
|