jbjbjb55 commited on
Commit
5df9f5b
·
verified ·
1 Parent(s): 3d1237b

Update app.py

Browse files

New tool to count letter in word.

Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -18,6 +18,14 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
18
  """
19
  return "What magic will you build ?"
20
 
 
 
 
 
 
 
 
 
21
  @tool
22
  def get_current_time_in_timezone(timezone: str) -> str:
23
  """A tool that fetches the current local time in a specified timezone.
@@ -51,7 +59,7 @@ with open("prompts.yaml", 'r') as stream:
51
 
52
  agent = CodeAgent(
53
  model=model,
54
- tools=[final_answer], ## add your tools here (don't remove final answer)
55
  max_steps=6,
56
  verbosity_level=1,
57
  grammar=None,
 
18
  """
19
  return "What magic will you build ?"
20
 
21
+ @tool
22
+ def count_letter_in_word(word:str, letter:str)-> str: # Strawberry special
23
+ count = 0
24
+ for character in word:
25
+ if character == letter:
26
+ count += 1
27
+ return str(count)
28
+
29
  @tool
30
  def get_current_time_in_timezone(timezone: str) -> str:
31
  """A tool that fetches the current local time in a specified timezone.
 
59
 
60
  agent = CodeAgent(
61
  model=model,
62
+ tools=[final_answer, count_letter_in_word, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
63
  max_steps=6,
64
  verbosity_level=1,
65
  grammar=None,