LangSmith Sandbox Module.
This module provides sandboxed code execution capabilities through the LangSmith Sandbox API.
import { SandboxClient } from "langsmith/experimental/sandbox";// Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environmentconst client = new SandboxClient();const sandbox = await client.createSandbox("python-sandbox");try { const result = await sandbox.run("python --version"); console.log(result.stdout);} finally { await sandbox.delete();} Copy
import { SandboxClient } from "langsmith/experimental/sandbox";// Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environmentconst client = new SandboxClient();const sandbox = await client.createSandbox("python-sandbox");try { const result = await sandbox.run("python --version"); console.log(result.stdout);} finally { await sandbox.delete();}
LangSmith Sandbox Module.
This module provides sandboxed code execution capabilities through the LangSmith Sandbox API.
Example