johnkirkwood commited on
Commit
a588d52
·
verified ·
1 Parent(s): f15befe

Update app.py

Browse files

replace function with addition function

Files changed (1) hide show
  1. app.py +9 -15
app.py CHANGED
@@ -8,27 +8,21 @@ from tools.final_answer import FinalAnswerTool
8
  from Gradio_UI import GradioUI
9
 
10
  @tool
11
- def count_string_occurrences(main_string: str, sub_string:str) -> int:
12
  """
13
- Returns the number of times sub_string occurs in main_string.
14
 
15
  Args:
16
- main_string: The main string to search in.
17
- sub_string: The substring to search for.
18
 
19
  Returns:
20
- int: The number of occurrences of sub_string in main_string.
21
  """
22
- count = 0
23
- start = 0
24
- while start < len(main_string):
25
- pos = main_string.find(sub_string, start)
26
- if pos!= -1:
27
- count += 1
28
- start = pos + 1
29
- else:
30
- break
31
- return count
32
 
33
  @tool
34
  def get_current_time_in_timezone(timezone: str) -> str:
 
8
  from Gradio_UI import GradioUI
9
 
10
  @tool
11
+ def addition(first_number: int, second_number: int) -> int:
12
  """
13
+ Returns the sum of two numbers.
14
 
15
  Args:
16
+ first_number: The first number that is used for addition.
17
+ second_number: The second number that is used for addition.
18
 
19
  Returns:
20
+ int: The sum of the two numbers provided.
21
  """
22
+
23
+ result_sum = first_number + second_number;
24
+
25
+ return result_sum;
 
 
 
 
 
 
26
 
27
  @tool
28
  def get_current_time_in_timezone(timezone: str) -> str: