From bbbdf0c436d5351c41d46d8e63f8268c14a9d5dd Mon Sep 17 00:00:00 2001 From: Jason Weill Date: Wed, 27 Sep 2023 17:04:36 -0700 Subject: [PATCH] Moves config to proper location, improves error logging --- packages/jupyter-ai-magics/pyproject.toml | 8 -------- packages/jupyter-ai/jupyter_ai/extension.py | 5 +++-- packages/jupyter-ai/pyproject.toml | 8 ++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/jupyter-ai-magics/pyproject.toml b/packages/jupyter-ai-magics/pyproject.toml index fefe9d275..2d059a27c 100644 --- a/packages/jupyter-ai-magics/pyproject.toml +++ b/packages/jupyter-ai-magics/pyproject.toml @@ -54,14 +54,6 @@ all = [ "boto3" ] -[project.entry-points."jupyter_ai.chat_handlers"] -ask = "jupyter_ai:AskChatHandler" -clear = "jupyter_ai:ClearChatHandler" -default = "jupyter_ai:DefaultChatHandler" -generate = "jupyter_ai:GenerateChatHandler" -help = "jupyter_ai:HelpChatHandler" -learn = "jupyter_ai:LearnChatHandler" - [project.entry-points."jupyter_ai.model_providers"] ai21 = "jupyter_ai_magics:AI21Provider" anthropic = "jupyter_ai_magics:AnthropicProvider" diff --git a/packages/jupyter-ai/jupyter_ai/extension.py b/packages/jupyter-ai/jupyter_ai/extension.py index e5541dd46..17fb4c27a 100644 --- a/packages/jupyter-ai/jupyter_ai/extension.py +++ b/packages/jupyter-ai/jupyter_ai/extension.py @@ -101,9 +101,10 @@ def initialize_settings(self): for chat_handler_ep in chat_handler_eps: try: chat_handler = chat_handler_ep.load() - except: + except Exception as err: self.log.error( - f"Unable to load chat handler class from entry point `{chat_handler_ep.name}`." + f"Unable to load chat handler class from entry point `{chat_handler_ep.name}`: " + + f"Unexpected {err=}, {type(err)=}" ) continue diff --git a/packages/jupyter-ai/pyproject.toml b/packages/jupyter-ai/pyproject.toml index 6735f9c2e..45cb849e3 100644 --- a/packages/jupyter-ai/pyproject.toml +++ b/packages/jupyter-ai/pyproject.toml @@ -40,6 +40,14 @@ dependencies = [ dynamic = ["version", "description", "authors", "urls", "keywords"] +[project.entry-points."jupyter_ai.chat_handlers"] +ask = "jupyter_ai:chat_handlers:AskChatHandler" +clear = "jupyter_ai:chat_handlers:ClearChatHandler" +default = "jupyter_ai:chat_handlers:DefaultChatHandler" +generate = "jupyter_ai:chat_handlers:GenerateChatHandler" +help = "jupyter_ai:chat_handlers:HelpChatHandler" +learn = "jupyter_ai:chat_handlers:LearnChatHandler" + [project.entry-points."jupyter_ai.default_tasks"] core_default_tasks = "jupyter_ai:tasks"