Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,8 +13,9 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 13 |
class CalculatorTool(Tool):
|
| 14 |
name = "calculator"
|
| 15 |
description = "Performs mathematical calculations"
|
| 16 |
-
inputs = {"expression": {"type": "text"}}
|
| 17 |
-
outputs = {"result": {"type": "text"}}
|
|
|
|
| 18 |
|
| 19 |
def __call__(self, expression: str) -> str:
|
| 20 |
try:
|
|
@@ -25,8 +26,9 @@ class CalculatorTool(Tool):
|
|
| 25 |
class TimeTool(Tool):
|
| 26 |
name = "current_time"
|
| 27 |
description = "Gets current UTC time"
|
| 28 |
-
inputs = {}
|
| 29 |
-
outputs = {"time": {"type": "text"}}
|
|
|
|
| 30 |
|
| 31 |
def __call__(self) -> str:
|
| 32 |
return datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
|
|
|
|
| 13 |
class CalculatorTool(Tool):
|
| 14 |
name = "calculator"
|
| 15 |
description = "Performs mathematical calculations"
|
| 16 |
+
inputs = {"expression": {"type": "text"}}
|
| 17 |
+
outputs = {"result": {"type": "text"}}
|
| 18 |
+
output_type = "text" # Added required attribute
|
| 19 |
|
| 20 |
def __call__(self, expression: str) -> str:
|
| 21 |
try:
|
|
|
|
| 26 |
class TimeTool(Tool):
|
| 27 |
name = "current_time"
|
| 28 |
description = "Gets current UTC time"
|
| 29 |
+
inputs = {}
|
| 30 |
+
outputs = {"time": {"type": "text"}}
|
| 31 |
+
output_type = "text" # Added required attribute
|
| 32 |
|
| 33 |
def __call__(self) -> str:
|
| 34 |
return datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
|