diff options
Diffstat (limited to 'autogpts/autogpt/autogpt/commands/web_search.py')
-rw-r--r-- | autogpts/autogpt/autogpt/commands/web_search.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/autogpts/autogpt/autogpt/commands/web_search.py b/autogpts/autogpt/autogpt/commands/web_search.py index e39bfffc6..717d5295c 100644 --- a/autogpts/autogpt/autogpt/commands/web_search.py +++ b/autogpts/autogpt/autogpt/commands/web_search.py @@ -49,8 +49,7 @@ def web_search(query: str, agent: Agent, num_results: int = 8) -> str: if not query: return json.dumps(search_results) - results = DDGS().text(query) - search_results = list(islice(results, num_results)) + search_results = DDGS().text(query, max_results=num_results) if search_results: break |