-
-
Notifications
You must be signed in to change notification settings - Fork 367
Open
Description
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.
ingemar and psyxoz
Metadata
Metadata
Assignees
Labels
No labels