constructor(options: ModalSandboxOptions = {}): ModalSandbox| Name | Type | Description |
|---|---|---|
options | ModalSandboxOptions | Default: {}Configuration options for the sandbox |
// Two-step initialization
const sandbox = new ModalSandbox({ imageName: "python:3.12-slim" });
await sandbox.initialize();
// Or use the factory method
const sandbox = await ModalSandbox.create({ imageName: "python:3.12-slim" });Create a new ModalSandbox instance.
Note: This only creates the instance. Call initialize() to actually
create the Modal Sandbox, or use the static ModalSandbox.create() method.