mirror of
https://github.com/stripe/ai.git
synced 2026-09-14 18:39:59 +08:00
bf9c5e3444
* update workflows * move * update * update * fix license
21 lines
368 B
Python
21 lines
368 B
Python
from os import getenv
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
# Load the environment
|
|
load_dotenv()
|
|
|
|
|
|
def ensure(name: str) -> str:
|
|
var = getenv(name)
|
|
if not var:
|
|
raise ValueError(f"Missing '{name}' environment variable")
|
|
return var
|
|
|
|
|
|
def get_or(name: str, default: str) -> str:
|
|
var = getenv(name)
|
|
if not var:
|
|
return default
|
|
return var
|