Spaces:
Running
Running
Update app.py
Browse filesweb search tool
app.py
CHANGED
|
@@ -18,6 +18,18 @@ def my_cutom_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 search_string_on_web(query: str) -> str:
|
| 23 |
+
"""A tool that searches for a given string on the web and returns relevant information.
|
| 24 |
+
Args:
|
| 25 |
+
query: A string representing the search query.
|
| 26 |
+
"""
|
| 27 |
+
res = DuckDuckGoSearchTool().search.invoke(query)
|
| 28 |
+
if res:
|
| 29 |
+
return res
|
| 30 |
+
else:
|
| 31 |
+
return "No relevant information found"
|
| 32 |
+
|
| 33 |
@tool
|
| 34 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 35 |
"""A tool that fetches the current local time in a specified timezone.
|