Shourya Angrish commited on
Commit
f8ea2f8
·
1 Parent(s): ae7a494

get commands adding

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -18,6 +18,17 @@ 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_commands(arg1:str)-> str:
23
+ """A tool that fetches the commands from a given software.
24
+ Args:
25
+ arg1: the software name.
26
+ """
27
+ duck = DuckDuckGoSearchTool()
28
+ software_query = f"Top 5 commands for the {arg1}"
29
+ results = duck(software_query)
30
+ return f"Here are the top 5 commands for {arg1}:\n{results}"
31
+
32
  @tool
33
  def get_current_time_in_timezone(timezone: str) -> str:
34
  """A tool that fetches the current local time in a specified timezone.