Skip to content

Commit

Permalink
Moves config to proper location, improves error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonWeill committed Oct 19, 2023
1 parent 12b8e02 commit 1707f30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 0 additions & 8 deletions packages/jupyter-ai-magics/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions packages/jupyter-ai/jupyter_ai/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions packages/jupyter-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 1707f30

Please sign in to comment.