jborelo commited on
Commit
e9adc9b
·
verified ·
1 Parent(s): 8c5c24b

Update app.py

Browse files

get_friends_names() added

Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -18,6 +18,21 @@ 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.
 
18
  """
19
  return "What magic will you build ?"
20
 
21
+ @tool
22
+ def get_friends_names(name:str, maxnb: int)-> List[str]: #it's import to specify the return type
23
+ """A tool that returns a list of friend of given person
24
+ if name is not known then returns empty list
25
+ retuns up to maxnb elements
26
+ Args:
27
+ name: name of persone whos frinds shoulod be returned
28
+ maxnb: maximum amount of names to be returned in list
29
+ """
30
+
31
+ if name=="Jarek":
32
+ return "Piotrek Jan Pawel Ania".split()
33
+ return []
34
+
35
+
36
  @tool
37
  def get_current_time_in_timezone(timezone: str) -> str:
38
  """A tool that fetches the current local time in a specified timezone.