Open
Description
In libs/genai/langchain_google_genai/chat_models.py, the max_retries parameter appears to be unused — the retry mechanism always defaults to 2 retries regardless of the value passed.
Additionally, the following backoff-related parameters are currently hardcoded:
multiplier = 2
min_seconds = 1
max_seconds = 60
It would be helpful to make these configurable so that users can adjust the retry behavior as needed.
Lastly, for cases where the API returns a quota-exceeded error and provides a recommended retry delay, it would be good to parse that value and wait accordingly, if the suggested delay is less than the configured timeout. This would allow for more efficient handling of rate limits.