langsmith 0.8.3 → 0.8.5

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 (57) 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/client.cjs +47 -7
  29. package/dist/client.d.ts +17 -2
  30. package/dist/client.js +47 -7
  31. package/dist/evaluation/_runner.cjs +13 -2
  32. package/dist/evaluation/_runner.js +13 -2
  33. package/dist/evaluation/evaluate_comparative.cjs +14 -6
  34. package/dist/evaluation/evaluate_comparative.d.ts +4 -1
  35. package/dist/evaluation/evaluate_comparative.js +13 -6
  36. package/dist/index.cjs +3 -2
  37. package/dist/index.d.ts +3 -3
  38. package/dist/index.js +2 -2
  39. package/dist/run_trees.cjs +38 -10
  40. package/dist/run_trees.d.ts +3 -1
  41. package/dist/run_trees.js +38 -10
  42. package/dist/utils/constants.cjs +1 -1
  43. package/dist/utils/constants.d.ts +1 -1
  44. package/dist/utils/constants.js +1 -1
  45. package/dist/utils/jestlike/globals.cjs +11 -3
  46. package/dist/utils/jestlike/globals.js +11 -3
  47. package/dist/utils/jestlike/index.cjs +3 -0
  48. package/dist/utils/jestlike/index.js +3 -0
  49. package/dist/utils/v2_migration.cjs +56 -0
  50. package/dist/utils/v2_migration.d.ts +7 -0
  51. package/dist/utils/v2_migration.js +52 -0
  52. package/dist/uuid.cjs +22 -2
  53. package/dist/uuid.d.ts +8 -0
  54. package/dist/uuid.js +19 -0
  55. package/dist/wrappers/openai.cjs +6 -0
  56. package/dist/wrappers/openai.js +6 -0
  57. package/package.json +6 -2
@@ -65,10 +65,11 @@ const api_promise_js_1 = require("./core/api-promise.cjs");
65
65
  const info_js_1 = require("./resources/info.cjs");
66
66
  const issues_js_1 = require("./resources/issues.cjs");
67
67
  const online_evaluators_js_1 = require("./resources/online-evaluators.cjs");
68
- const runs_js_1 = require("./resources/runs.cjs");
69
68
  const threads_js_1 = require("./resources/threads.cjs");
70
69
  const traces_js_1 = require("./resources/traces.cjs");
71
70
  const datasets_js_1 = require("./resources/datasets/datasets.cjs");
71
+ const public_js_1 = require("./resources/public/public.cjs");
72
+ const runs_js_1 = require("./resources/runs/runs.cjs");
72
73
  const sandboxes_js_1 = require("./resources/sandboxes/sandboxes.cjs");
73
74
  const headers_js_1 = require("./internal/headers.cjs");
74
75
  const env_js_1 = require("./internal/utils/env.cjs");
@@ -190,6 +191,12 @@ class Langsmith {
190
191
  writable: true,
191
192
  value: new API.OnlineEvaluators(this)
192
193
  });
194
+ Object.defineProperty(this, "public", {
195
+ enumerable: true,
196
+ configurable: true,
197
+ writable: true,
198
+ value: new API.Public(this)
199
+ });
193
200
  Object.defineProperty(this, "info", {
194
201
  enumerable: true,
195
202
  configurable: true,
@@ -753,6 +760,7 @@ Langsmith.Runs = runs_js_1.Runs;
753
760
  Langsmith.Threads = threads_js_1.Threads;
754
761
  Langsmith.Traces = traces_js_1.Traces;
755
762
  Langsmith.OnlineEvaluators = online_evaluators_js_1.OnlineEvaluators;
763
+ Langsmith.Public = public_js_1.Public;
756
764
  Langsmith.Info = info_js_1.Info;
757
765
  Langsmith.Issues = issues_js_1.Issues;
758
766
  Langsmith.Sandboxes = sandboxes_js_1.Sandboxes;
@@ -11,10 +11,11 @@ import { APIPromise } from './core/api-promise.js';
11
11
  import { Info, InfoListResponse } from './resources/info.js';
12
12
  import { Issue, IssueListParams, Issues, IssuesOffsetPaginationIssues } from './resources/issues.js';
13
13
  import { BulkDeleteEvaluatorFailedItem, BulkDeleteEvaluatorsResponse, CreateOnlineCodeEvaluatorRequest, CreateOnlineEvaluatorRequest, CreateOnlineEvaluatorResponse, CreateOnlineLlmEvaluatorRequest, GetOnlineEvaluatorSpendResponse, OnlineCodeEvaluator, OnlineEvaluator, OnlineEvaluatorBulkDeleteParams, OnlineEvaluatorCreateParams, OnlineEvaluatorDeleteParams, OnlineEvaluatorListParams, OnlineEvaluatorRunRule, OnlineEvaluatorSpendDay, OnlineEvaluatorSpendGroup, OnlineEvaluatorSpendParams, OnlineEvaluatorType, OnlineEvaluatorUpdateParams, OnlineEvaluators, OnlineEvaluatorsOffsetPaginationOnlineEvaluators, OnlineLlmEvaluator, OnlineSpendLimit, UpdateOnlineCodeEvaluatorRequest, UpdateOnlineEvaluatorRequest, UpdateOnlineEvaluatorResponse, UpdateOnlineLlmEvaluatorRequest } from './resources/online-evaluators.js';
14
- import { ResponseBodyForRunsGenerateQuery, Run, RunIngest, RunQueryParams, RunQueryV2Params, RunRetrieveParams, RunRetrieveV2Params, RunSchema, RunStatsQueryParams, RunTypeEnum, Runs, RunsFilterDataSourceTypeEnum, RunsItemsCursorPostPagination } from './resources/runs.js';
15
14
  import { Thread, ThreadListTracesParams, ThreadQueryParams, ThreadStats, ThreadStatsParams, ThreadTrace, ThreadTracesItemsCursorGetPagination, Threads, ThreadsItemsCursorPostPagination } from './resources/threads.js';
16
15
  import { Trace, TraceAggregates, TraceListRunsParams, TraceListRunsResponse, TraceQueryParams, Traces, TracesItemsCursorPostPagination } from './resources/traces.js';
17
16
  import { DataType, Dataset, DatasetTransformation, DatasetVersion, Datasets, FeedbackCreateCoreSchema, Missing, SortByDatasetColumn } from './resources/datasets/datasets.js';
17
+ import { Public } from './resources/public/public.js';
18
+ import { ResponseBodyForRunsGenerateQuery, Run, RunGetURLParams, RunGetURLResponse, RunIngest, RunQueryParams, RunQueryV2Params, RunRetrieveParams, RunRetrieveV2Params, RunSchema, RunSelectField, RunStatsQueryParams, RunType, RunTypeEnum, Runs, RunsFilterDataSourceTypeEnum, RunsItemsCursorPostPagination } from './resources/runs/runs.js';
18
19
  import { SandboxListResponse, SandboxResponse, SandboxStatusResponse, Sandboxes, ServiceURLResponse, SnapshotListResponse, SnapshotResponse } from './resources/sandboxes/sandboxes.js';
19
20
  import { type Fetch } from './internal/builtin-types.js';
20
21
  import { HeadersLike, NullableHeaders } from './internal/headers.js';
@@ -193,6 +194,7 @@ export declare class Langsmith {
193
194
  threads: API.Threads;
194
195
  traces: API.Traces;
195
196
  onlineEvaluators: API.OnlineEvaluators;
197
+ public: API.Public;
196
198
  info: API.Info;
197
199
  issues: API.Issues;
198
200
  sandboxes: API.Sandboxes;
@@ -218,10 +220,11 @@ export declare namespace Langsmith {
218
220
  export import ItemsCursorGetPagination = Pagination.ItemsCursorGetPagination;
219
221
  export { type ItemsCursorGetPaginationParams as ItemsCursorGetPaginationParams, type ItemsCursorGetPaginationResponse as ItemsCursorGetPaginationResponse, };
220
222
  export { Datasets as Datasets, type DataType as DataType, type Dataset as Dataset, type DatasetTransformation as DatasetTransformation, type DatasetVersion as DatasetVersion, type FeedbackCreateCoreSchema as FeedbackCreateCoreSchema, type Missing as Missing, type SortByDatasetColumn as SortByDatasetColumn, };
221
- export { Runs as Runs, type ResponseBodyForRunsGenerateQuery as ResponseBodyForRunsGenerateQuery, type Run as Run, type RunIngest as RunIngest, type RunSchema as RunSchema, type RunStatsQueryParams as RunStatsQueryParams, type RunTypeEnum as RunTypeEnum, type RunsFilterDataSourceTypeEnum as RunsFilterDataSourceTypeEnum, type RunsItemsCursorPostPagination as RunsItemsCursorPostPagination, type RunQueryV2Params as RunQueryV2Params, type RunRetrieveV2Params as RunRetrieveV2Params, type RunRetrieveParams as RunRetrieveParams, type RunQueryParams as RunQueryParams, };
223
+ export { Runs as Runs, type ResponseBodyForRunsGenerateQuery as ResponseBodyForRunsGenerateQuery, type Run as Run, type RunIngest as RunIngest, type RunSchema as RunSchema, type RunSelectField as RunSelectField, type RunStatsQueryParams as RunStatsQueryParams, type RunType as RunType, type RunTypeEnum as RunTypeEnum, type RunsFilterDataSourceTypeEnum as RunsFilterDataSourceTypeEnum, type RunGetURLResponse as RunGetURLResponse, type RunsItemsCursorPostPagination as RunsItemsCursorPostPagination, type RunGetURLParams as RunGetURLParams, type RunQueryV2Params as RunQueryV2Params, type RunRetrieveV2Params as RunRetrieveV2Params, type RunRetrieveParams as RunRetrieveParams, type RunQueryParams as RunQueryParams, };
222
224
  export { Threads as Threads, type Thread as Thread, type ThreadStats as ThreadStats, type ThreadTrace as ThreadTrace, type ThreadTracesItemsCursorGetPagination as ThreadTracesItemsCursorGetPagination, type ThreadsItemsCursorPostPagination as ThreadsItemsCursorPostPagination, type ThreadListTracesParams as ThreadListTracesParams, type ThreadQueryParams as ThreadQueryParams, type ThreadStatsParams as ThreadStatsParams, };
223
225
  export { Traces as Traces, type Trace as Trace, type TraceAggregates as TraceAggregates, type TraceListRunsResponse as TraceListRunsResponse, type TracesItemsCursorPostPagination as TracesItemsCursorPostPagination, type TraceListRunsParams as TraceListRunsParams, type TraceQueryParams as TraceQueryParams, };
224
226
  export { OnlineEvaluators as OnlineEvaluators, type BulkDeleteEvaluatorFailedItem as BulkDeleteEvaluatorFailedItem, type BulkDeleteEvaluatorsResponse as BulkDeleteEvaluatorsResponse, type CreateOnlineCodeEvaluatorRequest as CreateOnlineCodeEvaluatorRequest, type CreateOnlineEvaluatorRequest as CreateOnlineEvaluatorRequest, type CreateOnlineEvaluatorResponse as CreateOnlineEvaluatorResponse, type CreateOnlineLlmEvaluatorRequest as CreateOnlineLlmEvaluatorRequest, type GetOnlineEvaluatorSpendResponse as GetOnlineEvaluatorSpendResponse, type OnlineCodeEvaluator as OnlineCodeEvaluator, type OnlineEvaluator as OnlineEvaluator, type OnlineEvaluatorRunRule as OnlineEvaluatorRunRule, type OnlineEvaluatorSpendDay as OnlineEvaluatorSpendDay, type OnlineEvaluatorSpendGroup as OnlineEvaluatorSpendGroup, type OnlineEvaluatorType as OnlineEvaluatorType, type OnlineLlmEvaluator as OnlineLlmEvaluator, type OnlineSpendLimit as OnlineSpendLimit, type UpdateOnlineCodeEvaluatorRequest as UpdateOnlineCodeEvaluatorRequest, type UpdateOnlineEvaluatorRequest as UpdateOnlineEvaluatorRequest, type UpdateOnlineEvaluatorResponse as UpdateOnlineEvaluatorResponse, type UpdateOnlineLlmEvaluatorRequest as UpdateOnlineLlmEvaluatorRequest, type OnlineEvaluatorsOffsetPaginationOnlineEvaluators as OnlineEvaluatorsOffsetPaginationOnlineEvaluators, type OnlineEvaluatorCreateParams as OnlineEvaluatorCreateParams, type OnlineEvaluatorUpdateParams as OnlineEvaluatorUpdateParams, type OnlineEvaluatorListParams as OnlineEvaluatorListParams, type OnlineEvaluatorDeleteParams as OnlineEvaluatorDeleteParams, type OnlineEvaluatorBulkDeleteParams as OnlineEvaluatorBulkDeleteParams, type OnlineEvaluatorSpendParams as OnlineEvaluatorSpendParams, };
227
+ export { Public as Public };
225
228
  export { Info as Info, type InfoListResponse as InfoListResponse };
226
229
  export { Issues as Issues, type Issue as Issue, type IssuesOffsetPaginationIssues as IssuesOffsetPaginationIssues, type IssueListParams as IssueListParams, };
227
230
  export { Sandboxes as Sandboxes, type SandboxListResponse as SandboxListResponse, type SandboxResponse as SandboxResponse, type SandboxStatusResponse as SandboxStatusResponse, type ServiceURLResponse as ServiceURLResponse, type SnapshotListResponse as SnapshotListResponse, type SnapshotResponse as SnapshotResponse, };
@@ -29,10 +29,11 @@ import { APIPromise } from './core/api-promise.js';
29
29
  import { Info } from './resources/info.js';
30
30
  import { Issues } from './resources/issues.js';
31
31
  import { OnlineEvaluators, } from './resources/online-evaluators.js';
32
- import { Runs, } from './resources/runs.js';
33
32
  import { Threads, } from './resources/threads.js';
34
33
  import { Traces, } from './resources/traces.js';
35
34
  import { Datasets, } from './resources/datasets/datasets.js';
35
+ import { Public } from './resources/public/public.js';
36
+ import { Runs, } from './resources/runs/runs.js';
36
37
  import { Sandboxes, } from './resources/sandboxes/sandboxes.js';
37
38
  import { buildHeaders } from './internal/headers.js';
38
39
  import { readEnv } from './internal/utils/env.js';
@@ -154,6 +155,12 @@ export class Langsmith {
154
155
  writable: true,
155
156
  value: new API.OnlineEvaluators(this)
156
157
  });
158
+ Object.defineProperty(this, "public", {
159
+ enumerable: true,
160
+ configurable: true,
161
+ writable: true,
162
+ value: new API.Public(this)
163
+ });
157
164
  Object.defineProperty(this, "info", {
158
165
  enumerable: true,
159
166
  configurable: true,
@@ -716,6 +723,7 @@ Langsmith.Runs = Runs;
716
723
  Langsmith.Threads = Threads;
717
724
  Langsmith.Traces = Traces;
718
725
  Langsmith.OnlineEvaluators = OnlineEvaluators;
726
+ Langsmith.Public = Public;
719
727
  Langsmith.Info = Info;
720
728
  Langsmith.Issues = Issues;
721
729
  Langsmith.Sandboxes = Sandboxes;
@@ -1,5 +1,5 @@
1
1
  import { APIResource } from '../../core/resource.js';
2
- import * as RunsAPI from '../runs.js';
2
+ import * as RunsAPI from '../runs/runs.js';
3
3
  import { ItemsCursorPostPagination, type ItemsCursorPostPaginationParams, PagePromise } from '../../core/pagination.js';
4
4
  import { RequestOptions } from '../../internal/request-options.js';
5
5
  export declare class ExperimentRuns extends APIResource {
@@ -82,7 +82,7 @@ export interface ExperimentRunQueryParams extends ItemsCursorPostPaginationParam
82
82
  * `selects` lists which run properties to include. Omitted => only `id`. Tokens
83
83
  * mirror /v2/runs/query.
84
84
  */
85
- selects?: Array<'ID' | 'NAME' | 'RUN_TYPE' | 'STATUS' | 'START_TIME' | 'END_TIME' | 'LATENCY_SECONDS' | 'FIRST_TOKEN_TIME' | 'ERROR' | 'ERROR_PREVIEW' | 'EXTRA' | 'METADATA' | 'EVENTS' | 'INPUTS' | 'INPUTS_PREVIEW' | 'OUTPUTS' | 'OUTPUTS_PREVIEW' | 'MANIFEST' | 'PARENT_RUN_IDS' | 'PROJECT_ID' | 'TRACE_ID' | 'THREAD_ID' | 'DOTTED_ORDER' | 'IS_ROOT' | 'REFERENCE_EXAMPLE_ID' | 'REFERENCE_DATASET_ID' | 'TOTAL_TOKENS' | 'PROMPT_TOKENS' | 'COMPLETION_TOKENS' | 'TOTAL_COST' | 'PROMPT_COST' | 'COMPLETION_COST' | 'PROMPT_TOKEN_DETAILS' | 'COMPLETION_TOKEN_DETAILS' | 'PROMPT_COST_DETAILS' | 'COMPLETION_COST_DETAILS' | 'PRICE_MODEL_ID' | 'TAGS' | 'APP_PATH' | 'ATTACHMENTS' | 'THREAD_EVALUATION_TIME' | 'IS_IN_DATASET' | 'SHARE_URL' | 'FEEDBACK_STATS'>;
85
+ selects?: Array<RunsAPI.RunSelectField>;
86
86
  /**
87
87
  * `sort` controls feedback-score sorting (single project only).
88
88
  */
@@ -2,7 +2,7 @@
2
2
  // @ts-nocheck
3
3
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Traces = exports.Threads = exports.Sandboxes = exports.Runs = exports.OnlineEvaluators = exports.Issues = exports.Info = exports.Datasets = void 0;
5
+ exports.Traces = exports.Threads = exports.Sandboxes = exports.Runs = exports.Public = exports.OnlineEvaluators = exports.Issues = exports.Info = exports.Datasets = void 0;
6
6
  var datasets_js_1 = require("./datasets/datasets.cjs");
7
7
  Object.defineProperty(exports, "Datasets", { enumerable: true, get: function () { return datasets_js_1.Datasets; } });
8
8
  var info_js_1 = require("./info.cjs");
@@ -11,7 +11,9 @@ var issues_js_1 = require("./issues.cjs");
11
11
  Object.defineProperty(exports, "Issues", { enumerable: true, get: function () { return issues_js_1.Issues; } });
12
12
  var online_evaluators_js_1 = require("./online-evaluators.cjs");
13
13
  Object.defineProperty(exports, "OnlineEvaluators", { enumerable: true, get: function () { return online_evaluators_js_1.OnlineEvaluators; } });
14
- var runs_js_1 = require("./runs.cjs");
14
+ var public_js_1 = require("./public/public.cjs");
15
+ Object.defineProperty(exports, "Public", { enumerable: true, get: function () { return public_js_1.Public; } });
16
+ var runs_js_1 = require("./runs/runs.cjs");
15
17
  Object.defineProperty(exports, "Runs", { enumerable: true, get: function () { return runs_js_1.Runs; } });
16
18
  var sandboxes_js_1 = require("./sandboxes/sandboxes.cjs");
17
19
  Object.defineProperty(exports, "Sandboxes", { enumerable: true, get: function () { return sandboxes_js_1.Sandboxes; } });
@@ -2,7 +2,8 @@ export { Datasets, type DataType, type Dataset, type DatasetTransformation, type
2
2
  export { Info, type InfoListResponse } from './info.js';
3
3
  export { Issues, type Issue, type IssueListParams, type IssuesOffsetPaginationIssues } from './issues.js';
4
4
  export { OnlineEvaluators, type BulkDeleteEvaluatorFailedItem, type BulkDeleteEvaluatorsResponse, type CreateOnlineCodeEvaluatorRequest, type CreateOnlineEvaluatorRequest, type CreateOnlineEvaluatorResponse, type CreateOnlineLlmEvaluatorRequest, type GetOnlineEvaluatorSpendResponse, type OnlineCodeEvaluator, type OnlineEvaluator, type OnlineEvaluatorRunRule, type OnlineEvaluatorSpendDay, type OnlineEvaluatorSpendGroup, type OnlineEvaluatorType, type OnlineLlmEvaluator, type OnlineSpendLimit, type UpdateOnlineCodeEvaluatorRequest, type UpdateOnlineEvaluatorRequest, type UpdateOnlineEvaluatorResponse, type UpdateOnlineLlmEvaluatorRequest, type OnlineEvaluatorCreateParams, type OnlineEvaluatorUpdateParams, type OnlineEvaluatorListParams, type OnlineEvaluatorDeleteParams, type OnlineEvaluatorBulkDeleteParams, type OnlineEvaluatorSpendParams, type OnlineEvaluatorsOffsetPaginationOnlineEvaluators, } from './online-evaluators.js';
5
- export { Runs, type ResponseBodyForRunsGenerateQuery, type Run, type RunIngest, type RunSchema, type RunStatsQueryParams, type RunTypeEnum, type RunsFilterDataSourceTypeEnum, type RunQueryV2Params, type RunRetrieveV2Params, type RunRetrieveParams, type RunQueryParams, type RunsItemsCursorPostPagination, } from './runs.js';
5
+ export { Public } from './public/public.js';
6
+ export { Runs, type ResponseBodyForRunsGenerateQuery, type Run, type RunIngest, type RunSchema, type RunSelectField, type RunStatsQueryParams, type RunType, type RunTypeEnum, type RunsFilterDataSourceTypeEnum, type RunGetURLResponse, type RunGetURLParams, type RunQueryV2Params, type RunRetrieveV2Params, type RunRetrieveParams, type RunQueryParams, type RunsItemsCursorPostPagination, } from './runs/runs.js';
6
7
  export { Sandboxes, type SandboxListResponse, type SandboxResponse, type SandboxStatusResponse, type ServiceURLResponse, type SnapshotListResponse, type SnapshotResponse, } from './sandboxes/sandboxes.js';
7
8
  export { Threads, type Thread, type ThreadStats, type ThreadTrace, type ThreadListTracesParams, type ThreadQueryParams, type ThreadStatsParams, type ThreadTracesItemsCursorGetPagination, type ThreadsItemsCursorPostPagination, } from './threads.js';
8
9
  export { Traces, type Trace, type TraceAggregates, type TraceListRunsResponse, type TraceListRunsParams, type TraceQueryParams, type TracesItemsCursorPostPagination, } from './traces.js';
@@ -4,7 +4,8 @@ export { Datasets, } from './datasets/datasets.js';
4
4
  export { Info } from './info.js';
5
5
  export { Issues } from './issues.js';
6
6
  export { OnlineEvaluators, } from './online-evaluators.js';
7
- export { Runs, } from './runs.js';
7
+ export { Public } from './public/public.js';
8
+ export { Runs, } from './runs/runs.js';
8
9
  export { Sandboxes, } from './sandboxes/sandboxes.js';
9
10
  export { Threads, } from './threads.js';
10
11
  export { Traces, } from './traces.js';
@@ -35,13 +35,19 @@ export interface Issue {
35
35
  proposed_examples?: Array<unknown>;
36
36
  proposed_fix?: string;
37
37
  proposed_prompt_fixes?: Array<unknown>;
38
+ /**
39
+ * RecurrencesSinceWatching counts linked traces whose run start_time is after
40
+ * watching_since — i.e. recurrences observed during the current watch period.
41
+ */
42
+ recurrences_since_watching?: number;
38
43
  session_id?: string;
39
44
  severity?: 0 | 1 | 2 | 3;
40
- status?: 'open' | 'completed' | 'ignored';
45
+ status?: 'open' | 'fixing' | 'watching' | 'completed' | 'ignored';
41
46
  tags?: Array<string>;
42
47
  tenant_id?: string;
43
48
  traces?: unknown;
44
49
  updated_at?: string;
50
+ watching_since?: string;
45
51
  }
46
52
  export interface IssueListParams extends OffsetPaginationIssuesParams {
47
53
  /**
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
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]; } };
9
+ }
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || (function () {
21
+ var ownKeys = function(o) {
22
+ ownKeys = Object.getOwnPropertyNames || function (o) {
23
+ var ar = [];
24
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
25
+ return ar;
26
+ };
27
+ return ownKeys(o);
28
+ };
29
+ return function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ })();
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.Public = void 0;
39
+ const resource_js_1 = require("../../core/resource.cjs");
40
+ const RunsAPI = __importStar(require("./runs.cjs"));
41
+ const runs_js_1 = require("./runs.cjs");
42
+ class Public extends resource_js_1.APIResource {
43
+ constructor() {
44
+ super(...arguments);
45
+ Object.defineProperty(this, "runs", {
46
+ enumerable: true,
47
+ configurable: true,
48
+ writable: true,
49
+ value: new RunsAPI.Runs(this._client)
50
+ });
51
+ }
52
+ }
53
+ exports.Public = Public;
54
+ Public.Runs = runs_js_1.Runs;
@@ -0,0 +1,9 @@
1
+ import { APIResource } from '../../core/resource.js';
2
+ import * as RunsAPI from './runs.js';
3
+ import { RunQueryParams, RunQueryResponse, RunRetrieveParams, Runs } from './runs.js';
4
+ export declare class Public extends APIResource {
5
+ runs: RunsAPI.Runs;
6
+ }
7
+ export declare namespace Public {
8
+ export { Runs as Runs, type RunQueryResponse as RunQueryResponse, type RunRetrieveParams as RunRetrieveParams, type RunQueryParams as RunQueryParams, };
9
+ }
@@ -0,0 +1,17 @@
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 RunsAPI from './runs.js';
5
+ import { Runs } from './runs.js';
6
+ export class Public extends APIResource {
7
+ constructor() {
8
+ super(...arguments);
9
+ Object.defineProperty(this, "runs", {
10
+ enumerable: true,
11
+ configurable: true,
12
+ writable: true,
13
+ value: new RunsAPI.Runs(this._client)
14
+ });
15
+ }
16
+ }
17
+ Public.Runs = Runs;
@@ -0,0 +1,56 @@
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.Runs = 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 Runs extends resource_js_1.APIResource {
10
+ /**
11
+ * **Alpha:** The request and response contract may change; Returns one run within
12
+ * the trace identified by the share token. The request supplies only the run ID
13
+ * and that run's exact start_time coordinate.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const run = await client.public.runs.retrieve(
18
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
19
+ * {
20
+ * share_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
21
+ * selects: ['string'],
22
+ * start_time: '2019-12-27T18:11:19.117Z',
23
+ * },
24
+ * );
25
+ * ```
26
+ */
27
+ retrieve(runID, params, options) {
28
+ const { share_token, Accept, ...query } = params;
29
+ return this._client.get((0, path_js_1.path) `/v2/public/${share_token}/run/${runID}`, {
30
+ query,
31
+ ...options,
32
+ headers: (0, headers_js_1.buildHeaders)([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
33
+ });
34
+ }
35
+ /**
36
+ * **Alpha:** The request and response contract may change; Returns all runs within
37
+ * the trace identified by the share token. The share token supplies the tenant,
38
+ * project, and trace scope.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const response = await client.public.runs.query(
43
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
44
+ * );
45
+ * ```
46
+ */
47
+ query(shareToken, params, options) {
48
+ const { Accept, ...body } = params;
49
+ return this._client.post((0, path_js_1.path) `/v2/public/${shareToken}/runs/v2/query`, {
50
+ body,
51
+ ...options,
52
+ headers: (0, headers_js_1.buildHeaders)([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
53
+ });
54
+ }
55
+ }
56
+ exports.Runs = Runs;
@@ -0,0 +1,76 @@
1
+ import { APIResource } from '../../core/resource.js';
2
+ import { APIPromise } from '../../core/api-promise.js';
3
+ import { RequestOptions } from '../../internal/request-options.js';
4
+ import * as RunsAPI_ from '../runs/runs.js';
5
+ export declare class Runs extends APIResource {
6
+ /**
7
+ * **Alpha:** The request and response contract may change; Returns one run within
8
+ * the trace identified by the share token. The request supplies only the run ID
9
+ * and that run's exact start_time coordinate.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const run = await client.public.runs.retrieve(
14
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
15
+ * {
16
+ * share_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
17
+ * selects: ['string'],
18
+ * start_time: '2019-12-27T18:11:19.117Z',
19
+ * },
20
+ * );
21
+ * ```
22
+ */
23
+ retrieve(runID: string, params: RunRetrieveParams, options?: RequestOptions): APIPromise<RunsAPI_.Run>;
24
+ /**
25
+ * **Alpha:** The request and response contract may change; Returns all runs within
26
+ * the trace identified by the share token. The share token supplies the tenant,
27
+ * project, and trace scope.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const response = await client.public.runs.query(
32
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
33
+ * );
34
+ * ```
35
+ */
36
+ query(shareToken: string, params: RunQueryParams, options?: RequestOptions): APIPromise<RunQueryResponse>;
37
+ }
38
+ export interface RunQueryResponse {
39
+ /**
40
+ * `items` lists runs in the trace for the requested time window, in `start_time`
41
+ * order.
42
+ */
43
+ items?: Array<RunsAPI_.Run>;
44
+ }
45
+ export interface RunRetrieveParams {
46
+ /**
47
+ * Path param: Share token UUID
48
+ */
49
+ share_token: string;
50
+ /**
51
+ * Query param: repeatable public run fields to include
52
+ */
53
+ selects: Array<string>;
54
+ /**
55
+ * Query param: Run start_time coordinate (RFC3339)
56
+ */
57
+ start_time: string;
58
+ /**
59
+ * Header param: application/json
60
+ */
61
+ Accept?: string;
62
+ }
63
+ export interface RunQueryParams {
64
+ /**
65
+ * Body param: `selects` lists which public run properties to include on each
66
+ * returned run.
67
+ */
68
+ selects?: Array<'ID' | 'NAME' | 'RUN_TYPE' | 'STATUS' | 'START_TIME' | 'END_TIME' | 'LATENCY_SECONDS' | 'FIRST_TOKEN_TIME' | 'ERROR' | 'ERROR_PREVIEW' | 'EXTRA' | 'METADATA' | 'INPUTS_PREVIEW' | 'OUTPUTS_PREVIEW' | 'PARENT_RUN_ID' | 'PARENT_RUN_IDS' | 'PROJECT_ID' | 'TRACE_ID' | 'THREAD_ID' | 'DOTTED_ORDER' | 'IS_ROOT' | 'REFERENCE_DATASET_ID' | 'TOTAL_TOKENS' | 'PROMPT_TOKENS' | 'COMPLETION_TOKENS' | 'TOTAL_COST' | 'PROMPT_COST' | 'COMPLETION_COST' | 'PROMPT_TOKEN_DETAILS' | 'COMPLETION_TOKEN_DETAILS' | 'PROMPT_COST_DETAILS' | 'COMPLETION_COST_DETAILS' | 'PRICE_MODEL_ID' | 'TAGS' | 'THREAD_EVALUATION_TIME'>;
69
+ /**
70
+ * Header param: application/json
71
+ */
72
+ Accept?: string;
73
+ }
74
+ export declare namespace Runs {
75
+ export { type RunQueryResponse as RunQueryResponse, type RunRetrieveParams as RunRetrieveParams, type RunQueryParams as RunQueryParams, };
76
+ }
@@ -0,0 +1,52 @@
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 Runs extends APIResource {
7
+ /**
8
+ * **Alpha:** The request and response contract may change; Returns one run within
9
+ * the trace identified by the share token. The request supplies only the run ID
10
+ * and that run's exact start_time coordinate.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const run = await client.public.runs.retrieve(
15
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
16
+ * {
17
+ * share_token: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
18
+ * selects: ['string'],
19
+ * start_time: '2019-12-27T18:11:19.117Z',
20
+ * },
21
+ * );
22
+ * ```
23
+ */
24
+ retrieve(runID, params, options) {
25
+ const { share_token, Accept, ...query } = params;
26
+ return this._client.get(path `/v2/public/${share_token}/run/${runID}`, {
27
+ query,
28
+ ...options,
29
+ headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
30
+ });
31
+ }
32
+ /**
33
+ * **Alpha:** The request and response contract may change; Returns all runs within
34
+ * the trace identified by the share token. The share token supplies the tenant,
35
+ * project, and trace scope.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const response = await client.public.runs.query(
40
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
41
+ * );
42
+ * ```
43
+ */
44
+ query(shareToken, params, options) {
45
+ const { Accept, ...body } = params;
46
+ return this._client.post(path `/v2/public/${shareToken}/runs/v2/query`, {
47
+ body,
48
+ ...options,
49
+ headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
50
+ });
51
+ }
52
+ }
@@ -0,0 +1,9 @@
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 = exports.Runs = void 0;
6
+ var runs_js_1 = require("./runs.cjs");
7
+ Object.defineProperty(exports, "Runs", { enumerable: true, get: function () { return runs_js_1.Runs; } });
8
+ var share_js_1 = require("./share.cjs");
9
+ Object.defineProperty(exports, "Share", { enumerable: true, get: function () { return share_js_1.Share; } });
@@ -0,0 +1,2 @@
1
+ export { Runs, type ResponseBodyForRunsGenerateQuery, type Run, type RunIngest, type RunSchema, type RunSelectField, type RunStatsQueryParams, type RunType, type RunTypeEnum, type RunsFilterDataSourceTypeEnum, type RunGetURLResponse, type RunGetURLParams, type RunQueryV2Params, type RunRetrieveV2Params, type RunRetrieveParams, type RunQueryParams, type RunsItemsCursorPostPagination, } from './runs.js';
2
+ export { Share, type ShareCreateResponse, type ShareCreateParams, type ShareDeleteParams } from './share.js';
@@ -0,0 +1,4 @@
1
+ // @ts-nocheck
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ export { Runs, } from './runs.js';
4
+ export { Share } from './share.js';
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
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]; } };
9
+ }
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || (function () {
21
+ var ownKeys = function(o) {
22
+ ownKeys = Object.getOwnPropertyNames || function (o) {
23
+ var ar = [];
24
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
25
+ return ar;
26
+ };
27
+ return ownKeys(o);
28
+ };
29
+ return function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ })();
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.Runs = void 0;
39
+ const resource_js_1 = require("../../core/resource.cjs");
40
+ const ShareAPI = __importStar(require("./share.cjs"));
41
+ const share_js_1 = require("./share.cjs");
42
+ const pagination_js_1 = require("../../core/pagination.cjs");
43
+ const headers_js_1 = require("../../internal/headers.cjs");
44
+ const path_js_1 = require("../../internal/utils/path.cjs");
45
+ class Runs extends resource_js_1.APIResource {
46
+ constructor() {
47
+ super(...arguments);
48
+ Object.defineProperty(this, "share", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: new ShareAPI.Share(this._client)
53
+ });
54
+ Object.defineProperty(this, "retrieve", {
55
+ enumerable: true,
56
+ configurable: true,
57
+ writable: true,
58
+ value: this.retrieveV2
59
+ });
60
+ Object.defineProperty(this, "query", {
61
+ enumerable: true,
62
+ configurable: true,
63
+ writable: true,
64
+ value: this.queryV2
65
+ });
66
+ }
67
+ /**
68
+ * Returns the URL to view a specific run in the LangSmith UI. The caller must
69
+ * supply the run's project_id and trace_id as query parameters; start_time is
70
+ * optional.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const response = await client.runs.getURL(
75
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
76
+ * { project_id: 'project_id', trace_id: 'trace_id' },
77
+ * );
78
+ * ```
79
+ */
80
+ getURL(runID, query, options) {
81
+ return this._client.get((0, path_js_1.path) `/v2/runs/${runID}/url`, { query, ...options });
82
+ }
83
+ /**
84
+ * **Alpha:** The request and response contract may change; Returns a paginated
85
+ * list of runs for the given projects within min/max start_time. Supports filters,
86
+ * cursor pagination, and `selects` to select fields to return.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * // Automatically fetches more pages as needed.
91
+ * for await (const run of client.runs.queryV2()) {
92
+ * // ...
93
+ * }
94
+ * ```
95
+ */
96
+ queryV2(params, options) {
97
+ const { Accept, ...body } = params;
98
+ return this._client.getAPIList('/v2/runs/query', (pagination_js_1.ItemsCursorPostPagination), {
99
+ body,
100
+ method: 'post',
101
+ ...options,
102
+ headers: (0, headers_js_1.buildHeaders)([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
103
+ });
104
+ }
105
+ /**
106
+ * **Alpha:** The request and response contract may change; Returns one run by ID
107
+ * for the given session. Use the `selects` query parameter (repeatable) to select
108
+ * fields to return.
109
+ *
110
+ * @example
111
+ * ```ts
112
+ * const run = await client.runs.retrieveV2(
113
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
114
+ * { project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
115
+ * );
116
+ * ```
117
+ */
118
+ retrieveV2(runID, params, options) {
119
+ const { Accept, ...query } = params;
120
+ return this._client.get((0, path_js_1.path) `/v2/runs/${runID}`, {
121
+ query,
122
+ ...options,
123
+ headers: (0, headers_js_1.buildHeaders)([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
124
+ });
125
+ }
126
+ }
127
+ exports.Runs = Runs;
128
+ Runs.Share = share_js_1.Share;