Create and return a new LangSmithSandbox in one step.
This is the recommended way to create a sandbox — no need to import
anything from langsmith/experimental/sandbox directly.
create(options: LangSmithSandboxCreateOptions): Promise<LangSmithSandbox>| Name | Type | Description |
|---|---|---|
options* | LangSmithSandboxCreateOptions |
const sandbox = await LangSmithSandbox.create({
snapshotId: "abc-123",
});
try {
const agent = createDeepAgent({ model, backend: sandbox });
await agent.invoke({ messages: [...] });
} finally {
await sandbox.close();
}