Skip to content

Commit 9443cee

Browse files
authored
[ENV VARS] Read env vars from user input (#86)
* change env var * remove jump line * fix lint * add default values * fix lint --------- Co-authored-by: John Calderon <john.calderon@centml.ai>
1 parent a8a951c commit 9443cee

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

centml/sdk/config.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ class Config(BaseSettings):
88
# It is possible to override the default values by setting the environment variables
99
model_config = SettingsConfigDict(env_file=Path('.env'))
1010

11-
CENTML_WEB_URL: str = "https://app.centml.com/"
12-
CENTML_CONFIG_PATH: str = os.path.expanduser("~/.centml")
13-
CENTML_CRED_FILE: str = "credentials.json"
14-
CENTML_CRED_FILE_PATH: str = CENTML_CONFIG_PATH + "/" + CENTML_CRED_FILE
11+
CENTML_WEB_URL: str = os.getenv("CENTML_WEB_URL", default="https://app.centml.com/")
12+
CENTML_CONFIG_PATH: str = os.getenv("CENTML_CONFIG_PATH", default=os.path.expanduser("~/.centml"))
13+
CENTML_CRED_FILE: str = os.getenv("CENTML_CRED_FILE", default="credentials.json")
14+
CENTML_CRED_FILE_PATH: str = os.path.join(CENTML_CONFIG_PATH, CENTML_CRED_FILE)
1515

16-
CENTML_PLATFORM_API_URL: str = "https://api.centml.com"
16+
CENTML_PLATFORM_API_URL: str = os.getenv("CENTML_PLATFORM_API_URL", default="https://api.centml.com")
1717

18-
CENTML_FIREBASE_API_KEY: str = "AIzaSyChPXy41cIAxS_Nd8oaYKyP_oKkIucobtY"
18+
CENTML_FIREBASE_API_KEY: str = os.getenv(
19+
"CENTML_FIREBASE_API_KEY", default="AIzaSyChPXy41cIAxS_Nd8oaYKyP_oKkIucobtY"
20+
)
1921

2022

2123
settings = Config()

0 commit comments

Comments
 (0)