Get environment variable with optional requirement check
(key: str, required: bool = True)
| 205 | |
| 206 | |
| 207 | def get_env(key: str, required: bool = True) -> Optional[str]: |
| 208 | """Get environment variable with optional requirement check""" |
| 209 | value = os.getenv(key) |
| 210 | if required and not value: |
| 211 | print(f"Error: {key} environment variable is required") |
| 212 | sys.exit(1) |
| 213 | return value |
| 214 | |
| 215 | |
| 216 | def load_prompt(name: str) -> str: |
no outgoing calls
no test coverage detected