fix(forge): Add `google-api-python-client-stubs` and fix type error (#7303)

- Add `google-api-python-client-stubs` dev dependency
- Add version specification to `google-api-python-client` dependency
- Fix type error (by ignoring it) in forge/components/web/search.py
pull/7247/head
Reinier van der Leer 2024-07-03 23:26:37 +02:00 committed by GitHub
parent ecb054af56
commit 7415e24fc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 39 additions and 11 deletions

16
autogpt/poetry.lock generated
View File

@ -319,7 +319,7 @@ duckduckgo-search = "^6.1.7"
en-core-web-sm = {url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl"} en-core-web-sm = {url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl"}
fastapi = "^0.109.1" fastapi = "^0.109.1"
gitpython = "^3.1.32" gitpython = "^3.1.32"
google-api-python-client = "*" google-api-python-client = "^2.116"
google-cloud-logging = "^3.8.0" google-cloud-logging = "^3.8.0"
google-cloud-storage = "^2.13.0" google-cloud-storage = "^2.13.0"
groq = "^0.8.0" groq = "^0.8.0"
@ -350,7 +350,7 @@ watchdog = "4.0.0"
webdriver-manager = "^4.0.1" webdriver-manager = "^4.0.1"
[package.extras] [package.extras]
benchmark = ["agbenchmark @ file:///Users/czerwinski/Projects/AutoGPT/benchmark"] benchmark = ["agbenchmark @ file:///home/reinier/code/agpt/AutoGPT/benchmark"]
[package.source] [package.source]
type = "directory" type = "directory"
@ -1713,20 +1713,20 @@ grpcio-gcp = ["grpcio-gcp (>=0.2.2,<1.0.dev0)"]
[[package]] [[package]]
name = "google-api-python-client" name = "google-api-python-client"
version = "2.114.0" version = "2.136.0"
description = "Google API Client Library for Python" description = "Google API Client Library for Python"
optional = false optional = false
python-versions = ">=3.7" python-versions = ">=3.7"
files = [ files = [
{file = "google-api-python-client-2.114.0.tar.gz", hash = "sha256:e041bbbf60e682261281e9d64b4660035f04db1cccba19d1d68eebc24d1465ed"}, {file = "google-api-python-client-2.136.0.tar.gz", hash = "sha256:161c722c8864e7ed39393e2b7eea76ef4e1c933a6a59f9d7c70409b6635f225d"},
{file = "google_api_python_client-2.114.0-py2.py3-none-any.whl", hash = "sha256:690e0bb67d70ff6dea4e8a5d3738639c105a478ac35da153d3b2a384064e9e1a"}, {file = "google_api_python_client-2.136.0-py2.py3-none-any.whl", hash = "sha256:5a554c8b5edf0a609b905d89d7ced82e8f6ac31da1e4d8d5684ef63dbc0e49f5"},
] ]
[package.dependencies] [package.dependencies]
google-api-core = ">=1.31.5,<2.0.dev0 || >2.3.0,<3.0.0.dev0" google-api-core = ">=1.31.5,<2.0.dev0 || >2.3.0,<3.0.0.dev0"
google-auth = ">=1.19.0,<3.0.0.dev0" google-auth = ">=1.32.0,<2.24.0 || >2.24.0,<2.25.0 || >2.25.0,<3.0.0.dev0"
google-auth-httplib2 = ">=0.1.0" google-auth-httplib2 = ">=0.2.0,<1.0.0"
httplib2 = ">=0.15.0,<1.dev0" httplib2 = ">=0.19.0,<1.dev0"
uritemplate = ">=3.0.1,<5" uritemplate = ">=3.0.1,<5"
[[package]] [[package]]

View File

@ -173,7 +173,7 @@ class WebSearchComponent(
search_results = result.get("items", []) search_results = result.get("items", [])
# Create a list of only the URLs from the search results # Create a list of only the URLs from the search results
search_results_links = [item["link"] for item in search_results] search_results_links = [item["link"] for item in search_results] # type: ignore # noqa
except HttpError as e: except HttpError as e:
# Handle errors in the API call # Handle errors in the API call

29
forge/poetry.lock generated
View File

@ -1978,6 +1978,22 @@ google-auth-httplib2 = ">=0.2.0,<1.0.0"
httplib2 = ">=0.19.0,<1.dev0" httplib2 = ">=0.19.0,<1.dev0"
uritemplate = ">=3.0.1,<5" uritemplate = ">=3.0.1,<5"
[[package]]
name = "google-api-python-client-stubs"
version = "1.25.0"
description = "Type stubs for google-api-python-client"
optional = false
python-versions = ">=3.7,<4.0"
files = [
{file = "google_api_python_client_stubs-1.25.0-py3-none-any.whl", hash = "sha256:2eff1e27b0b2980843f0ed242e430e29a2f7a2808d7b90e971f23e4ea73827a7"},
{file = "google_api_python_client_stubs-1.25.0.tar.gz", hash = "sha256:f4d219012afb35e3dfbdcfffcb0b347179045f9f48a8d59ef9d45cc743f300d4"},
]
[package.dependencies]
google-api-python-client = ">=2.122.0"
types-httplib2 = ">=0.22.0.2"
typing-extensions = ">=3.10.0"
[[package]] [[package]]
name = "google-auth" name = "google-auth"
version = "2.26.2" version = "2.26.2"
@ -6308,6 +6324,17 @@ files = [
{file = "types_html5lib-1.1.11.20240228-py3-none-any.whl", hash = "sha256:af5de0125cb0fe5667543b158db83849b22e25c0e36c9149836b095548bf1020"}, {file = "types_html5lib-1.1.11.20240228-py3-none-any.whl", hash = "sha256:af5de0125cb0fe5667543b158db83849b22e25c0e36c9149836b095548bf1020"},
] ]
[[package]]
name = "types-httplib2"
version = "0.22.0.20240310"
description = "Typing stubs for httplib2"
optional = false
python-versions = ">=3.8"
files = [
{file = "types-httplib2-0.22.0.20240310.tar.gz", hash = "sha256:1eda99fea18ec8a1dc1a725ead35b889d0836fec1b11ae6f1fe05440724c1d15"},
{file = "types_httplib2-0.22.0.20240310-py3-none-any.whl", hash = "sha256:8cd706fc81f0da32789a4373a28df6f39e9d5657d1281db4d2fd22ee29e83661"},
]
[[package]] [[package]]
name = "types-pillow" name = "types-pillow"
version = "10.2.0.20240520" version = "10.2.0.20240520"
@ -7002,4 +7029,4 @@ benchmark = ["agbenchmark"]
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.10" python-versions = "^3.10"
content-hash = "ae056efba5ba4bf69ae1fe9aa84169e20b89368fbd982c7812c3b0f41d46c666" content-hash = "5b8cca9caced2687d88fc61dc263054f15c49f2daa1560fa4d94fb5b38d461aa"

View File

@ -25,7 +25,7 @@ duckduckgo-search = "^6.1.7"
en-core-web-sm = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl" } en-core-web-sm = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl" }
fastapi = "^0.109.1" fastapi = "^0.109.1"
gitpython = "^3.1.32" gitpython = "^3.1.32"
google-api-python-client = "*" google-api-python-client = "^2.116"
google-cloud-logging = "^3.8.0" google-cloud-logging = "^3.8.0"
google-cloud-storage = "^2.13.0" google-cloud-storage = "^2.13.0"
groq = "^0.8.0" groq = "^0.8.0"
@ -67,6 +67,7 @@ pre-commit = "^3.3.3"
# Type stubs # Type stubs
boto3-stubs = { extras = ["s3"], version = "^1.33.6" } boto3-stubs = { extras = ["s3"], version = "^1.33.6" }
google-api-python-client-stubs = "^1.24"
types-beautifulsoup4 = "*" types-beautifulsoup4 = "*"
types-Pillow = "*" types-Pillow = "*"
types-requests = "^2.31.0.2" types-requests = "^2.31.0.2"