Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,9 +29,13 @@ def search_answer(question: str) -> str:
|
|
| 29 |
Returns:
|
| 30 |
str: A summarized text extracted from DuckDuckGo search results.
|
| 31 |
"""
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 29 |
Returns:
|
| 30 |
str: A summarized text extracted from DuckDuckGo search results.
|
| 31 |
"""
|
| 32 |
+
try:
|
| 33 |
+
search_tool = DuckDuckgoSearchTool()
|
| 34 |
+
results = search_tool(question)
|
| 35 |
+
return results or "No relevant results were found."
|
| 36 |
+
except Exception as e:
|
| 37 |
+
logger.error(f"DuckDuckGo search failed: {e}")
|
| 38 |
+
return "Sorry, I couldn't complete the search due to an internal error."
|
| 39 |
|
| 40 |
@tool
|
| 41 |
def get_current_time_in_timezone(timezone: str) -> str:
|