Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Fixed googlesearch dependency issue

Rafael Moraes6306a033cc95
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 5f51bdf579..0fcdfb457d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -8,5 +8,5 @@ readability-lxml==0.8.1
requests
tiktoken==0.3.3
docker
-googlesearch-python
+duckduckgo-search
# 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 2e332711bc..2d98a2b287 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
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)