from pydantic import BaseModel
from pydantic_settings import BaseSettings
from dotenv import load_dotenv
import os

load_dotenv()


class Settings(BaseSettings):
    APP_NAME: str = "AI Network Configurator"
    DEBUG: bool = True
    API_PREFIX: str = "/api"

    # 硅基流动API配置
    SILICONFLOW_API_KEY: str = os.getenv("SILICONFLOW_API_KEY", "sk-mhzuedasunrgdrxfkcxmxgaypgjnxgodvvmrzzdbqrwtkqej")
    SILICONFLOW_API_URL: str = os.getenv("SILICONFLOW_API_URL", "https://api.siliconflow.cn/v1")

    # 交换机配置
    SWITCH_TIMEOUT: int = os.getenv("SWITCH_TIMEOUT", 10)

    # eNSP配置
    ENSP_DEFAULT_IP: str = "172.17.99.201"
    ENSP_DEFAULT_PORT: int = 2000

    class Config:
        env_file = ".env"
        extra = "ignore"


settings = Settings()