"""
DeepSeek 提供商适配器

兼容 OpenAI API，继承 OpenAI 适配器
"""
import logging
from typing import List, Dict, Any

from .openai_provider import OpenAIProvider
from .registry import ProviderRegistry

logger = logging.getLogger(__name__)


@ProviderRegistry.register
class DeepSeekProvider(OpenAIProvider):
    """
    DeepSeek 提供商适配器
    
    兼容 OpenAI API 格式，支持 DeepSeek-V3、DeepSeek-R1 等模型
    """
    
    provider_type = 'deepseek'
    provider_name = 'DeepSeek'
    supported_model_types = ['chat', 'completion']
    
    DEFAULT_API_BASE = 'https://api.deepseek.com/v1'
    
    @classmethod
    def get_default_models(cls) -> List[Dict[str, Any]]:
        """获取默认模型列表"""
        return [
            # ---- Chat 模型 ----
            {
                'model_name': 'deepseek-chat',
                'display_name': 'DeepSeek V3',
                'model_type': 'chat',
                'max_tokens': 8192,
                'context_window': 65536,
                'supports_vision': False,
                'supports_function_call': True,
                'input_price': 0.0014,
                'output_price': 0.0028,
            },
            {
                'model_name': 'deepseek-reasoner',
                'display_name': 'DeepSeek R1',
                'model_type': 'chat',
                'max_tokens': 8192,
                'context_window': 65536,
                'supports_vision': False,
                'supports_function_call': False,
                'input_price': 0.004,
                'output_price': 0.016,
            },
        ]
