Spaces:
Sleeping
Sleeping
replace codeagent with ToolCallingAgent
Browse files
app.py
CHANGED
|
@@ -10,10 +10,10 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 10 |
|
| 11 |
# --- Basic Agent Definition ---
|
| 12 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 13 |
-
from smolagents import
|
| 14 |
class BasicAgent:
|
| 15 |
def __init__(self):
|
| 16 |
-
self.agent =
|
| 17 |
print("BasicAgent initialized.")
|
| 18 |
def __call__(self, question: str) -> str:
|
| 19 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
|
|
|
| 10 |
|
| 11 |
# --- Basic Agent Definition ---
|
| 12 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 13 |
+
from smolagents import ToolCallingAgent, DuckDuckGoSearchTool, HfApiModel
|
| 14 |
class BasicAgent:
|
| 15 |
def __init__(self):
|
| 16 |
+
self.agent = ToolCallingAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel())
|
| 17 |
print("BasicAgent initialized.")
|
| 18 |
def __call__(self, question: str) -> str:
|
| 19 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|