Skip to content

Commit

Permalink
Move BaseLLMHandler to /completions rename to LLMHandlerMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Dec 10, 2023
1 parent 06e09f0 commit cfe5e19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/jupyter-ai/jupyter_ai/completions/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# necessary to prevent circular import
from typing import TYPE_CHECKING, AsyncIterator, Dict

from jupyter_ai.completions.handlers.llm_mixin import LLMHandlerMixin
from jupyter_ai.completions.models import (
CompletionError,
InlineCompletionList,
Expand All @@ -12,13 +13,12 @@
ModelChangedNotification,
)
from jupyter_ai.config_manager import ConfigManager, Logger
from jupyter_ai.llm_handler import BaseLLMHandler

if TYPE_CHECKING:
from jupyter_ai.handlers import InlineCompletionHandler


class BaseInlineCompletionHandler(BaseLLMHandler):
class BaseInlineCompletionHandler(LLMHandlerMixin):
"""Class implementing completion handling."""

handler_kind = "completion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
from jupyter_ai_magics.providers import BaseProvider


class BaseLLMHandler:
class LLMHandlerMixin:
"""Base class containing shared methods and attributes used by LLM handler classes."""

# This could be used to derive `BaseChatHandler` too (there is a lot of duplication!),
# but it was decided against it to avoid introducing conflicts for backports against 1.x

handler_kind: str

def __init__(
Expand Down

0 comments on commit cfe5e19

Please sign in to comment.