andersoncliffb commited on
Commit
282d66a
·
verified ·
1 Parent(s): c8cc7db

Change case names to match function string

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 substraction
14
  Args:
15
  arg1: the first argument
16
  arg2: the second argument
17
  op: the operation
18
  """
19
  match op:
20
- case "*" | "multiply":
21
  return arg1 * arg2
22
- case "/" | "divide":
23
  return arg1 / arg2
24
- case "+" | "add":
25
  return arg1 + arg2
26
- case "-" | "subtract":
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