Create and initialize a new ModalSandbox in one step.
This is the recommended way to create a sandbox. It combines construction and initialization into a single async operation.
create(options: ModalSandboxOptions): Promise<ModalSandbox>| Name | Type | Description |
|---|---|---|
options | ModalSandboxOptions | Configuration options for the sandbox |
const sandbox = await ModalSandbox.create({
imageName: "python:3.12-slim",
timeout: 600,
memory: 2048,
});