Sneaksie commited on
Commit
17fd0de
·
verified ·
1 Parent(s): 0af384d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -12,17 +12,17 @@ from Gradio_UI import GradioUI
12
  @tool
13
  def string_counter(substring:str, bigstring:str)-> str: #it's import to specify the return type
14
  #Keep this format for the description / args / args description but feel free to modify the tool
15
- """A tool that counts a number of characters or strings in a larger string
16
  Args:
17
- substring: a single character or a string of characters
18
- bigstring: a larger string inside the first parameter is found
19
  """
20
  try:
21
  # Count how many times substring is found in bigstring
22
  count = len(re.findall(substring, bigstring))
23
  return f"{substring} is found {count} times in the string {bigstring}"
24
  except Exception as e:
25
- return f"Error, perhaps the input is wrong and not a character or sring"
26
 
27
 
28
  @tool
 
12
  @tool
13
  def string_counter(substring:str, bigstring:str)-> str: #it's import to specify the return type
14
  #Keep this format for the description / args / args description but feel free to modify the tool
15
+ """A tool that counts how many time a character or string is found in a larger string, the input is case-sensitive
16
  Args:
17
+ substring: a single character or a string of characters, case-sensitive
18
+ bigstring: a larger string where the search is done, case-sensitive
19
  """
20
  try:
21
  # Count how many times substring is found in bigstring
22
  count = len(re.findall(substring, bigstring))
23
  return f"{substring} is found {count} times in the string {bigstring}"
24
  except Exception as e:
25
+ return f"Error, perhaps the input is wrong and is not a character or sring"
26
 
27
 
28
  @tool