langsmith
Version:
Client library to connect to the LangSmith Observability and Evaluation Platform.
36 lines (35 loc) • 1.28 kB
JavaScript
// @ts-nocheck
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource.js';
import { buildHeaders } from '../../internal/headers.js';
import { path } from '../../internal/utils/path.js';
export class Snapshots extends APIResource {
/**
* Create a snapshot from a Docker image (async build).
*/
create(body, options) {
return this._client.post('/v2/sandboxes/snapshots', { body, ...options });
}
/**
* Get a sandbox snapshot by ID.
*/
retrieve(snapshotID, options) {
return this._client.get(path `/v2/sandboxes/snapshots/${snapshotID}`, options);
}
/**
* List sandbox snapshots for the authenticated tenant, with optional filtering,
* sorting, and pagination.
*/
list(query = {}, options) {
return this._client.get('/v2/sandboxes/snapshots', { query, ...options });
}
/**
* Delete a snapshot by ID. The underlying storage is reclaimed asynchronously.
*/
delete(snapshotID, options) {
return this._client.delete(path `/v2/sandboxes/snapshots/${snapshotID}`, {
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
}