Get API key automatically from Space environment
Browse files
app.py
CHANGED
|
@@ -18,6 +18,9 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 18 |
class BasicAgent:
|
| 19 |
def __init__(self):
|
| 20 |
print("BasicAgent initialized.")
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# Create the search tool
|
| 23 |
self.search_tool = DuckDuckGoSearchTool()
|
|
|
|
| 18 |
class BasicAgent:
|
| 19 |
def __init__(self):
|
| 20 |
print("BasicAgent initialized.")
|
| 21 |
+
|
| 22 |
+
# Get API key automatically from Space environment
|
| 23 |
+
api_key = os.getenv("HF_API_KEY")
|
| 24 |
|
| 25 |
# Create the search tool
|
| 26 |
self.search_tool = DuckDuckGoSearchTool()
|