Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,14 @@ class BasicAgent:
|
|
| 15 |
def __init__(self):
|
| 16 |
print("BasicAgent initialized.")
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
def __call__(self, question: str) -> str:
|
| 21 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
|
|
|
| 15 |
def __init__(self):
|
| 16 |
print("BasicAgent initialized.")
|
| 17 |
|
| 18 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 19 |
+
if not hf_token:
|
| 20 |
+
raise ValueError("HF_TOKEN environment variable is not set.")
|
| 21 |
+
|
| 22 |
+
self.agent = CodeAgent(
|
| 23 |
+
tools=[DuckDuckGoSearchTool()],
|
| 24 |
+
model=HfApiModel(token=hf_token, model="microsoft/phi-2")
|
| 25 |
+
)
|
| 26 |
|
| 27 |
def __call__(self, question: str) -> str:
|
| 28 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|