Skip to content

Commit

Permalink
Merge pull request #98 from farrael004/ddg-search
Browse files Browse the repository at this point in the history
Fix googlesearch dependency issue
  • Loading branch information
Torantulino authored Apr 4, 2023
2 parents 8747ff6 + e1cf66b commit 20613cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
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

0 comments on commit 20613cf

Please sign in to comment.