Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cookiecutter template #637

Merged
merged 9 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pre-commit
  • Loading branch information
dlqqq committed Feb 12, 2024
commit 3d5da61baa1eb3689de1ae3e3854c9ecf2375077
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
dlqqq marked this conversation as resolved.
Show resolved Hide resolved
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
Loading