Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from Gradio_UI import GradioUI
|
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
|
12 |
@tool
|
13 |
-
def web_search_tool(
|
14 |
# Keep this format for the description / args / args description but feel free to modify the tool
|
15 |
"""A tool that takes user's query and performs a web search on it.
|
16 |
Args:
|
@@ -18,10 +18,10 @@ def web_search_tool(search_text:str)-> str: #it's import to specify the return t
|
|
18 |
"""
|
19 |
try:
|
20 |
# Create a search object
|
21 |
-
|
22 |
-
return
|
23 |
except Exception as e:
|
24 |
-
return f"Error fetching the search query
|
25 |
|
26 |
@tool
|
27 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
|
12 |
@tool
|
13 |
+
def web_search_tool(query:str)-> str: #it's import to specify the return type
|
14 |
# Keep this format for the description / args / args description but feel free to modify the tool
|
15 |
"""A tool that takes user's query and performs a web search on it.
|
16 |
Args:
|
|
|
18 |
"""
|
19 |
try:
|
20 |
# Create a search object
|
21 |
+
answer = DuckDuckGoSearchTool(query)
|
22 |
+
return answer
|
23 |
except Exception as e:
|
24 |
+
return f"Error fetching the search query."
|
25 |
|
26 |
@tool
|
27 |
def get_current_time_in_timezone(timezone: str) -> str:
|