lesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least oncelesson 1 of 2 · .env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once.env, os.getenv, and the leak recovery you'll do at least once
Build a config loader. Write load_config(env) that:
- Reads
ANTHROPIC_API_KEYfromenv. If missing or empty, raiseRuntimeError("ANTHROPIC_API_KEY missing"). - Reads
MODELwith a default of"claude-sonnet-4-6". - Reads
DEBUGwith a default of"false", normalizes it to a real bool by lowercasing and comparing to"true". - Returns a dict with keys
api_key,model, anddebug.
Then call it on the provided env and print one line per key.
Expected output:
api_key=sk-ant-test
model=claude-sonnet-4-6
debug=True