Spaces:
Running
Running
Update app.py
Browse filesextract computation
app.py
CHANGED
@@ -18,16 +18,20 @@ def my_custom_tool(arg1:int, arg2:int, arg3:str)-> str: #it's import to specify
|
|
18 |
"""
|
19 |
match arg3:
|
20 |
case "*":
|
21 |
-
|
|
|
22 |
case "/":
|
23 |
if(arg2!=0):
|
24 |
-
|
|
|
25 |
else:
|
26 |
return f"Error: Division by zero not possible"
|
27 |
case "+":
|
28 |
-
|
|
|
29 |
case "-":
|
30 |
-
|
|
|
31 |
case _:
|
32 |
return f"Error: '{arg3}' is an unsupported operation, Supported operations are +,-,*,/"
|
33 |
|
|
|
18 |
"""
|
19 |
match arg3:
|
20 |
case "*":
|
21 |
+
result = arg1 * arg2
|
22 |
+
return f"The result is: '{result}'"
|
23 |
case "/":
|
24 |
if(arg2!=0):
|
25 |
+
result = arg1 / arg2
|
26 |
+
return f"The result is: '{result}'"
|
27 |
else:
|
28 |
return f"Error: Division by zero not possible"
|
29 |
case "+":
|
30 |
+
result = arg1 + arg2
|
31 |
+
return f"The result is: '{result}'"
|
32 |
case "-":
|
33 |
+
result = arg1 - arg2
|
34 |
+
return f"The result is: '{result}'"
|
35 |
case _:
|
36 |
return f"Error: '{arg3}' is an unsupported operation, Supported operations are +,-,*,/"
|
37 |
|