Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,6 +20,26 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
20 |
"""
|
21 |
return "What magic will you build ?"
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
@tool
|
24 |
def get_current_time_in_timezone(timezone: str) -> str:
|
25 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
20 |
"""
|
21 |
return "What magic will you build ?"
|
22 |
|
23 |
+
@tool
|
24 |
+
def duckduckgo_web_search(query:str)-> str:
|
25 |
+
"""A tool that fetches the result from the duckduckgo web search
|
26 |
+
Args:
|
27 |
+
query: The query to be searched
|
28 |
+
"""
|
29 |
+
searc_tool = DuckDuckGoSearchTool()
|
30 |
+
result = searc_tool.forward(query)
|
31 |
+
return result
|
32 |
+
|
33 |
+
@tool
|
34 |
+
def visit_webpage(url:str)-> str:
|
35 |
+
"""A tool that visits a webpage at the given url and reads its content as a markdown string
|
36 |
+
Args:
|
37 |
+
url: The url of the webpage wanted to visit
|
38 |
+
"""
|
39 |
+
visit_tool = VisitWebpageTool()
|
40 |
+
result = visit_tool.forward(url)
|
41 |
+
return result
|
42 |
+
|
43 |
@tool
|
44 |
def get_current_time_in_timezone(timezone: str) -> str:
|
45 |
"""A tool that fetches the current local time in a specified timezone.
|