Update app.py
#232
by
Abhi-Sri
- opened
app.py
CHANGED
|
@@ -33,6 +33,17 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
final_answer = FinalAnswerTool()
|
| 38 |
|
|
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
+
@tool
|
| 37 |
+
def web_search(query: str) -> str:
|
| 38 |
+
"""A tool that fetches webpage links from the internet which are relevant to the query"""
|
| 39 |
+
|
| 40 |
+
try:
|
| 41 |
+
#Search initialization
|
| 42 |
+
qus = DuckDuckGoSearchTool.__init__(query)
|
| 43 |
+
#Display the results
|
| 44 |
+
results = DuckDuckGoSearchTool.forward(qus)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
|
| 48 |
final_answer = FinalAnswerTool()
|
| 49 |
|