Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import requests
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
|
7 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, tool
|
8 |
|
9 |
# (Keep Constants as is)
|
10 |
# --- Constants ---
|
@@ -14,7 +14,14 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
14 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
15 |
class BasicAgent:
|
16 |
def __init__(self):
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
print("BasicAgent initialized.")
|
20 |
|
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
|
7 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, tool, OpenAIServerModel
|
8 |
|
9 |
# (Keep Constants as is)
|
10 |
# --- Constants ---
|
|
|
14 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
15 |
class BasicAgent:
|
16 |
def __init__(self):
|
17 |
+
model = OpenAIServerModel(model_id="gpt-4o")
|
18 |
+
|
19 |
+
self.agent = CodeAgent(
|
20 |
+
tools=[DuckDuckGoSearchTool()],
|
21 |
+
model=model,
|
22 |
+
max_steps=10,
|
23 |
+
verbosity_level=2
|
24 |
+
)
|
25 |
|
26 |
print("BasicAgent initialized.")
|
27 |
|