diff --git a/packages/jupyter-ai/jupyter_ai/completions/handlers/base.py b/packages/jupyter-ai/jupyter_ai/completions/handlers/base.py index a1cdeb0d1..275bf2bd0 100644 --- a/packages/jupyter-ai/jupyter_ai/completions/handlers/base.py +++ b/packages/jupyter-ai/jupyter_ai/completions/handlers/base.py @@ -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, @@ -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" diff --git a/packages/jupyter-ai/jupyter_ai/llm_handler.py b/packages/jupyter-ai/jupyter_ai/completions/handlers/llm_mixin.py similarity index 91% rename from packages/jupyter-ai/jupyter_ai/llm_handler.py rename to packages/jupyter-ai/jupyter_ai/completions/handlers/llm_mixin.py index bf268e567..a0a3b0505 100644 --- a/packages/jupyter-ai/jupyter_ai/llm_handler.py +++ b/packages/jupyter-ai/jupyter_ai/completions/handlers/llm_mixin.py @@ -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__(