diff --git a/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py b/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py index da7a3a650..08f03696c 100644 --- a/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py +++ b/packages/jupyter-ai/jupyter_ai/chat_handlers/base.py @@ -134,8 +134,7 @@ def is_api_key_exc(self, e: Exception): def handle_api_key_exc(self, e: Exception, message: HumanChatMessage): provider_name = "" if hasattr(self.config_manager, "lm_provider"): - name = getattr(self.config_manager.lm_provider, "name", "") - provider_name = f" {name}" if name else "" + provider_name = getattr(self.config_manager.lm_provider, "name", "") response = f"Oops! There's a problem connecting to {provider_name}. Please update your {provider_name} API key in the chat settings." self.reply(response, message)