Spaces:
Runtime error
Runtime error
File size: 569 Bytes
6086e71 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | """
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."""
...
|