diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py index eb6495f6b..4df236c7e 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py @@ -534,7 +534,7 @@ def is_api_key_exc(cls, e: Exception): """ import openai - if isinstance(e, openai.error.AuthenticationError): + if isinstance(e, openai.AuthenticationError): error_details = e.json_body.get("error", {}) return error_details.get("code") == "invalid_api_key" return False @@ -574,7 +574,7 @@ def is_api_key_exc(cls, e: Exception): """ import openai - if isinstance(e, openai.error.AuthenticationError): + if isinstance(e, openai.AuthenticationError): error_details = e.json_body.get("error", {}) return error_details.get("code") == "invalid_api_key" return False @@ -620,7 +620,7 @@ def is_api_key_exc(cls, e: Exception): """ import openai - if isinstance(e, openai.error.AuthenticationError): + if isinstance(e, openai.AuthenticationError): error_details = e.json_body.get("error", {}) return error_details.get("code") == "invalid_api_key" return False