diff --git a/requirements-alternative.txt b/requirements-alternative.txt deleted file mode 100644 index a2f2723d75..0000000000 --- a/requirements-alternative.txt +++ /dev/null @@ -1,14 +0,0 @@ -# I wasn't having any luck installing the requirements.txt file in Mac or Linux -# But this seems to work. -# The biggest difference is docker 5 instead of 6, because of this silliness: -# -# The conflict is caused by: -# The user requested requests>=2.26.0 -# docker 6.0.1 depends on requests>=2.26.0 -# googlesearch-python 1.1.0 depends on requests==2.25.1 -docker==5.0.3 - -# I'd love to fix this in a cleaner way - -# Now go ahead and install the rest of what requirements.txt says: --r requirements.txt diff --git a/requirements.txt b/requirements.txt index 7961106b6c..158e932419 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,5 @@ requests tiktoken==0.3.3 gTTS==2.3.1 docker -googlesearch-python +duckduckgo-search google-api-python-client #(https://developers.google.com/custom-search/v1/overview) -# Googlesearch python seems to be a bit cursed, anyone good at fixing thigns like this? \ No newline at end of file diff --git a/scripts/commands.py b/scripts/commands.py index ed789c8e92..f8f96fe72c 100644 --- a/scripts/commands.py +++ b/scripts/commands.py @@ -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 from googleapiclient.discovery import build from googleapiclient.errors import HttpError @@ -112,7 +112,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)