Spaces:
Sleeping
Sleeping
Change case names to match function string
Browse files
app.py
CHANGED
|
@@ -10,20 +10,20 @@ from Gradio_UI import GradioUI
|
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
def my_calculator(arg1:int, arg2:int, op:str)-> int: #it's import to specify the return type
|
| 13 |
-
"""A tool that performs multiplication, division, addition, and
|
| 14 |
Args:
|
| 15 |
arg1: the first argument
|
| 16 |
arg2: the second argument
|
| 17 |
op: the operation
|
| 18 |
"""
|
| 19 |
match op:
|
| 20 |
-
case "*" | "
|
| 21 |
return arg1 * arg2
|
| 22 |
-
case "/" | "
|
| 23 |
return arg1 / arg2
|
| 24 |
-
case "+" | "
|
| 25 |
return arg1 + arg2
|
| 26 |
-
case "-" | "
|
| 27 |
return arg1 - arg2
|
| 28 |
case _:
|
| 29 |
return 0
|
|
|
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
def my_calculator(arg1:int, arg2:int, op:str)-> int: #it's import to specify the return type
|
| 13 |
+
"""A tool that performs multiplication, division, addition, and subtraction
|
| 14 |
Args:
|
| 15 |
arg1: the first argument
|
| 16 |
arg2: the second argument
|
| 17 |
op: the operation
|
| 18 |
"""
|
| 19 |
match op:
|
| 20 |
+
case "*" | "multiplication":
|
| 21 |
return arg1 * arg2
|
| 22 |
+
case "/" | "division":
|
| 23 |
return arg1 / arg2
|
| 24 |
+
case "+" | "addition":
|
| 25 |
return arg1 + arg2
|
| 26 |
+
case "-" | "subtraction":
|
| 27 |
return arg1 - arg2
|
| 28 |
case _:
|
| 29 |
return 0
|