Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,17 +16,18 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 16 |
# --- Basic Agent Definition ---
|
| 17 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 18 |
class BasicAgent:
|
| 19 |
-
def __init__(self):
|
| 20 |
print("BasicAgent initialized.")
|
| 21 |
# Initialize a small local model instead of API model
|
| 22 |
self.model = HfApiModel("text-generation", model="mistralai/Mistral-7B-v0.1")
|
| 23 |
-
|
| 24 |
# Initialize the search tool (you can keep DuckDuckGoSearchTool)
|
| 25 |
search_tool = DuckDuckGoSearchTool()
|
| 26 |
|
| 27 |
# Initialize Agent
|
| 28 |
self.agent = CodeAgent(
|
| 29 |
model=self.model,
|
|
|
|
| 30 |
tools=[search_tool]
|
| 31 |
)
|
| 32 |
|
|
|
|
| 16 |
# --- Basic Agent Definition ---
|
| 17 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 18 |
class BasicAgent:
|
| 19 |
+
def __init__(self, HF_API_KEY):
|
| 20 |
print("BasicAgent initialized.")
|
| 21 |
# Initialize a small local model instead of API model
|
| 22 |
self.model = HfApiModel("text-generation", model="mistralai/Mistral-7B-v0.1")
|
| 23 |
+
self.HF_API_KEY = HF_API_KEY
|
| 24 |
# Initialize the search tool (you can keep DuckDuckGoSearchTool)
|
| 25 |
search_tool = DuckDuckGoSearchTool()
|
| 26 |
|
| 27 |
# Initialize Agent
|
| 28 |
self.agent = CodeAgent(
|
| 29 |
model=self.model,
|
| 30 |
+
api_key = self.HF_API_KEY
|
| 31 |
tools=[search_tool]
|
| 32 |
)
|
| 33 |
|