camasuri commited on
Commit
e5b70c4
·
verified ·
1 Parent(s): ae7a494

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -18,6 +18,23 @@ 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
+ # Below is an example of a tool that does nothing. Amaze us with your creativity !
22
+ @tool
23
+ def get_search_from_DuckDuckGo(question: str)-> str: #it's import to specify the return type
24
+ #Keep this format for the description / args / args description but feel free to modify the tool
25
+ """A tool that does nothing yet
26
+ Args:
27
+ arg1: the first argument
28
+ """
29
+ try:
30
+ search = DuckDuckGoSearchRun()
31
+
32
+ result = search.invoke(question)
33
+ return f"the answer to your question is: \n {result}"
34
+ except Exception as e:
35
+ return f"Error {str(e)}"
36
+
37
+
38
  @tool
39
  def get_current_time_in_timezone(timezone: str) -> str:
40
  """A tool that fetches the current local time in a specified timezone.