import { Sandbox, Template } from "@superserve/sdk"
// Create the template first (see the section above)
const template = await Template.create({
name: "my-python-env",
from: "python:3.11",
})
await template.waitUntilReady()
// Option 1: pass the Template instance
const sandbox = await Sandbox.create({
name: "run-1",
fromTemplate: template,
})
// Option 2: pass the name
const sandbox2 = await Sandbox.create({
name: "run-2",
fromTemplate: "my-python-env",
})
// Option 3: pass the ID
const sandbox3 = await Sandbox.create({
name: "run-3",
fromTemplate: "8b050452",
})