wlchee commited on
Commit
3aa2c24
·
verified ·
1 Parent(s): 2cdc0e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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"}} # Changed to dict
17
- outputs = {"result": {"type": "text"}} # Changed to dict
 
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 = {} # Empty dict for no inputs
29
- outputs = {"time": {"type": "text"}} # Changed to dict
 
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")