Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dlqqq committed Feb 12, 2024
1 parent f27f6e0 commit 3d5da61
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from langchain_core.callbacks.manager import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM


class TestLLM(LLM):
model_id: str

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import ClassVar, List

from jupyter_ai import AuthStrategy, BaseProvider, Field

from .llm import TestLLM
Expand Down Expand Up @@ -40,9 +41,7 @@ class TestModelProvider(BaseProvider, <langchain-llm-class>):
name: ClassVar[str] = "Test Provider"
"""User-facing name of this provider."""

models: ClassVar[List[str]] = [
"test-model-1"
]
models: ClassVar[List[str]] = ["test-model-1"]
"""List of supported models by their IDs. For registry providers, this will
be just ["*"]."""

Expand All @@ -69,4 +68,3 @@ class TestModelProvider(BaseProvider, <langchain-llm-class>):
fields: ClassVar[List[Field]] = []
"""User inputs expected by this provider when initializing it. Each `Field` `f`
should be passed in the constructor as a keyword argument, keyed by `f.key`."""

Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
from jupyter_ai.chat_handlers.base import BaseChatHandler, SlashCommandRoutingType
from jupyter_ai.models import HumanChatMessage


class TestSlashCommand(BaseChatHandler):
"""
A test slash command implementation that developers should build from. The
string used to invoke this command is set by the `slash_id` keyword argument
in the `routing_type` attribute. The command is mainly implemented in the
`process_message()` method. See built-in implementations under
`jupyter_ai/handlers` for further reference.
`jupyter_ai/handlers` for further reference.
The provider is made available to Jupyter AI by the entry point declared in
`pyproject.toml`. If this class or parent module is renamed, make sure the
update the entry point there as well.
"""

id = "test"
name = "Test"
help = "A test slash command."
Expand Down
7 changes: 4 additions & 3 deletions packages/jupyter-ai/jupyter_ai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from ._version import __version__
from .extension import AiExtension

# expose jupyter_ai_magics ipython extension
# DO NOT REMOVE.
from jupyter_ai_magics import load_ipython_extension, unload_ipython_extension
Expand All @@ -9,6 +6,10 @@
# DO NOT REMOVE.
from jupyter_ai_magics.providers import *

from ._version import __version__
from .extension import AiExtension


def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": "@jupyter-ai/core"}]

Expand Down

0 comments on commit 3d5da61

Please sign in to comment.