Skip to content

AutoDiscovery Modal API Reference

Modal-adjacent helpers for running code execution workloads.

build_sandbox_image(extra_packages=None, *, python_version='3.13')

Build a Modal image for IPython-based execution.

Thin wrapper around build_modal_ephemeral_image from asta_sandbox.

Parameters:

Name Type Description Default
extra_packages Iterable[str] | None

Optional additional packages to install.

None
python_version str

Python version for the base image.

'3.13'

Returns:

Type Description
Image

A Modal image with IPython and asta_sandbox sources.

Source code in packages/autodiscovery_modal/src/autodiscovery_modal/ipython_session.py
def build_sandbox_image(
    extra_packages: Iterable[str] | None = None,
    *,
    python_version: str = "3.13",
) -> modal.Image:
    """Build a Modal image for IPython-based execution.

    Thin wrapper around build_modal_ephemeral_image from asta_sandbox.

    Args:
        extra_packages: Optional additional packages to install.
        python_version: Python version for the base image.

    Returns:
        A Modal image with IPython and asta_sandbox sources.
    """
    return build_modal_ephemeral_image(
        extra_packages=list(extra_packages) if extra_packages else None,
        python_version=python_version,
    )