Open parthea opened 1 month ago
I faced this issue when I was making API calls to gemini-1.5-pro
model using langchain-google-genai
module. Because of this issue, I could not initially understand the actual cause.
After reading this thread, I installed grpcio-status
, after which I could see the actual error: 429 Resource has been exhausted (e.g. check quota)
.
In
exceptions.py
, ifgrpcio-status
is not installed,rpc_status
is set toNone
https://github.com/googleapis/python-api-core/blob/d96eb5cdd8120bfec97d62b09512c6fecc325be8/google/api_core/exceptions.py#L31-L43
In
_parse_grpc_error_details
, whenrpc_status
isNone
, this leads toAttributeError: 'NoneType' object has no attribute 'from_call'
https://github.com/googleapis/python-api-core/blob/d96eb5cdd8120bfec97d62b09512c6fecc325be8/google/api_core/exceptions.py#L562-L566We should add a check to make sure
rpc_status
is notNone
before callingrpc_status.from_call(rpc_exc)