Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,7 @@ co = cohere.Client(cohere_api_key)
|
|
26 |
# """Search the web for information on a given topic."""
|
27 |
# return DuckDuckGoSearchRun().run(search_query)
|
28 |
|
|
|
29 |
# Define the DuckDuckGoSearch tool
|
30 |
@tool('DuckDuckGoSearchResults')
|
31 |
def search_results(search_query: str) -> dict:
|
@@ -36,8 +37,10 @@ def search_results(search_query: str) -> dict:
|
|
36 |
- search_query (str): The query string that specifies the information to be searched on the web. This should be a clear and concise expression of the user's information needs.
|
37 |
Returns:
|
38 |
- list: A list of dictionaries, where each dictionary represents a search result. Each dictionary includes at least the 'title' of the page and the 'url' linking to it. Additional information such as a brief summary or snippet from the page might also be included depending on the specifics of the DuckDuckGo API response.
|
39 |
-
"""
|
40 |
-
|
|
|
|
|
41 |
|
42 |
@tool('WebScrapper')
|
43 |
def web_scrapper(url: str, topic: str) -> str:
|
|
|
26 |
# """Search the web for information on a given topic."""
|
27 |
# return DuckDuckGoSearchRun().run(search_query)
|
28 |
|
29 |
+
|
30 |
# Define the DuckDuckGoSearch tool
|
31 |
@tool('DuckDuckGoSearchResults')
|
32 |
def search_results(search_query: str) -> dict:
|
|
|
37 |
- search_query (str): The query string that specifies the information to be searched on the web. This should be a clear and concise expression of the user's information needs.
|
38 |
Returns:
|
39 |
- list: A list of dictionaries, where each dictionary represents a search result. Each dictionary includes at least the 'title' of the page and the 'url' linking to it. Additional information such as a brief summary or snippet from the page might also be included depending on the specifics of the DuckDuckGo API response.
|
40 |
+
"""
|
41 |
+
results = DuckDuckGoSearchResults(max_results=10).run(search_query)
|
42 |
+
|
43 |
+
return results
|
44 |
|
45 |
@tool('WebScrapper')
|
46 |
def web_scrapper(url: str, topic: str) -> str:
|