import os from fastapi import HTTPException, status class EnvironmentVariableChecker: def validate_environment_variables(self): variables = ['AUTHENTICATION_TOKEN', 'HUGGINGFACE_TOKEN', 'HUGGINGFACE_ORGANIZATION'] for variable in variables: if os.getenv(variable) is None: raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"Environment variable {variable} not set, please set the {variable} environment variable", ) def get_authentication_token(self): return os.getenv('AUTHENTICATION_TOKEN') def get_huggingface_token(self): return os.getenv('HUGGINGFACE_TOKEN'); def get_huggingface_organization(self): return os.getenv('HUGGINGFACE_ORGANIZATION');