From 58c46a18ec5843666aef425d0620f4bc44026fb1 Mon Sep 17 00:00:00 2001
From: ctcjab <joshua.bronson@chicagotrading.com>
Date: Mon, 25 Nov 2024 09:03:05 -0500
Subject: [PATCH 1/2] Downgrade spurious 'error' logs

Since it is expected that not all model providers will be loadable, it
is wrong to log the case that one cannot be loaded with level 'error'.

Resolves #839.
---
 packages/jupyter-ai-magics/jupyter_ai_magics/utils.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py b/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py
index 983bbf2d5..b64a5f3de 100644
--- a/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py
+++ b/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py
@@ -36,10 +36,7 @@ def get_lm_providers(
             )
             continue
         except Exception as e:
-            log.error(
-                f"Unable to load model provider `{provider_ep.name}`. Printing full exception below."
-            )
-            log.exception(e)
+            log.warning(f"Unable to load model provider `{provider_ep.name}`", exc_info=e)
             continue
 
         if not is_provider_allowed(provider.id, restrictions):
@@ -66,7 +63,7 @@ def get_em_providers(
         try:
             provider = model_provider_ep.load()
         except Exception as e:
-            log.error(
+            log.warning(
                 f"Unable to load embeddings model provider class from entry point `{model_provider_ep.name}`: %s.",
                 e,
             )

From 58a46dea1709ff4144d5ae96c362669e0bedf9b2 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Tue, 26 Nov 2024 22:55:45 +0000
Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 packages/jupyter-ai-magics/jupyter_ai_magics/utils.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py b/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py
index b64a5f3de..5fb8f4fee 100644
--- a/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py
+++ b/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py
@@ -36,7 +36,9 @@ def get_lm_providers(
             )
             continue
         except Exception as e:
-            log.warning(f"Unable to load model provider `{provider_ep.name}`", exc_info=e)
+            log.warning(
+                f"Unable to load model provider `{provider_ep.name}`", exc_info=e
+            )
             continue
 
         if not is_provider_allowed(provider.id, restrictions):