Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,19 +9,20 @@ 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
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
25 |
|
26 |
@tool
|
27 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
9 |
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
@tool
|
12 |
+
def limited_search(self, search_query: str, num_results: int) -> str:
|
13 |
+
"""
|
14 |
+
Performs a DuckDuckGo search with the number of search results specified in initial user input.
|
15 |
+
|
16 |
+
Args:
|
17 |
+
search_query: The string search query.
|
18 |
+
num_results: An integer representing the requested number of search engine responses.
|
19 |
+
|
20 |
+
Returns:
|
21 |
+
str: A string containing the search results.
|
22 |
+
"""
|
23 |
+
search_tool = DuckDuckGoSearchTool()
|
24 |
+
results = search_tool.use(query=search_query, max_results=num_results)
|
25 |
+
return str(results)
|
26 |
|
27 |
@tool
|
28 |
def get_current_time_in_timezone(timezone: str) -> str:
|