langsmith
Version:
Client library to connect to the LangSmith Observability and Evaluation Platform.
35 lines (34 loc) • 1.82 kB
TypeScript
/**
* LangSmith Sandbox Module.
*
* This module provides sandboxed code execution capabilities through the
* LangSmith Sandbox API.
*
* @example
* ```typescript
* import { SandboxClient } from "langsmith/sandbox";
*
* // Uses LANGSMITH_ENDPOINT and LANGSMITH_API_KEY from environment
* const client = new SandboxClient();
*
* const snapshot = await client.createSnapshot(
* "python",
* "python:3.12-slim",
* 1_073_741_824
* );
* const sandbox = await client.createSandbox(snapshot.id);
* try {
* const result = await sandbox.run("python --version");
* console.log(result.stdout);
* } finally {
* await sandbox.delete();
* }
* ```
*
* @packageDocumentation
*/
export { SandboxClient } from "./client.js";
export { Sandbox } from "./sandbox.js";
export { CommandHandle } from "./command_handle.js";
export type { ExecutionResult, OutputChunk, WsMessage, WsRunOptions, ResourceStatus, Snapshot, SandboxData, SandboxClientConfig, RunOptions, CreateSandboxOptions, SandboxAccessControl, SandboxProxyConfig, CreateSnapshotOptions, CaptureSnapshotOptions, ListSnapshotsOptions, WaitForSnapshotOptions, StartSandboxOptions, UpdateSandboxOptions, WaitForSandboxOptions, } from "./types.js";
export { LangSmithSandboxError, LangSmithSandboxAPIError, LangSmithSandboxAuthenticationError, LangSmithSandboxConnectionError, LangSmithSandboxServerReloadError, LangSmithResourceNotFoundError, LangSmithResourceTimeoutError, LangSmithResourceInUseError, LangSmithResourceAlreadyExistsError, LangSmithResourceNameConflictError, LangSmithValidationError, LangSmithQuotaExceededError, LangSmithResourceCreationError, LangSmithSandboxCreationError, LangSmithSandboxNotReadyError, LangSmithSandboxOperationError, LangSmithCommandTimeoutError, LangSmithDataplaneNotConfiguredError, } from "./errors.js";