Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
+
|
22 |
+
@tool
|
23 |
+
def basic_search(q:str)-> str:
|
24 |
+
"""A tool that takes in a user query and returns the output from a DuckDuckGo search.
|
25 |
+
Args:
|
26 |
+
q: User query
|
27 |
+
"""
|
28 |
+
|
29 |
+
try:
|
30 |
+
search_tool = DuckDuckGoSearchTool()
|
31 |
+
results = search_tool(q)
|
32 |
+
return str(results)
|
33 |
+
except Exception as e:
|
34 |
+
return f"Error: {str(e)}"
|
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.
|