Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,13 +34,16 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
@tool
|
| 37 |
-
def
|
| 38 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 39 |
"""A tool that does nothing yet
|
| 40 |
Args:
|
| 41 |
-
|
| 42 |
"""
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
final_answer = FinalAnswerTool()
|
|
|
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
@tool
|
| 37 |
+
def web_search(query:str)-> str: #it's import to specify the return type
|
| 38 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 39 |
"""A tool that does nothing yet
|
| 40 |
Args:
|
| 41 |
+
query: A string representing the query to search
|
| 42 |
"""
|
| 43 |
+
try:
|
| 44 |
+
DuckDuckGoSearchTool(web_search)
|
| 45 |
+
except Exce as e:
|
| 46 |
+
return "Cannot use this tool"
|
| 47 |
|
| 48 |
|
| 49 |
final_answer = FinalAnswerTool()
|