langsmith 0.7.15 → 0.7.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_openapi_client/client.cjs +17 -9
- package/dist/_openapi_client/client.d.ts +9 -6
- package/dist/_openapi_client/client.js +17 -9
- package/dist/_openapi_client/resources/datasets/datasets.cjs +0 -130
- package/dist/_openapi_client/resources/datasets/datasets.d.ts +3 -271
- package/dist/_openapi_client/resources/datasets/datasets.js +0 -130
- package/dist/_openapi_client/resources/datasets/experiment-runs.cjs +1 -1
- package/dist/_openapi_client/resources/datasets/experiment-runs.d.ts +8 -8
- package/dist/_openapi_client/resources/datasets/experiment-runs.js +1 -1
- package/dist/_openapi_client/resources/index.cjs +6 -4
- package/dist/_openapi_client/resources/index.d.ts +4 -3
- package/dist/_openapi_client/resources/index.js +3 -2
- package/dist/_openapi_client/resources/runs.cjs +69 -15
- package/dist/_openapi_client/resources/runs.d.ts +815 -1
- package/dist/_openapi_client/resources/runs.js +67 -1
- package/dist/_openapi_client/resources/threads.cjs +65 -0
- package/dist/_openapi_client/resources/threads.d.ts +654 -0
- package/dist/_openapi_client/resources/threads.js +61 -0
- package/dist/_openapi_client/resources/traces.cjs +61 -0
- package/dist/_openapi_client/resources/traces.d.ts +162 -0
- package/dist/_openapi_client/resources/traces.js +57 -0
- package/dist/client.cjs +1 -5
- package/dist/client.d.ts +2 -5
- package/dist/client.js +1 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/wrappers/anthropic.cjs +38 -25
- package/dist/wrappers/anthropic.d.ts +10 -1
- package/dist/wrappers/anthropic.js +38 -25
- package/dist/wrappers/utils/anthropic_managed.cjs +648 -0
- package/dist/wrappers/utils/anthropic_managed.d.ts +7 -0
- package/dist/wrappers/utils/anthropic_managed.js +645 -0
- package/package.json +1 -1
- package/dist/_openapi_client/resources/datasets/comparative.cjs +0 -22
- package/dist/_openapi_client/resources/datasets/comparative.d.ts +0 -55
- package/dist/_openapi_client/resources/datasets/comparative.js +0 -18
- package/dist/_openapi_client/resources/datasets/runs.cjs +0 -22
- package/dist/_openapi_client/resources/datasets/runs.d.ts +0 -175
- package/dist/_openapi_client/resources/datasets/runs.js +0 -18
- package/dist/_openapi_client/resources/datasets/share.cjs +0 -32
- package/dist/_openapi_client/resources/datasets/share.d.ts +0 -28
- package/dist/_openapi_client/resources/datasets/share.js +0 -28
- package/dist/_openapi_client/resources/datasets/splits.cjs +0 -22
- package/dist/_openapi_client/resources/datasets/splits.d.ts +0 -30
- package/dist/_openapi_client/resources/datasets/splits.js +0 -18
- package/dist/_openapi_client/resources/datasets/versions.cjs +0 -23
- package/dist/_openapi_client/resources/datasets/versions.d.ts +0 -36
- package/dist/_openapi_client/resources/datasets/versions.js +0 -19
- package/dist/_openapi_client/resources/runs/index.cjs +0 -9
- package/dist/_openapi_client/resources/runs/index.d.ts +0 -2
- package/dist/_openapi_client/resources/runs/index.js +0 -4
- package/dist/_openapi_client/resources/runs/rules.cjs +0 -9
- package/dist/_openapi_client/resources/runs/rules.d.ts +0 -3
- package/dist/_openapi_client/resources/runs/rules.js +0 -5
- package/dist/_openapi_client/resources/runs/runs.cjs +0 -115
- package/dist/_openapi_client/resources/runs/runs.d.ts +0 -800
- package/dist/_openapi_client/resources/runs/runs.js +0 -78
- package/dist/_openapi_client/resources/sessions.cjs +0 -53
- package/dist/_openapi_client/resources/sessions.d.ts +0 -636
- package/dist/_openapi_client/resources/sessions.js +0 -49
|
@@ -1,3 +1,69 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
|
|
3
|
+
import { APIResource } from '../core/resource.js';
|
|
4
|
+
import { ItemsCursorPostPagination, } from '../core/pagination.js';
|
|
5
|
+
import { buildHeaders } from '../internal/headers.js';
|
|
6
|
+
import { path } from '../internal/utils/path.js';
|
|
7
|
+
export class Runs extends APIResource {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
Object.defineProperty(this, "retrieve", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: this.retrieveV2
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(this, "query", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: this.queryV2
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* **Alpha:** The request and response contract may change; Returns a paginated
|
|
25
|
+
* list of runs for the given projects within min/max start_time. Supports filters,
|
|
26
|
+
* cursor pagination, and `selects` to select fields to return.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* // Automatically fetches more pages as needed.
|
|
31
|
+
* for await (const run of client.runs.queryV2()) {
|
|
32
|
+
* // ...
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
queryV2(params, options) {
|
|
37
|
+
const { Accept, ...body } = params;
|
|
38
|
+
return this._client.getAPIList('/v2/runs/query', (ItemsCursorPostPagination), {
|
|
39
|
+
body,
|
|
40
|
+
method: 'post',
|
|
41
|
+
...options,
|
|
42
|
+
headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* **Alpha:** The request and response contract may change; Returns one run by ID
|
|
47
|
+
* for the given session and start_time. Use the `selects` query parameter
|
|
48
|
+
* (repeatable) to select fields to return.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const run = await client.runs.retrieveV2(
|
|
53
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
54
|
+
* {
|
|
55
|
+
* project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
56
|
+
* start_time: '2019-12-27T18:11:19.117Z',
|
|
57
|
+
* },
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
retrieveV2(runID, params, options) {
|
|
62
|
+
const { Accept, ...query } = params;
|
|
63
|
+
return this._client.get(path `/v2/runs/${runID}`, {
|
|
64
|
+
query,
|
|
65
|
+
...options,
|
|
66
|
+
headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Threads = void 0;
|
|
6
|
+
const resource_js_1 = require("../core/resource.cjs");
|
|
7
|
+
const pagination_js_1 = require("../core/pagination.cjs");
|
|
8
|
+
const path_js_1 = require("../internal/utils/path.cjs");
|
|
9
|
+
class Threads extends resource_js_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* **Alpha:** The request and response contract may change; Retrieve all traces
|
|
12
|
+
* belonging to a specific thread within a project.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Automatically fetches more pages as needed.
|
|
17
|
+
* for await (const threadTraceListItem of client.threads.listTraces(
|
|
18
|
+
* 'thread_id',
|
|
19
|
+
* { project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
|
|
20
|
+
* )) {
|
|
21
|
+
* // ...
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
listTraces(threadID, query, options) {
|
|
26
|
+
return this._client.getAPIList((0, path_js_1.path) `/v2/threads/${threadID}/traces`, (pagination_js_1.ItemsCursorGetPagination), { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* **Alpha:** The request and response contract may change; Query threads within a
|
|
30
|
+
* project (session), with cursor-based pagination. Returns threads matching the
|
|
31
|
+
* given time range and optional filter.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Automatically fetches more pages as needed.
|
|
36
|
+
* for await (const threadListItem of client.threads.query()) {
|
|
37
|
+
* // ...
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
query(body, options) {
|
|
42
|
+
return this._client.getAPIList('/v2/threads/query', (pagination_js_1.ItemsCursorPostPagination), {
|
|
43
|
+
body,
|
|
44
|
+
method: 'post',
|
|
45
|
+
...options,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* **Alpha:** The request and response contract may change; Compute aggregate stats
|
|
50
|
+
* for a single thread (turn count, latency percentiles, token/cost sums, and
|
|
51
|
+
* detail breakdowns) within a project.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const response = await client.threads.stats('thread_id', {
|
|
56
|
+
* selects: ['TURNS'],
|
|
57
|
+
* session_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
stats(threadID, query, options) {
|
|
62
|
+
return this._client.get((0, path_js_1.path) `/v2/threads/${threadID}/stats`, { query, ...options });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Threads = Threads;
|