LoadFromEnv reads CHATCLI_QUALITY_* overrides on top of Defaults(). All variables are optional. Unset → default applies. Boolean parsing accepts: 1/0, true/false, yes/no, on/off (case-insensitive).
()
| 224 | // All variables are optional. Unset → default applies. Boolean parsing |
| 225 | // accepts: 1/0, true/false, yes/no, on/off (case-insensitive). |
| 226 | func LoadFromEnv() Config { |
| 227 | cfg := Defaults() |
| 228 | if v := os.Getenv("CHATCLI_QUALITY_ENABLED"); v != "" { |
| 229 | cfg.Enabled = parseBool(v, cfg.Enabled) |
| 230 | } |
| 231 | loadRefineEnv(&cfg.Refine) |
| 232 | loadVerifyEnv(&cfg.Verify) |
| 233 | loadReflexionEnv(&cfg.Reflexion) |
| 234 | loadPlanFirstEnv(&cfg.PlanFirst) |
| 235 | loadHyDEEnv(&cfg.HyDE) |
| 236 | loadReasoningEnv(&cfg.Reasoning) |
| 237 | return cfg |
| 238 | } |
| 239 | |
| 240 | func loadRefineEnv(c *RefineConfig) { |
| 241 | if v := os.Getenv("CHATCLI_QUALITY_REFINE_ENABLED"); v != "" { |