Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix googlesearch dependency issue #98

Merged
merged 2 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions requirements-alternative.txt

This file was deleted.

3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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?
4 changes: 2 additions & 2 deletions scripts/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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

Expand Down Expand Up @@ -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)
Expand Down