from abc import ABC, abstractmethod
from typing import List, Dict, Generator, Optional


class LLMProvider(ABC):
    """大模型提供商基类 - 定义统一接口"""

    @abstractmethod
    def generate(self, messages: List[Dict], **kwargs) -> str:
        """同步生成内容"""
        pass

    @abstractmethod
    def stream_generate(self, messages: List[Dict], **kwargs) -> Generator[str, None, None]:
        """流式生成内容"""
        pass

    @abstractmethod
    def validate_config(self) -> bool:
        """验证配置是否有效"""
        pass
