kschuette commited on
Commit
a0bdb4c
·
verified ·
1 Parent(s): ae7a494

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -1
app.py CHANGED
@@ -18,6 +18,42 @@ 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.
@@ -55,7 +91,7 @@ with open("prompts.yaml", 'r') as stream:
55
 
56
  agent = CodeAgent(
57
  model=model,
58
- tools=[final_answer], ## add your tools here (don't remove final answer)
59
  max_steps=6,
60
  verbosity_level=1,
61
  grammar=None,
 
18
  """
19
  return "What magic will you build ?"
20
 
21
+ @tool
22
+ def name_facts(name:str)-> str:
23
+ """A tool that provides fun facts and history about a given name
24
+ Args:
25
+ arg1: the given name to analyze
26
+ """
27
+ try:
28
+ search_tool = DuckDuckGoSearchTool()
29
+ return search_tool.run(f"{name} name history and facts")
30
+ except Exception as e:
31
+ return f"Error fetching results for name '{name}': {str(e)}"
32
+
33
+ @tool
34
+ def healthy_check(age:int, height:int, weight:int)-> str:
35
+ """A tool that checks if the given age, height, and weight statistics are considered healthy or not
36
+ Args:
37
+ arg1: the age of the person in years
38
+ arg2: the height of the person in cm
39
+ arg3: the weight of the person in lbs
40
+ """
41
+ try:
42
+ search_tool = DuckDuckGoSearchTool()
43
+ return search_tool.run(f"Is height {height}cm and weight {weight}lbs considered healthy at age {age}?")
44
+ except Exception as e:
45
+ return f"Error fetching results for name '{name}': {str(e)}"
46
+
47
+ @tool
48
+ def conversation_image(conversation:str, user:str, user_description:str)-> str:
49
+ """A tool that does nothing yet
50
+ Args:
51
+ arg1: the first argument
52
+ arg2: the second argument
53
+ arg3: the third
54
+ """
55
+ return "What magic will you build ?"
56
+
57
  @tool
58
  def get_current_time_in_timezone(timezone: str) -> str:
59
  """A tool that fetches the current local time in a specified timezone.
 
91
 
92
  agent = CodeAgent(
93
  model=model,
94
+ tools=[final_answer, name_facts, healthy_check, conversation_image], ## add your tools here (don't remove final answer)
95
  max_steps=6,
96
  verbosity_level=1,
97
  grammar=None,