INNER CODE UNIT · Python

resolve_storage_root

kaito-project/kaito · presets/ragengine/main.py:107

def resolve_storage_root() -> Path:
    configured_root = Path(DEFAULT_VECTOR_DB_PERSIST_DIR)
    resolved_root = configured_root.resolve()

    if DEFAULT_VECTOR_DB_PERSIST_DIR == "storage":
        expected_root = Path.cwd() / "storage"
        if resolved_root == expected_root:
            return resolved_root
    elif configured_root.is_absolute() and ".." not in configured_root.parts:
        resolved_mount_root = Path("/mnt").resolve()
        try:
            relative_path = resolved_root.relative_to(resolved_mount_root)
            if relative_path.parts:
                return resolved_root
        except ValueError:
            pass

    raise HTTPException(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…