Update app.py
Browse files
app.py
CHANGED
|
@@ -13,6 +13,15 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 13 |
|
| 14 |
# --- Basic Agent Definition ---
|
| 15 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
class BasicAgent:
|
| 17 |
def __init__(self, api_key: str = None):
|
| 18 |
if not api_key:
|
|
|
|
| 13 |
|
| 14 |
# --- Basic Agent Definition ---
|
| 15 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 16 |
+
|
| 17 |
+
try:
|
| 18 |
+
import ddgs
|
| 19 |
+
except ImportError:
|
| 20 |
+
from duckduckgo_search import DDGS
|
| 21 |
+
import sys, types
|
| 22 |
+
ddgs = types.SimpleNamespace(DDGS=DDGS)
|
| 23 |
+
sys.modules["ddgs"] = ddgs
|
| 24 |
+
|
| 25 |
class BasicAgent:
|
| 26 |
def __init__(self, api_key: str = None):
|
| 27 |
if not api_key:
|