env
Environment variable helpers.
This module provides small, centralized parsing helpers for environment variables.
- exception pipecat.utils.env.InvalidEnvVarValueError(name: str, value: str, expected: str)[source]
Bases:
ValueErrorRaised when an environment variable value cannot be parsed.
- pipecat.utils.env.env_truthy(name: str, default: bool = False) bool[source]
Interpret an environment variable as a boolean.
If the variable is not set, returns default.
If the variable is set to a recognized boolean string, returns the parsed value.
Otherwise, raises InvalidEnvVarValueError.
Recognized values (case-insensitive, whitespace ignored): - Truthy: “1”, “true”, “yes”, “y”, “on” - Falsy: “0”, “false”, “no”, “n”, “off”, “”