"""Transformers backend (stub – not yet implemented)."""

from __future__ import annotations

from collections.abc import AsyncIterator
from typing import Any, Self

from thryve.core.backends.base import BaseBackend
from thryve.core.backends.transformers.param import TransformersBackendParam
from thryve.core.context.models import BackendInfo, ChatResponse, Message


class TransformersBackend(BaseBackend):
    """Placeholder for the HuggingFace Transformers backend."""

    def __init__(self, param: TransformersBackendParam) -> None:
        self._param = param

    def generate(self, messages: list[Message], **kwargs: Any) -> ChatResponse:
        raise NotImplementedError("transformers backend is not yet implemented")

    async def generate_async(self, messages: list[Message], **kwargs: Any) -> ChatResponse:
        raise NotImplementedError("transformers backend is not yet implemented")

    async def generate_stream(self, messages: list[Message], **kwargs: Any) -> AsyncIterator[str]:
        raise NotImplementedError("transformers backend is not yet implemented")
        yield ""  # pragma: no cover

    def embeddings(self, texts: list[str], **kwargs: Any) -> list[list[float]]:
        raise NotImplementedError("transformers backend is not yet implemented")

    def bind_tools(self, tools: list[Any]) -> Self:
        raise NotImplementedError("transformers backend is not yet implemented")

    def get_info(self) -> BackendInfo:
        return BackendInfo(
            provider="transformers",
            model=self._param.model,
            supports_vision=False,
            supports_tools=False,
        )
