langsmith 0.8.3 → 0.8.4

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.
Files changed (38) hide show
  1. package/dist/_openapi_client/client.cjs +9 -1
  2. package/dist/_openapi_client/client.d.ts +5 -2
  3. package/dist/_openapi_client/client.js +9 -1
  4. package/dist/_openapi_client/resources/datasets/experiment-runs.d.ts +2 -2
  5. package/dist/_openapi_client/resources/index.cjs +4 -2
  6. package/dist/_openapi_client/resources/index.d.ts +2 -1
  7. package/dist/_openapi_client/resources/index.js +2 -1
  8. package/dist/_openapi_client/resources/issues.d.ts +7 -1
  9. package/dist/_openapi_client/resources/public/public.cjs +54 -0
  10. package/dist/_openapi_client/resources/public/public.d.ts +9 -0
  11. package/dist/_openapi_client/resources/public/public.js +17 -0
  12. package/dist/_openapi_client/resources/public/runs.cjs +56 -0
  13. package/dist/_openapi_client/resources/public/runs.d.ts +76 -0
  14. package/dist/_openapi_client/resources/public/runs.js +52 -0
  15. package/dist/_openapi_client/resources/runs/index.cjs +9 -0
  16. package/dist/_openapi_client/resources/runs/index.d.ts +2 -0
  17. package/dist/_openapi_client/resources/runs/index.js +4 -0
  18. package/dist/_openapi_client/resources/runs/runs.cjs +128 -0
  19. package/dist/_openapi_client/resources/runs/runs.d.ts +854 -0
  20. package/dist/_openapi_client/resources/runs/runs.js +91 -0
  21. package/dist/_openapi_client/resources/runs/share.cjs +42 -0
  22. package/dist/_openapi_client/resources/runs/share.d.ts +50 -0
  23. package/dist/_openapi_client/resources/runs/share.js +38 -0
  24. package/dist/_openapi_client/resources/runs.cjs +15 -69
  25. package/dist/_openapi_client/resources/runs.d.ts +1 -820
  26. package/dist/_openapi_client/resources/runs.js +1 -67
  27. package/dist/_openapi_client/resources/traces.d.ts +2 -2
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +1 -1
  31. package/dist/run_trees.cjs +8 -0
  32. package/dist/run_trees.js +8 -0
  33. package/dist/utils/constants.cjs +1 -1
  34. package/dist/utils/constants.d.ts +1 -1
  35. package/dist/utils/constants.js +1 -1
  36. package/dist/wrappers/openai.cjs +6 -0
  37. package/dist/wrappers/openai.js +6 -0
  38. package/package.json +6 -2
@@ -0,0 +1,91 @@
1
+ // @ts-nocheck
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ import { APIResource } from '../../core/resource.js';
4
+ import * as ShareAPI from './share.js';
5
+ import { Share } from './share.js';
6
+ import { ItemsCursorPostPagination, } from '../../core/pagination.js';
7
+ import { buildHeaders } from '../../internal/headers.js';
8
+ import { path } from '../../internal/utils/path.js';
9
+ export class Runs extends APIResource {
10
+ constructor() {
11
+ super(...arguments);
12
+ Object.defineProperty(this, "share", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: new ShareAPI.Share(this._client)
17
+ });
18
+ Object.defineProperty(this, "retrieve", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: this.retrieveV2
23
+ });
24
+ Object.defineProperty(this, "query", {
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true,
28
+ value: this.queryV2
29
+ });
30
+ }
31
+ /**
32
+ * Returns the URL to view a specific run in the LangSmith UI. The caller must
33
+ * supply the run's project_id and trace_id as query parameters; start_time is
34
+ * optional.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const response = await client.runs.getURL(
39
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
40
+ * { project_id: 'project_id', trace_id: 'trace_id' },
41
+ * );
42
+ * ```
43
+ */
44
+ getURL(runID, query, options) {
45
+ return this._client.get(path `/v2/runs/${runID}/url`, { query, ...options });
46
+ }
47
+ /**
48
+ * **Alpha:** The request and response contract may change; Returns a paginated
49
+ * list of runs for the given projects within min/max start_time. Supports filters,
50
+ * cursor pagination, and `selects` to select fields to return.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * // Automatically fetches more pages as needed.
55
+ * for await (const run of client.runs.queryV2()) {
56
+ * // ...
57
+ * }
58
+ * ```
59
+ */
60
+ queryV2(params, options) {
61
+ const { Accept, ...body } = params;
62
+ return this._client.getAPIList('/v2/runs/query', (ItemsCursorPostPagination), {
63
+ body,
64
+ method: 'post',
65
+ ...options,
66
+ headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
67
+ });
68
+ }
69
+ /**
70
+ * **Alpha:** The request and response contract may change; Returns one run by ID
71
+ * for the given session. Use the `selects` query parameter (repeatable) to select
72
+ * fields to return.
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * const run = await client.runs.retrieveV2(
77
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
78
+ * { project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
79
+ * );
80
+ * ```
81
+ */
82
+ retrieveV2(runID, params, options) {
83
+ const { Accept, ...query } = params;
84
+ return this._client.get(path `/v2/runs/${runID}`, {
85
+ query,
86
+ ...options,
87
+ headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
88
+ });
89
+ }
90
+ }
91
+ Runs.Share = Share;
@@ -0,0 +1,42 @@
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.Share = void 0;
6
+ const resource_js_1 = require("../../core/resource.cjs");
7
+ const headers_js_1 = require("../../internal/headers.cjs");
8
+ const path_js_1 = require("../../internal/utils/path.cjs");
9
+ class Share extends resource_js_1.APIResource {
10
+ /**
11
+ * Creates or returns a share token for a run. Child runs share their trace root.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const share = await client.runs.share.create(
16
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
17
+ * );
18
+ * ```
19
+ */
20
+ create(runID, body, options) {
21
+ return this._client.post((0, path_js_1.path) `/v2/runs/${runID}/share`, { body, ...options });
22
+ }
23
+ /**
24
+ * Deletes the share token for the trace identified by trace_id and session_id.
25
+ * Idempotent: returns 204 whether or not a share token existed.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * await client.runs.share.delete(
30
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
31
+ * );
32
+ * ```
33
+ */
34
+ delete(traceID, body, options) {
35
+ return this._client.delete((0, path_js_1.path) `/v2/runs/${traceID}/share`, {
36
+ body,
37
+ ...options,
38
+ headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
39
+ });
40
+ }
41
+ }
42
+ exports.Share = Share;
@@ -0,0 +1,50 @@
1
+ import { APIResource } from '../../core/resource.js';
2
+ import { APIPromise } from '../../core/api-promise.js';
3
+ import { RequestOptions } from '../../internal/request-options.js';
4
+ export declare class Share extends APIResource {
5
+ /**
6
+ * Creates or returns a share token for a run. Child runs share their trace root.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const share = await client.runs.share.create(
11
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
12
+ * );
13
+ * ```
14
+ */
15
+ create(runID: string, body: ShareCreateParams, options?: RequestOptions): APIPromise<ShareCreateResponse>;
16
+ /**
17
+ * Deletes the share token for the trace identified by trace_id and session_id.
18
+ * Idempotent: returns 204 whether or not a share token existed.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * await client.runs.share.delete(
23
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
24
+ * );
25
+ * ```
26
+ */
27
+ delete(traceID: string, body: ShareDeleteParams, options?: RequestOptions): APIPromise<void>;
28
+ }
29
+ export interface ShareCreateResponse {
30
+ share_token?: string;
31
+ }
32
+ export interface ShareCreateParams {
33
+ /**
34
+ * session_id is the tracing project UUID containing the trace.
35
+ */
36
+ session_id?: string;
37
+ /**
38
+ * trace_id is the root trace UUID to share.
39
+ */
40
+ trace_id?: string;
41
+ }
42
+ export interface ShareDeleteParams {
43
+ /**
44
+ * session_id is the tracing project UUID containing the trace.
45
+ */
46
+ session_id?: string;
47
+ }
48
+ export declare namespace Share {
49
+ export { type ShareCreateResponse as ShareCreateResponse, type ShareCreateParams as ShareCreateParams, type ShareDeleteParams as ShareDeleteParams, };
50
+ }
@@ -0,0 +1,38 @@
1
+ // @ts-nocheck
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ import { APIResource } from '../../core/resource.js';
4
+ import { buildHeaders } from '../../internal/headers.js';
5
+ import { path } from '../../internal/utils/path.js';
6
+ export class Share extends APIResource {
7
+ /**
8
+ * Creates or returns a share token for a run. Child runs share their trace root.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const share = await client.runs.share.create(
13
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
14
+ * );
15
+ * ```
16
+ */
17
+ create(runID, body, options) {
18
+ return this._client.post(path `/v2/runs/${runID}/share`, { body, ...options });
19
+ }
20
+ /**
21
+ * Deletes the share token for the trace identified by trace_id and session_id.
22
+ * Idempotent: returns 204 whether or not a share token existed.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * await client.runs.share.delete(
27
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
28
+ * );
29
+ * ```
30
+ */
31
+ delete(traceID, body, options) {
32
+ return this._client.delete(path `/v2/runs/${traceID}/share`, {
33
+ body,
34
+ ...options,
35
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
36
+ });
37
+ }
38
+ }
@@ -1,73 +1,19 @@
1
1
  "use strict";
2
2
  // @ts-nocheck
3
3
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Runs = void 0;
6
- const resource_js_1 = require("../core/resource.cjs");
7
- const pagination_js_1 = require("../core/pagination.cjs");
8
- const headers_js_1 = require("../internal/headers.cjs");
9
- const path_js_1 = require("../internal/utils/path.cjs");
10
- class Runs extends resource_js_1.APIResource {
11
- constructor() {
12
- super(...arguments);
13
- Object.defineProperty(this, "retrieve", {
14
- enumerable: true,
15
- configurable: true,
16
- writable: true,
17
- value: this.retrieveV2
18
- });
19
- Object.defineProperty(this, "query", {
20
- enumerable: true,
21
- configurable: true,
22
- writable: true,
23
- value: this.queryV2
24
- });
25
- }
26
- /**
27
- * **Alpha:** The request and response contract may change; Returns a paginated
28
- * list of runs for the given projects within min/max start_time. Supports filters,
29
- * cursor pagination, and `selects` to select fields to return.
30
- *
31
- * @example
32
- * ```ts
33
- * // Automatically fetches more pages as needed.
34
- * for await (const run of client.runs.queryV2()) {
35
- * // ...
36
- * }
37
- * ```
38
- */
39
- queryV2(params, options) {
40
- const { Accept, ...body } = params;
41
- return this._client.getAPIList('/v2/runs/query', (pagination_js_1.ItemsCursorPostPagination), {
42
- body,
43
- method: 'post',
44
- ...options,
45
- headers: (0, headers_js_1.buildHeaders)([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
46
- });
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
47
9
  }
48
- /**
49
- * **Alpha:** The request and response contract may change; Returns one run by ID
50
- * for the given session and start_time. Use the `selects` query parameter
51
- * (repeatable) to select fields to return.
52
- *
53
- * @example
54
- * ```ts
55
- * const run = await client.runs.retrieveV2(
56
- * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
57
- * {
58
- * project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
59
- * start_time: '2019-12-27T18:11:19.117Z',
60
- * },
61
- * );
62
- * ```
63
- */
64
- retrieveV2(runID, params, options) {
65
- const { Accept, ...query } = params;
66
- return this._client.get((0, path_js_1.path) `/v2/runs/${runID}`, {
67
- query,
68
- ...options,
69
- headers: (0, headers_js_1.buildHeaders)([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
70
- });
71
- }
72
- }
73
- exports.Runs = Runs;
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ __exportStar(require("./runs/index.cjs"), exports);