mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Fixed googlesearch dependency issue
Swapped the googlesearch package for the duckduckgo-search. It uses the ddg instant answer API and works very similarly to the googlesearch one.
This commit is contained in:
@@ -9,7 +9,7 @@ import ai_functions as ai
|
||||
from file_operations import read_file, write_to_file, append_to_file, delete_file
|
||||
from execute_code import execute_python_file
|
||||
from json_parser import fix_and_parse_json
|
||||
from googlesearch import search
|
||||
from duckduckgo_search import ddg
|
||||
cfg = Config()
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ def get_datetime():
|
||||
|
||||
def google_search(query, num_results=8):
|
||||
search_results = []
|
||||
for j in search(query, num_results=num_results):
|
||||
for j in ddg(query, max_results=num_results):
|
||||
search_results.append(j)
|
||||
|
||||
return json.dumps(search_results, ensure_ascii=False, indent=4)
|
||||
|
||||
Reference in New Issue
Block a user