Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,10 +19,8 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 19 |
|
| 20 |
class CurrentTimeTool(Tool):
|
| 21 |
def __init__(self):
|
| 22 |
-
super().__init__(
|
| 23 |
-
|
| 24 |
-
description="Fetches the current local time in a specified timezone."
|
| 25 |
-
)
|
| 26 |
|
| 27 |
def __call__(self, timezone: str) -> str:
|
| 28 |
try:
|
|
@@ -35,11 +33,9 @@ class CurrentTimeTool(Tool):
|
|
| 35 |
|
| 36 |
class WikipediaTool(Tool):
|
| 37 |
def __init__(self):
|
| 38 |
-
super().__init__(
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
)
|
| 42 |
-
|
| 43 |
def __call__(self, query: str, sentences: int = 2) -> str:
|
| 44 |
try:
|
| 45 |
return wikipedia.summary(query, sentences=sentences)
|
|
|
|
| 19 |
|
| 20 |
class CurrentTimeTool(Tool):
|
| 21 |
def __init__(self):
|
| 22 |
+
super().__init__()
|
| 23 |
+
self.description = "Fetches the current local time in a specified timezone. Input should be a timezone string like 'America/New_York'."
|
|
|
|
|
|
|
| 24 |
|
| 25 |
def __call__(self, timezone: str) -> str:
|
| 26 |
try:
|
|
|
|
| 33 |
|
| 34 |
class WikipediaTool(Tool):
|
| 35 |
def __init__(self):
|
| 36 |
+
super().__init__()
|
| 37 |
+
self.description = "Searches Wikipedia for information. Input should be a search query. Optional parameter 'sentences' (default 2) controls summary length."
|
| 38 |
+
|
|
|
|
|
|
|
| 39 |
def __call__(self, query: str, sentences: int = 2) -> str:
|
| 40 |
try:
|
| 41 |
return wikipedia.summary(query, sentences=sentences)
|