from dishka import BaseScope, Provider, Scope, provide
from sentence_transformers import SentenceTransformer

from template_project.adapters.embedding.minilm_embedder import MiniLMEmbedder
from template_project.application.common.embedding import Embedder


class EmbeddingProvider(Provider):
    scope: BaseScope | None = Scope.APP

    @provide(scope=Scope.APP)
    def embedder(self, model: SentenceTransformer) -> Embedder:
        return MiniLMEmbedder(model=model)
