Consolidate on ALWRITY_ENABLED_FEATURES - remove all legacy support
Backend: - Remove all legacy env var fallbacks (ALWRITY_FEATURE_PROFILE, ALWRITY_ROUTER_PROFILE, etc) - Remove get_active_profile() from start_alwrity_backend.py - Remove _env_flag_enabled() from app.py - Use ALWRITY_ENABLED_FEATURES as single source of truth Frontend: - demoMode.ts now uses only REACT_APP_ENABLED_FEATURES - Removed all legacy fallback keys (app_mode, demo_mode, podcast_only_demo_mode) Usage: ALWRITY_ENABLED_FEATURES=podcast # Podcast only ALWRITY_ENABLED_FEATURES=all # All features (default)
This commit is contained in:
@@ -33,8 +33,6 @@ def get_enabled_features() -> set:
|
||||
- "all" - enable all features (default)
|
||||
- comma-separated: "podcast,blog-writer,youtube"
|
||||
- single feature: "podcast"
|
||||
|
||||
DEPRECATED: ALWRITY_FEATURE_PROFILE, ALWRITY_ROUTER_PROFILE, ALWRITY_FEATURE_TO_ENABLE
|
||||
"""
|
||||
env_value = os.getenv("ALWRITY_ENABLED_FEATURES", "all").strip().lower()
|
||||
|
||||
@@ -44,14 +42,6 @@ def get_enabled_features() -> set:
|
||||
return {f.strip() for f in env_value.split(",") if f.strip()}
|
||||
|
||||
|
||||
def get_active_profile() -> str:
|
||||
"""Legacy function - use get_enabled_features() instead."""
|
||||
enabled = get_enabled_features()
|
||||
if "all" in enabled:
|
||||
return "all"
|
||||
return list(enabled)[0] if enabled else "all"
|
||||
|
||||
|
||||
def should_bootstrap_linguistic_models() -> bool:
|
||||
"""Decide whether to bootstrap linguistic models based on enabled features."""
|
||||
enabled_features = get_enabled_features()
|
||||
@@ -220,10 +210,11 @@ def bootstrap_local_llm_models() -> BootstrapResult:
|
||||
BOOTSTRAP_RESULTS = []
|
||||
|
||||
if __name__ == "__main__":
|
||||
profile = get_active_profile()
|
||||
os.environ["ALWRITY_ACTIVE_PROFILE"] = profile
|
||||
enabled_features = get_enabled_features()
|
||||
features_str = ",".join(sorted(enabled_features))
|
||||
os.environ["ALWRITY_ENABLED_FEATURES"] = features_str
|
||||
|
||||
print(f"\n📋 Active profile: {profile}")
|
||||
print(f"\n📋 Enabled features: {features_str}")
|
||||
|
||||
if should_bootstrap_linguistic_models():
|
||||
result = bootstrap_linguistic_models()
|
||||
@@ -240,11 +231,11 @@ if __name__ == "__main__":
|
||||
else:
|
||||
verbose = os.getenv("ALWRITY_VERBOSE", "false").lower() == "true"
|
||||
if verbose:
|
||||
print("⏭️ Skipping local LLM model bootstrap (profile-gated)")
|
||||
BOOTSTRAP_RESULTS.append(BootstrapResult(name="local_llm_models", success=True, skipped=True, reason="profile_gated"))
|
||||
print("⏭️ Skipping local LLM model bootstrap (feature-gated)")
|
||||
BOOTSTRAP_RESULTS.append(BootstrapResult(name="local_llm_models", success=True, skipped=True, reason="feature_gated"))
|
||||
|
||||
summary = {
|
||||
"active_profile": profile,
|
||||
"enabled_features": features_str,
|
||||
"bootstraps": [asdict(r) for r in BOOTSTRAP_RESULTS]
|
||||
}
|
||||
os.environ["ALWRITY_BOOTSTRAP_SUMMARY"] = json.dumps(summary)
|
||||
|
||||
Reference in New Issue
Block a user