Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
@tool
|
37 |
-
def calculator(num_1: float, num_2: float, sign: str) ->
|
38 |
""" A tool tha receives two numbers and a sign and execute the sign operation over that two numbers.
|
39 |
Args:
|
40 |
num_1: first number to be computed
|
@@ -42,14 +42,14 @@ def calculator(num_1: float, num_2: float, sign: str) -> float|str:
|
|
42 |
sign: the operation sign
|
43 |
"""
|
44 |
if sign == '+':
|
45 |
-
return num_1+num_2
|
46 |
elif sign == '-':
|
47 |
-
return num_1-num_2
|
48 |
elif sign == '*':
|
49 |
-
return num_1*num_2
|
50 |
elif sign == '/':
|
51 |
if num_2 != 0:
|
52 |
-
return num_1/num_2
|
53 |
else:
|
54 |
return "You can't make a division by 0!"
|
55 |
else:
|
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
@tool
|
37 |
+
def calculator(num_1: float, num_2: float, sign: str) -> str:
|
38 |
""" A tool tha receives two numbers and a sign and execute the sign operation over that two numbers.
|
39 |
Args:
|
40 |
num_1: first number to be computed
|
|
|
42 |
sign: the operation sign
|
43 |
"""
|
44 |
if sign == '+':
|
45 |
+
return f"The answer is {num_1+num_2}"
|
46 |
elif sign == '-':
|
47 |
+
return f"The answer is {num_1-num_2}"
|
48 |
elif sign == '*':
|
49 |
+
return f"The answer is {num_1*num_2}"
|
50 |
elif sign == '/':
|
51 |
if num_2 != 0:
|
52 |
+
return f"The answer is {num_1/num_2}"
|
53 |
else:
|
54 |
return "You can't make a division by 0!"
|
55 |
else:
|