Spaces:
Sleeping
Sleeping
added search and image gen tool
Browse files
app.py
CHANGED
|
@@ -33,6 +33,15 @@ 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 the information from the web search.
|
| 39 |
+
Args:
|
| 40 |
+
query: Query needed to be asked from the web
|
| 41 |
+
"""
|
| 42 |
+
web_search_tool = DuckDuckGoSearchTool(max_results=5, rate_limit=2.0)
|
| 43 |
+
results = web_search_tool("Hugging Face")
|
| 44 |
+
return results
|
| 45 |
|
| 46 |
final_answer = FinalAnswerTool()
|
| 47 |
|