"""内置模型供应商定义。"""

from typing import Any

BUILTIN_PROVIDERS: list[dict[str, Any]] = [
    {
        "provider_id": "openai",
        "display_name": "OpenAI",
        "base_url": "https://api.openai.com/v1",
        "api_key_env": "OPENAI_API_KEY",
        "models_endpoint": "https://api.openai.com/v1/models",
    },
    # {
    #     "provider_id": "anthropic",
    #     "display_name": "Anthropic",
    #     "base_url": "https://api.anthropic.com",
    #     "api_key_env": "ANTHROPIC_API_KEY",
    #     "models_endpoint": "https://api.anthropic.com/models",
    # },
    # {
    #     "provider_id": "google",
    #     "display_name": "Google Gemini",
    #     "base_url": "https://generativelanguage.googleapis.com",
    #     "api_key_env": "GEMINI_API_KEY",
    #     "models_endpoint": "https://generativelanguage.googleapis.com/v1beta/models",
    # },
    # {
    #     "provider_id": "lmstudio",
    #     "display_name": "LM Studio",
    #     "base_url": "http://localhost:1234/v1",
    #     "models_endpoint": "http://localhost:1234/v1/models",
    # },
    {
        "provider_id": "deepseek",
        "display_name": "DeepSeek",
        "base_url": "https://api.deepseek.com",
        "api_key_env": "DEEPSEEK_API_KEY",
        "models_endpoint": "https://api.deepseek.com/models",
    },
    {
        "provider_id": "alibaba",
        "display_name": "DashScope",
        "base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
        "embedding_base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings",
        "rerank_base_url": "https://dashscope.aliyuncs.com/compatible-api/v1/reranks",
        "api_key_env": "DASHSCOPE_API_KEY",
        "capabilities": ["chat", "embedding", "rerank"],
        "models_endpoint": "https://dashscope.aliyuncs.com/compatible-mode/v1/models",
        "enabled_models": [
            {
                "id": "text-embedding-v4",
                "type": "embedding",
                "display_name": "text-embedding-v4",
                "dimension": 1024,
            },
            {
                "id": "qwen3-rerank",
                "type": "rerank",
                "display_name": "qwen3-rerank",
            },
        ],
    },
    {
        "provider_id": "alibaba-coding-plan-cn",
        "display_name": "Aliyun Coding Plan",
        "base_url": "https://coding.dashscope.aliyuncs.com/v1",
        "api_key_env": "DASHSCOPE_API_KEY",
        "models_endpoint": "https://coding.dashscope.aliyuncs.com/v1/models",
    },
    {
        "provider_id": "alibaba-coding-plan",
        "display_name": "Aliyun Coding Plan (International)",
        "base_url": "https://coding-intl.dashscope.aliyuncs.com/v1",
        "api_key_env": "DASHSCOPE_API_KEY",
        "models_endpoint": "https://coding-intl.dashscope.aliyuncs.com/v1/models",
    },
    {
        "provider_id": "zhipuai",
        "display_name": "Zhipu (BigModel)",
        "base_url": "https://open.bigmodel.cn/api/paas/v4",
        "api_key_env": "ZHIPUAI_API_KEY",
        "models_endpoint": "https://open.bigmodel.cn/api/paas/v4/models",
    },
    {
        "provider_id": "zhipuai-coding-plan",
        "display_name": "Zhipu Coding Plan (BigModel)",
        "base_url": "https://open.bigmodel.cn/api/coding/paas/v4",
        "api_key_env": "ZHIPUAI_API_KEY",
        "models_endpoint": "https://open.bigmodel.cn/api/coding/paas/v4/models",
    },
    {
        "provider_id": "zai",
        "display_name": "Zhipu (Z.AI)",
        "base_url": "https://api.z.ai/api/paas/v4",
        "api_key_env": "ZAI_API_KEY",
        "models_endpoint": "https://api.z.ai/api/paas/v4/models",
    },
    {
        "provider_id": "zai-coding-plan",
        "display_name": "Zhipu Coding Plan (Z.AI)",
        "base_url": "https://api.z.ai/api/coding/paas/v4",
        "api_key_env": "ZAI_API_KEY",
        "models_endpoint": "https://api.z.ai/api/coding/paas/v4/models",
    },
    {
        "provider_id": "xiaomi-token-plan-cn",
        "display_name": "XiaomiMiMo Token Plan",
        "base_url": "https://token-plan-cn.xiaomimimo.com/v1",
        "api_key_env": "XIAOMI_MIMO_TOKEN_PLAN_API_KEY",
        "models_endpoint": "https://token-plan-cn.xiaomimimo.com/v1/models",
    },
    {
        "provider_id": "xiaomi",
        "display_name": "XiaomiMiMo",
        "base_url": "https://api.xiaomimimo.com/v1",
        "api_key_env": "XIAOMI_MIMO_API_KEY",
        "models_endpoint": "https://api.xiaomimimo.com/v1/models",
    },
    {
        "provider_id": "kimi-for-coding",
        "display_name": "Kimi Code",
        "base_url": "https://api.kimi.com/coding/v1",
        "api_key_env": "KIMI_CODE_API_KEY",
        "models_endpoint": "https://api.kimi.com/coding/v1/models",
    },
    {
        "provider_id": "moonshotai-cn",
        "display_name": "Moonshot",
        "base_url": "https://api.moonshot.cn/v1",
        "api_key_env": "MOONSHOT_API_KEY",
        "models_endpoint": "https://api.moonshot.cn/v1/models",
    },
    {
        "provider_id": "moonshotai",
        "display_name": "Moonshot (International)",
        "base_url": "https://api.moonshot.ai/v1",
        "api_key_env": "MOONSHOT_API_KEY",
        "models_endpoint": "https://api.moonshot.ai/v1/models",
    },
    {
        "provider_id": "minimax-cn",
        "display_name": "MiniMax",
        "base_url": "https://api.minimaxi.com/v1",
        "api_key_env": "MINIMAX_API_KEY",
        "models_endpoint": "https://api.minimaxi.com/v1/models",
    },
    {
        "provider_id": "minimax",
        "display_name": "MiniMax (International)",
        "base_url": "https://api.minimax.io/v1",
        "api_key_env": "MINIMAX_API_KEY",
        "models_endpoint": "https://api.minimax.io/v1/models",
    },
    {
        "provider_id": "openrouter",
        "display_name": "OpenRouter",
        "base_url": "https://openrouter.ai/api/v1",
        "api_key_env": "OPENROUTER_API_KEY",
        "capabilities": ["chat", "embedding"],
        "embedding_base_url": "https://openrouter.ai/api/v1/embeddings",
        "models_endpoint": "https://openrouter.ai/api/v1/models",
        "embedding_models_endpoint": "https://openrouter.ai/api/v1/embeddings/models",
    },
    {
        "provider_id": "modelscope",
        "display_name": "ModelScope",
        "base_url": "https://api-inference.modelscope.cn/v1",
        "api_key_env": "MODELSCOPE_ACCESS_TOKEN",
        "models_endpoint": "https://api-inference.modelscope.cn/v1/models",
    },
    {
        "provider_id": "opencode",
        "display_name": "OpenCode",
        "base_url": "https://opencode.ai/zen/v1",
        "models_endpoint": "https://opencode.ai/zen/v1/models",
    },
    {
        "provider_id": "siliconflow-cn",
        "display_name": "SiliconFlow",
        "base_url": "https://api.siliconflow.cn/v1",
        "embedding_base_url": "https://api.siliconflow.cn/v1/embeddings",
        "rerank_base_url": "https://api.siliconflow.cn/v1/rerank",
        "api_key_env": "SILICONFLOW_API_KEY",
        "capabilities": ["chat", "embedding", "rerank"],
        "models_endpoint": "https://api.siliconflow.cn/v1/models?sub_type=chat",
        "embedding_models_endpoint": "https://api.siliconflow.cn/v1/models?sub_type=embedding",
        "rerank_models_endpoint": "https://api.siliconflow.cn/v1/models?sub_type=reranker",
        "enabled_models": [
            {"id": "deepseek-ai/DeepSeek-V4-Flash", "type": "chat", "display_name": "deepseek-ai/DeepSeek-V4-Flash"},
            {"id": "Pro/MiniMaxAI/MiniMax-M2.5", "type": "chat", "display_name": "Pro/MiniMaxAI/MiniMax-M2.5"},
            {
                "id": "Pro/BAAI/bge-m3",
                "type": "embedding",
                "display_name": "Pro/BAAI/bge-m3",
                "dimension": 1024,
                "batch_size": 40,
            },
            {
                "id": "BAAI/bge-m3",
                "type": "embedding",
                "display_name": "BAAI/bge-m3",
                "dimension": 1024,
                "batch_size": 40,
            },
            {
                "id": "Qwen/Qwen3-Embedding-0.6B",
                "type": "embedding",
                "display_name": "Qwen/Qwen3-Embedding-0.6B",
                "dimension": 1024,
                "batch_size": 40,
            },
            {
                "id": "Pro/BAAI/bge-reranker-v2-m3",
                "type": "rerank",
                "display_name": "Pro/BAAI/bge-reranker-v2-m3",
            },
            {
                "id": "BAAI/bge-reranker-v2-m3",
                "type": "rerank",
                "display_name": "BAAI/bge-reranker-v2-m3",
            },
        ],
    },
    {
        "provider_id": "siliconflow",
        "display_name": "SiliconFlow (International)",
        "base_url": "https://api.siliconflow.com/v1",
        "embedding_base_url": "https://api.siliconflow.com/v1/embeddings",
        "rerank_base_url": "https://api.siliconflow.com/v1/rerank",
        "api_key_env": "SILICONFLOW_GLOBAL_API_KEY",
        "capabilities": ["chat", "embedding", "rerank"],
        "models_endpoint": "https://api.siliconflow.com/v1/models?sub_type=chat",
        "embedding_models_endpoint": "https://api.siliconflow.com/v1/models?sub_type=embedding",
        "rerank_models_endpoint": "https://api.siliconflow.com/v1/models?sub_type=reranker",
    },
]
