gokceKy commited on
Commit
aa2a817
·
verified ·
1 Parent(s): 73df126

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -20
app.py CHANGED
@@ -9,33 +9,18 @@ from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
- def calculator(arg1: int, arg2: str, arg3: int) -> int:
13
  """
14
- Performs basic arithmetic operations (addition, subtraction, multiplication, and division).
15
 
16
  Args:
17
  arg1 (int): The first operand.
18
- arg2 (str): The operator ('+', '-', '*', '/').
19
- arg3 (int): The second operand.
20
 
21
  Returns:
22
- int: The result of the calculation.
23
-
24
- Raises:
25
- ValueError: If an invalid operator is provided.
26
  """
27
- if arg2 == "+":
28
- return arg1 + arg3
29
- elif arg2 == "-":
30
- return arg1 - arg3
31
- elif arg2 == "*":
32
- return arg1 * arg3
33
- elif arg2 == "/":
34
- if arg3 == 0:
35
- raise ValueError("Division by zero is not allowed.")
36
- return arg1 / arg3
37
- else:
38
- raise ValueError("Invalid operator! Only '+', '-', '*', and '/' are allowed.")
39
 
40
 
41
 
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
+ def calculator(arg1: int, arg2: int) -> int:
13
  """
14
+ Performs addition of two numbers.
15
 
16
  Args:
17
  arg1 (int): The first operand.
18
+ arg2 (int): The second operand.
 
19
 
20
  Returns:
21
+ int: The sum of the two numbers.
 
 
 
22
  """
23
+ return arg1 + arg2
 
 
 
 
 
 
 
 
 
 
 
24
 
25
 
26