Merge branch 'master' into dev

This commit is contained in:
Andres Caicedo
2023-04-04 12:21:26 +02:00
3 changed files with 3 additions and 18 deletions

View File

@@ -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

View File

@@ -9,6 +9,5 @@ requests
tiktoken==0.3.3 tiktoken==0.3.3
gTTS==2.3.1 gTTS==2.3.1
docker docker
googlesearch-python duckduckgo-search
google-api-python-client #(https://developers.google.com/custom-search/v1/overview) 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?

View File

@@ -9,7 +9,7 @@ import ai_functions as ai
from file_operations import read_file, write_to_file, append_to_file, delete_file from file_operations import read_file, write_to_file, append_to_file, delete_file
from execute_code import execute_python_file from execute_code import execute_python_file
from json_parser import fix_and_parse_json from json_parser import fix_and_parse_json
from googlesearch import search from duckduckgo_search import ddg
from googleapiclient.discovery import build from googleapiclient.discovery import build
from googleapiclient.errors import HttpError from googleapiclient.errors import HttpError
@@ -116,7 +116,7 @@ def get_datetime():
def google_search(query, num_results=8): def google_search(query, num_results=8):
"""Return the results of a google search""" """Return the results of a google search"""
search_results = [] search_results = []
for j in search(query, num_results=num_results): for j in ddg(query, max_results=num_results):
search_results.append(j) search_results.append(j)
return json.dumps(search_results, ensure_ascii=False, indent=4) return json.dumps(search_results, ensure_ascii=False, indent=4)