Update app.py
Browse files
app.py
CHANGED
@@ -34,6 +34,19 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
34 |
except Exception as e:
|
35 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
@tool
|
38 |
def mirror_user(happy: str) -> str:
|
39 |
"""A tool that provides a smiley face if the user is happy or a sad face if the user is not. All this will return is "Done" indicating
|
|
|
34 |
except Exception as e:
|
35 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
36 |
|
37 |
+
# Web search tool using DuckDuckGo
|
38 |
+
@tool
|
39 |
+
def duckduckgo_search(query: str) -> list:
|
40 |
+
"""A tool that performs a web search using DuckDuckGo and returns relevant results.
|
41 |
+
Args:
|
42 |
+
query: The search term or question to look up.
|
43 |
+
Returns:
|
44 |
+
A list of search results containing URLs and descriptions.
|
45 |
+
"""
|
46 |
+
search_tool = DuckDuckGoSearchTool()
|
47 |
+
results = search_tool(query)
|
48 |
+
return results
|
49 |
+
|
50 |
@tool
|
51 |
def mirror_user(happy: str) -> str:
|
52 |
"""A tool that provides a smiley face if the user is happy or a sad face if the user is not. All this will return is "Done" indicating
|