PlainSQL / backend /app /llm /base.py
LalitChaudhari3's picture
feat: synchronize text-to-sql-bot codebase with Hugging Face Space repository, including Docker build configurations
6086e71
Raw
History Blame Contribute Delete
569 Bytes
"""
Abstract LLM Provider Interface — All providers must implement this.
"""
from abc import ABC, abstractmethod
class BaseLLMProvider(ABC):
"""Base class for all LLM providers."""
@abstractmethod
def generate(self, messages: list[dict], **kwargs) -> str:
"""Generate a response from the model."""
...
@abstractmethod
def health_check(self) -> bool:
"""Check if the provider is available."""
...
@property
@abstractmethod
def name(self) -> str:
"""Provider name identifier."""
...