I used to do
if isinstance(e, openai.error.RateLimitError): raise Exception("Rate limit exceeded too many times.") from e elif isinstance(e, openai.error.ServiceUnavailableError): raise Exception("Service unavailable too many times.") from e else: raise e
openai.error no longer exists (contradicting this page).
Now, it looks like I can do
openai.RateLimit instead of
openai.ServiceUnavailableError does not exist. Where did it go?
How can I find out where to import each error type?