Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,27 +7,6 @@ from tools.final_answer import FinalAnswerTool
|
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
10 |
-
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
-
@tool
|
12 |
-
def DuckDuckSearchTool(query: str, num_results: int = 3) -> str:
|
13 |
-
"""A tool that searches the web using DuckDuckGo and returns the top results.
|
14 |
-
|
15 |
-
Args:
|
16 |
-
query: The search query string.
|
17 |
-
num_results: Number of search results to retrieve (default is 3).
|
18 |
-
|
19 |
-
Returns:
|
20 |
-
A formatted string with search results.
|
21 |
-
"""
|
22 |
-
search_tool = DuckDuckGoSearchTool()
|
23 |
-
results = search_tool(query=query, num_results=num_results)
|
24 |
-
|
25 |
-
if results:
|
26 |
-
return "\n".join([f"{i+1}. {res['title']} - {res['href']}" for i, res in enumerate(results)])
|
27 |
-
else:
|
28 |
-
return "No results found."
|
29 |
-
|
30 |
-
|
31 |
@tool
|
32 |
def get_current_time_in_timezone(timezone: str) -> str:
|
33 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
@tool
|
11 |
def get_current_time_in_timezone(timezone: str) -> str:
|
12 |
"""A tool that fetches the current local time in a specified timezone.
|