import volcenginesdkcore


class BaseClient:
    """火山云基础客户端 - 配置统一入口"""
    
    def __init__(self, ak, sk, region="cn-beijing"):
        self.ak = ak
        self.sk = sk
        self.region = region
        self._init_config()
    
    def _init_config(self):
        """初始化火山云配置"""
        try:
            configuration = volcenginesdkcore.Configuration()
            configuration.ak = self.ak
            configuration.sk = self.sk
            configuration.region = self.region
            volcenginesdkcore.Configuration.set_default(configuration)
        except Exception as e:
            raise Exception(f"初始化火山云配置失败: {str(e)}")
