Is your feature request related to a problem? Please describe.
Hitting an OpenAI rate limit should sometimes be handled differently than hitting other Faraday errors. With higher throughput applications, it's likely an expected state at some point.
Describe the solution you'd like
A simple solution could be providing a custom error:
rescue OpenAIError::RateLimitExceeded => e
# Apply backoff logic based on reset value from OpenAI header
rescue = > e
# Handle error
end
Describe alternatives you've considered
Check the status code. This works easy enough, but would be nice to be built-in and the code be the documentation.
Is your feature request related to a problem? Please describe.
Hitting an OpenAI rate limit should sometimes be handled differently than hitting other Faraday errors. With higher throughput applications, it's likely an expected state at some point.
Describe the solution you'd like
A simple solution could be providing a custom error:
Describe alternatives you've considered
Check the status code. This works easy enough, but would be nice to be built-in and the code be the documentation.