INNER CODE UNIT · Python

_require_local_skill_installer_enabled

wzn1118/AsteriaAnalyst · backend/app/main.py:163

def _require_local_skill_installer_enabled() -> None:
    enabled = str(os.getenv("ASTERIA_ENABLE_LOCAL_SKILL_INSTALLER", "")).strip().lower()
    if enabled in {"1", "true", "yes", "on"}:
        return
    raise HTTPException(
        status_code=403,
        detail={
            "code": "SKILL_INSTALLATION_DISABLED",
            "message": (
                "Lab skill installation and execution are disabled. "
                "Set ASTERIA_ENABLE_LOCAL_SKILL_INSTALLER=1 to enable them."
            ),
        },
    )


def _safe_export_segment(value: str, fallback: str = "default") -> str:
    segment = re.sub(r"[^A-Za-z0-9._-]+", "-", str(value or "").strip()).strip(".-")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…