"""Abstract base class for LLM providers."""

from __future__ import annotations

from abc import ABC, abstractmethod
from collections.abc import AsyncIterator


class LLMProvider(ABC):
    """Abstract LLM provider with generate and stream methods."""

    @abstractmethod
    async def generate(self, prompt: str, system: str | None = None) -> str:
        """Generate a complete response.

        Args:
            prompt: The user prompt.
            system: Optional system prompt.

        Returns:
            The complete response text.
        """

    @abstractmethod
    def stream(self, prompt: str, system: str | None = None) -> AsyncIterator[str]:
        """Stream a response token-by-token.

        Args:
            prompt: The user prompt.
            system: Optional system prompt.

        Yields:
            Response text chunks.
        """
