Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,17 +10,14 @@ from Gradio_UI import GradioUI
|
|
| 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 |
|
|
|
|
| 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 |
+
"""A tool that performs a DuckDuckGo search with the number of search results specified in initial user input.
|
|
|
|
|
|
|
| 14 |
Args:
|
| 15 |
search_query: The string search query.
|
| 16 |
num_results: An integer representing the requested number of search engine responses.
|
|
|
|
|
|
|
|
|
|
| 17 |
"""
|
| 18 |
+
# Create search object
|
| 19 |
search_tool = DuckDuckGoSearchTool()
|
| 20 |
+
# Get results from query
|
| 21 |
results = search_tool.use(query=search_query, max_results=num_results)
|
| 22 |
return str(results)
|
| 23 |
|