From f564b1c9408044667ad30dbc9dde48b47570a331 Mon Sep 17 00:00:00 2001 From: Jason Weill Date: Wed, 27 Dec 2023 15:43:03 -0800 Subject: [PATCH] Migration per openai migrate --- packages/jupyter-ai-magics/jupyter_ai_magics/providers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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