langsmith 0.7.13 → 0.7.15

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 (56) hide show
  1. package/dist/_openapi_client/client.cjs +9 -1
  2. package/dist/_openapi_client/client.d.ts +10 -5
  3. package/dist/_openapi_client/client.js +9 -1
  4. package/dist/_openapi_client/core/pagination.cjs +29 -1
  5. package/dist/_openapi_client/core/pagination.d.ts +11 -0
  6. package/dist/_openapi_client/core/pagination.js +27 -0
  7. package/dist/_openapi_client/resources/datasets/datasets.cjs +5 -14
  8. package/dist/_openapi_client/resources/datasets/datasets.d.ts +6 -10
  9. package/dist/_openapi_client/resources/datasets/datasets.js +5 -14
  10. package/dist/_openapi_client/resources/datasets/experiment-runs.cjs +18 -0
  11. package/dist/_openapi_client/resources/datasets/experiment-runs.d.ts +109 -0
  12. package/dist/_openapi_client/resources/datasets/experiment-runs.js +14 -0
  13. package/dist/_openapi_client/resources/datasets/runs.cjs +0 -7
  14. package/dist/_openapi_client/resources/datasets/runs.d.ts +4 -45
  15. package/dist/_openapi_client/resources/datasets/runs.js +0 -7
  16. package/dist/_openapi_client/resources/index.cjs +4 -2
  17. package/dist/_openapi_client/resources/index.d.ts +3 -2
  18. package/dist/_openapi_client/resources/index.js +2 -1
  19. package/dist/_openapi_client/resources/issues.cjs +31 -0
  20. package/dist/_openapi_client/resources/issues.d.ts +78 -0
  21. package/dist/_openapi_client/resources/issues.js +27 -0
  22. package/dist/_openapi_client/resources/runs/index.d.ts +1 -1
  23. package/dist/_openapi_client/resources/runs/runs.cjs +2 -2
  24. package/dist/_openapi_client/resources/runs/runs.d.ts +24 -24
  25. package/dist/_openapi_client/resources/runs/runs.js +2 -2
  26. package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +7 -0
  27. package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +1 -0
  28. package/dist/_openapi_client/resources/sessions.cjs +53 -0
  29. package/dist/_openapi_client/resources/{sessions/sessions.d.ts → sessions.d.ts} +14 -52
  30. package/dist/_openapi_client/resources/sessions.js +49 -0
  31. package/dist/client.cjs +40 -0
  32. package/dist/client.d.ts +28 -0
  33. package/dist/client.js +40 -0
  34. package/dist/experimental/anthropic/context.cjs +6 -1
  35. package/dist/experimental/anthropic/context.js +6 -1
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/utils/constants.cjs +1 -1
  40. package/dist/utils/constants.d.ts +1 -1
  41. package/dist/utils/constants.js +1 -1
  42. package/dist/utils/env.cjs +1 -1
  43. package/dist/utils/env.d.ts +0 -7
  44. package/dist/utils/env.js +1 -1
  45. package/package.json +10 -10
  46. package/dist/_openapi_client/resources/datasets/experiments.cjs +0 -16
  47. package/dist/_openapi_client/resources/datasets/experiments.d.ts +0 -23
  48. package/dist/_openapi_client/resources/datasets/experiments.js +0 -12
  49. package/dist/_openapi_client/resources/datasets/group.cjs +0 -17
  50. package/dist/_openapi_client/resources/datasets/group.d.ts +0 -160
  51. package/dist/_openapi_client/resources/datasets/group.js +0 -13
  52. package/dist/_openapi_client/resources/sessions/insights.cjs +0 -54
  53. package/dist/_openapi_client/resources/sessions/insights.d.ts +0 -246
  54. package/dist/_openapi_client/resources/sessions/insights.js +0 -50
  55. package/dist/_openapi_client/resources/sessions/sessions.cjs +0 -109
  56. package/dist/_openapi_client/resources/sessions/sessions.js +0 -72
@@ -1,6 +1,7 @@
1
1
  export { Datasets, type DataType, type Dataset, type DatasetTransformation, type DatasetVersion, type FeedbackCreateCoreSchema, type Missing, type SortByDatasetColumn, type DatasetUpdateResponse, type DatasetDeleteResponse, type DatasetCloneResponse, type DatasetRetrieveCsvResponse, type DatasetRetrieveJSONLResponse, type DatasetRetrieveOpenAIResponse, type DatasetRetrieveOpenAIFtResponse, type DatasetCreateParams, type DatasetUpdateParams, type DatasetListParams, type DatasetCloneParams, type DatasetRetrieveCsvParams, type DatasetRetrieveJSONLParams, type DatasetRetrieveOpenAIParams, type DatasetRetrieveOpenAIFtParams, type DatasetRetrieveVersionParams, type DatasetUpdateTagsParams, type DatasetUploadParams, type DatasetVersionsOffsetPaginationTopLevelArray, type DatasetsOffsetPaginationTopLevelArray, } from './datasets/datasets.js';
2
2
  export { Info, type InfoListResponse } from './info.js';
3
+ export { Issues, type Issue, type IssueListParams, type IssuesOffsetPaginationIssues } from './issues.js';
3
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';
4
- export { Runs, type QueryRunResponse, type ResponseBodyForRunsGenerateQuery, type Run, type RunSchema, type RunStatsQueryParams, type RunTypeEnum, type RunsFilterDataSourceTypeEnum, type RunQueryV2Params, type RunRetrieveV2Params, type RunRetrieveParams, type RunQueryParams, type QueryRunResponsesItemsCursorPostPagination, } from './runs/runs.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/runs.js';
5
6
  export { Sandboxes, type SandboxListResponse, type SandboxResponse, type SandboxStatusResponse, type ServiceURLResponse, type SnapshotListResponse, type SnapshotResponse, } from './sandboxes/sandboxes.js';
6
- export { Sessions, type CustomChartsSection, type CustomChartsSectionRequest, type RunStatsGroupBy, type SessionSortableColumns, type TimedeltaInput, type TracerSession, type TracerSessionWithoutVirtualFields, type SessionDeleteResponse, type SessionCreateParams, type SessionRetrieveParams, type SessionUpdateParams, type SessionListParams, type SessionDashboardParams, type TracerSessionsOffsetPaginationTopLevelArray, } from './sessions/sessions.js';
7
+ export { Sessions, type CustomChartsSection, type CustomChartsSectionRequest, type RunStatsGroupBy, type SessionSortableColumns, type TimedeltaInput, type TracerSession, type TracerSessionWithoutVirtualFields, type SessionDeleteResponse, type SessionCreateParams, type SessionRetrieveParams, type SessionUpdateParams, type SessionListParams, type TracerSessionsOffsetPaginationTopLevelArray, } from './sessions.js';
@@ -2,7 +2,8 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  export { Datasets, } from './datasets/datasets.js';
4
4
  export { Info } from './info.js';
5
+ export { Issues } from './issues.js';
5
6
  export { OnlineEvaluators, } from './online-evaluators.js';
6
7
  export { Runs, } from './runs/runs.js';
7
8
  export { Sandboxes, } from './sandboxes/sandboxes.js';
8
- export { Sessions, } from './sessions/sessions.js';
9
+ export { Sessions, } from './sessions.js';
@@ -0,0 +1,31 @@
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.Issues = 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 Issues extends resource_js_1.APIResource {
10
+ /**
11
+ * **Beta:** This endpoint is in active development and may change without notice.
12
+ *
13
+ * Returns one issue for the authenticated tenant.
14
+ */
15
+ retrieve(id, options) {
16
+ return this._client.get((0, path_js_1.path) `/v1/platform/issues/${id}`, options);
17
+ }
18
+ /**
19
+ * **Beta:** This endpoint is in active development and may change without notice.
20
+ *
21
+ * Returns issues for the authenticated tenant, optionally filtered by session,
22
+ * status, severity, tag, or last modified time.
23
+ */
24
+ list(query = {}, options) {
25
+ return this._client.getAPIList('/v1/platform/issues', (pagination_js_1.OffsetPaginationIssues), {
26
+ query,
27
+ ...options,
28
+ });
29
+ }
30
+ }
31
+ exports.Issues = Issues;
@@ -0,0 +1,78 @@
1
+ import { APIResource } from '../core/resource.js';
2
+ import { APIPromise } from '../core/api-promise.js';
3
+ import { OffsetPaginationIssues, type OffsetPaginationIssuesParams, PagePromise } from '../core/pagination.js';
4
+ import { RequestOptions } from '../internal/request-options.js';
5
+ export declare class Issues extends APIResource {
6
+ /**
7
+ * **Beta:** This endpoint is in active development and may change without notice.
8
+ *
9
+ * Returns one issue for the authenticated tenant.
10
+ */
11
+ retrieve(id: string, options?: RequestOptions): APIPromise<Issue>;
12
+ /**
13
+ * **Beta:** This endpoint is in active development and may change without notice.
14
+ *
15
+ * Returns issues for the authenticated tenant, optionally filtered by session,
16
+ * status, severity, tag, or last modified time.
17
+ */
18
+ list(query?: IssueListParams | null | undefined, options?: RequestOptions): PagePromise<IssuesOffsetPaginationIssues, Issue>;
19
+ }
20
+ export type IssuesOffsetPaginationIssues = OffsetPaginationIssues<Issue>;
21
+ export interface Issue {
22
+ id?: string;
23
+ actions?: unknown;
24
+ created_at?: string;
25
+ description?: string;
26
+ first_seen_at?: string;
27
+ fix_branch?: string;
28
+ fix_dispatched_at?: string;
29
+ fix_pr_number?: number;
30
+ fix_prompt?: string;
31
+ fix_verification?: unknown;
32
+ last_seen_at?: string;
33
+ name?: string;
34
+ proposed_context_fixes?: Array<unknown>;
35
+ proposed_examples?: Array<unknown>;
36
+ proposed_fix?: string;
37
+ proposed_prompt_fixes?: Array<unknown>;
38
+ session_id?: string;
39
+ severity?: 0 | 1 | 2 | 3;
40
+ status?: 'open' | 'completed' | 'ignored';
41
+ tags?: Array<string>;
42
+ tenant_id?: string;
43
+ traces?: unknown;
44
+ updated_at?: string;
45
+ }
46
+ export interface IssueListParams extends OffsetPaginationIssuesParams {
47
+ /**
48
+ * Filter by session ID (UUID)
49
+ */
50
+ session_id?: string;
51
+ /**
52
+ * Filter by session name (exact match)
53
+ */
54
+ session_name?: string;
55
+ /**
56
+ * Filter by severity
57
+ */
58
+ severity?: 0 | 1 | 2 | 3;
59
+ /**
60
+ * Sort field
61
+ */
62
+ sort_by?: 'created_at' | 'updated_at' | 'severity';
63
+ /**
64
+ * Filter by status
65
+ */
66
+ status?: 'open' | 'completed' | 'ignored';
67
+ /**
68
+ * Filter by tag (exact match)
69
+ */
70
+ tag?: string;
71
+ /**
72
+ * Return only issues updated at or after this RFC3339 timestamp
73
+ */
74
+ updated_at?: string;
75
+ }
76
+ export declare namespace Issues {
77
+ export { type Issue as Issue, type IssuesOffsetPaginationIssues as IssuesOffsetPaginationIssues, type IssueListParams as IssueListParams, };
78
+ }
@@ -0,0 +1,27 @@
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 { OffsetPaginationIssues } from '../core/pagination.js';
5
+ import { path } from '../internal/utils/path.js';
6
+ export class Issues extends APIResource {
7
+ /**
8
+ * **Beta:** This endpoint is in active development and may change without notice.
9
+ *
10
+ * Returns one issue for the authenticated tenant.
11
+ */
12
+ retrieve(id, options) {
13
+ return this._client.get(path `/v1/platform/issues/${id}`, options);
14
+ }
15
+ /**
16
+ * **Beta:** This endpoint is in active development and may change without notice.
17
+ *
18
+ * Returns issues for the authenticated tenant, optionally filtered by session,
19
+ * status, severity, tag, or last modified time.
20
+ */
21
+ list(query = {}, options) {
22
+ return this._client.getAPIList('/v1/platform/issues', (OffsetPaginationIssues), {
23
+ query,
24
+ ...options,
25
+ });
26
+ }
27
+ }
@@ -1,2 +1,2 @@
1
1
  export { Rules } from './rules.js';
2
- export { Runs, type QueryRunResponse, type ResponseBodyForRunsGenerateQuery, type Run, type RunSchema, type RunStatsQueryParams, type RunTypeEnum, type RunsFilterDataSourceTypeEnum, type RunQueryV2Params, type RunRetrieveV2Params, type RunRetrieveParams, type RunQueryParams, type QueryRunResponsesItemsCursorPostPagination, } from './runs.js';
2
+ 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';
@@ -72,7 +72,7 @@ class Runs extends resource_js_1.APIResource {
72
72
  * @example
73
73
  * ```ts
74
74
  * // Automatically fetches more pages as needed.
75
- * for await (const queryRunResponse of client.runs.queryV2()) {
75
+ * for await (const run of client.runs.queryV2()) {
76
76
  * // ...
77
77
  * }
78
78
  * ```
@@ -93,7 +93,7 @@ class Runs extends resource_js_1.APIResource {
93
93
  *
94
94
  * @example
95
95
  * ```ts
96
- * const queryRunResponse = await client.runs.retrieveV2(
96
+ * const run = await client.runs.retrieveV2(
97
97
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
98
98
  * {
99
99
  * project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
@@ -1,7 +1,7 @@
1
1
  import { APIResource } from '../../core/resource.js';
2
+ import * as SessionsAPI from '../sessions.js';
2
3
  import * as RulesAPI from './rules.js';
3
4
  import { Rules } from './rules.js';
4
- import * as SessionsAPI from '../sessions/sessions.js';
5
5
  import { APIPromise } from '../../core/api-promise.js';
6
6
  import { ItemsCursorPostPagination, type ItemsCursorPostPaginationParams, PagePromise } from '../../core/pagination.js';
7
7
  import { RequestOptions } from '../../internal/request-options.js';
@@ -15,12 +15,12 @@ export declare class Runs extends APIResource {
15
15
  * @example
16
16
  * ```ts
17
17
  * // Automatically fetches more pages as needed.
18
- * for await (const queryRunResponse of client.runs.queryV2()) {
18
+ * for await (const run of client.runs.queryV2()) {
19
19
  * // ...
20
20
  * }
21
21
  * ```
22
22
  */
23
- queryV2(params: RunQueryV2Params, options?: RequestOptions): PagePromise<QueryRunResponsesItemsCursorPostPagination, QueryRunResponse>;
23
+ queryV2(params: RunQueryV2Params, options?: RequestOptions): PagePromise<RunsItemsCursorPostPagination, Run>;
24
24
  /**
25
25
  * **Alpha:** The request and response contract may change; Returns one run by ID
26
26
  * for the given session and start_time. Use the `selects` query parameter
@@ -28,7 +28,7 @@ export declare class Runs extends APIResource {
28
28
  *
29
29
  * @example
30
30
  * ```ts
31
- * const queryRunResponse = await client.runs.retrieveV2(
31
+ * const run = await client.runs.retrieveV2(
32
32
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
33
33
  * {
34
34
  * project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
@@ -37,12 +37,18 @@ export declare class Runs extends APIResource {
37
37
  * );
38
38
  * ```
39
39
  */
40
- retrieveV2(runID: string, params: RunRetrieveV2Params, options?: RequestOptions): APIPromise<QueryRunResponse>;
41
- retrieve: (runID: string, params: RunRetrieveV2Params, options?: RequestOptions) => APIPromise<QueryRunResponse>;
42
- query: (params: RunQueryV2Params, options?: RequestOptions) => PagePromise<QueryRunResponsesItemsCursorPostPagination, QueryRunResponse>;
40
+ retrieveV2(runID: string, params: RunRetrieveV2Params, options?: RequestOptions): APIPromise<Run>;
41
+ retrieve: (runID: string, params: RunRetrieveV2Params, options?: RequestOptions) => APIPromise<Run>;
42
+ query: (params: RunQueryV2Params, options?: RequestOptions) => PagePromise<RunsItemsCursorPostPagination, Run>;
43
43
  }
44
- export type QueryRunResponsesItemsCursorPostPagination = ItemsCursorPostPagination<QueryRunResponse>;
45
- export interface QueryRunResponse {
44
+ export type RunsItemsCursorPostPagination = ItemsCursorPostPagination<Run>;
45
+ export interface ResponseBodyForRunsGenerateQuery {
46
+ feedback_urls: {
47
+ [key: string]: string;
48
+ };
49
+ filter: string;
50
+ }
51
+ export interface Run {
46
52
  /**
47
53
  * `id` is this run's UUID.
48
54
  */
@@ -67,13 +73,13 @@ export interface QueryRunResponse {
67
73
  * `completion_cost`. Categories mirror `completion_token_details`. Returned only
68
74
  * when the `COMPLETION_COST_DETAILS` field is requested.
69
75
  */
70
- completion_cost_details?: QueryRunResponse.CompletionCostDetails;
76
+ completion_cost_details?: Run.CompletionCostDetails;
71
77
  /**
72
78
  * `completion_token_details` is the per-category breakdown of `completion_tokens`.
73
79
  * Category names are model-specific (for example `reasoning`, `audio`). Returned
74
80
  * only when the `COMPLETION_TOKEN_DETAILS` field is requested.
75
81
  */
76
- completion_token_details?: QueryRunResponse.CompletionTokenDetails;
82
+ completion_token_details?: Run.CompletionTokenDetails;
77
83
  /**
78
84
  * `completion_tokens` is the completion-side token count.
79
85
  */
@@ -98,7 +104,7 @@ export interface QueryRunResponse {
98
104
  /**
99
105
  * `events` is the ordered list of run events (for example streaming tokens).
100
106
  */
101
- events?: Array<QueryRunResponse.Event>;
107
+ events?: Array<Run.Event>;
102
108
  /**
103
109
  * `extra` is additional runtime JSON attached to the run.
104
110
  */
@@ -107,7 +113,7 @@ export interface QueryRunResponse {
107
113
  * `feedback_stats` aggregates feedback scores keyed by feedback key.
108
114
  */
109
115
  feedback_stats?: {
110
- [key: string]: QueryRunResponse.FeedbackStats;
116
+ [key: string]: Run.FeedbackStats;
111
117
  };
112
118
  /**
113
119
  * `first_token_time` is when the first output token was produced (RFC3339
@@ -179,13 +185,13 @@ export interface QueryRunResponse {
179
185
  * Categories mirror `prompt_token_details`. Returned only when the
180
186
  * `PROMPT_COST_DETAILS` field is requested.
181
187
  */
182
- prompt_cost_details?: QueryRunResponse.PromptCostDetails;
188
+ prompt_cost_details?: Run.PromptCostDetails;
183
189
  /**
184
190
  * `prompt_token_details` is the per-category breakdown of `prompt_tokens`.
185
191
  * Category names are model-specific (for example `cache_read`, `cache_write`).
186
192
  * Returned only when the `PROMPT_TOKEN_DETAILS` field is requested.
187
193
  */
188
- prompt_token_details?: QueryRunResponse.PromptTokenDetails;
194
+ prompt_token_details?: Run.PromptTokenDetails;
189
195
  /**
190
196
  * `prompt_tokens` is the prompt-side token count.
191
197
  */
@@ -249,7 +255,7 @@ export interface QueryRunResponse {
249
255
  */
250
256
  trace_id?: string;
251
257
  }
252
- export declare namespace QueryRunResponse {
258
+ export declare namespace Run {
253
259
  /**
254
260
  * `completion_cost_details` is the per-category USD breakdown of
255
261
  * `completion_cost`. Categories mirror `completion_token_details`. Returned only
@@ -389,13 +395,7 @@ export declare namespace QueryRunResponse {
389
395
  };
390
396
  }
391
397
  }
392
- export interface ResponseBodyForRunsGenerateQuery {
393
- feedback_urls: {
394
- [key: string]: string;
395
- };
396
- filter: string;
397
- }
398
- export interface Run {
398
+ export interface RunIngest {
399
399
  id?: string;
400
400
  dotted_order?: string;
401
401
  end_time?: string;
@@ -795,6 +795,6 @@ export interface RunQueryParams extends ItemsCursorPostPaginationParams {
795
795
  Accept?: string;
796
796
  }
797
797
  export declare namespace Runs {
798
- export { type QueryRunResponse as QueryRunResponse, type ResponseBodyForRunsGenerateQuery as ResponseBodyForRunsGenerateQuery, type Run as Run, type RunSchema as RunSchema, type RunStatsQueryParams as RunStatsQueryParams, type RunTypeEnum as RunTypeEnum, type RunsFilterDataSourceTypeEnum as RunsFilterDataSourceTypeEnum, type QueryRunResponsesItemsCursorPostPagination as QueryRunResponsesItemsCursorPostPagination, type RunQueryV2Params as RunQueryV2Params, type RunRetrieveV2Params as RunRetrieveV2Params, type RunRetrieveParams as RunRetrieveParams, type RunQueryParams as RunQueryParams, };
798
+ export { 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, };
799
799
  export { Rules as Rules };
800
800
  }
@@ -36,7 +36,7 @@ export class Runs extends APIResource {
36
36
  * @example
37
37
  * ```ts
38
38
  * // Automatically fetches more pages as needed.
39
- * for await (const queryRunResponse of client.runs.queryV2()) {
39
+ * for await (const run of client.runs.queryV2()) {
40
40
  * // ...
41
41
  * }
42
42
  * ```
@@ -57,7 +57,7 @@ export class Runs extends APIResource {
57
57
  *
58
58
  * @example
59
59
  * ```ts
60
- * const queryRunResponse = await client.runs.retrieveV2(
60
+ * const run = await client.runs.retrieveV2(
61
61
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
62
62
  * {
63
63
  * project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
@@ -54,6 +54,12 @@ export declare class Boxes extends APIResource {
54
54
  stop(name: string, options?: RequestOptions): APIPromise<void>;
55
55
  }
56
56
  export interface BoxCreateParams {
57
+ /**
58
+ * CPUMillicores optionally requests CPU at millicore granularity (e.g. 500 = 0.5
59
+ * vCPU); takes precedence over VCPUs. Fractional (sub-vCPU) values are not
60
+ * available for every sandbox.
61
+ */
62
+ cpu_millicores?: number;
57
63
  delete_after_stop_seconds?: number;
58
64
  env_vars?: {
59
65
  [key: string]: string;
@@ -310,6 +316,7 @@ export declare namespace BoxCreateParams {
310
316
  }
311
317
  }
312
318
  export interface BoxUpdateParams {
319
+ cpu_millicores?: number;
313
320
  delete_after_stop_seconds?: number;
314
321
  fs_capacity_bytes?: number;
315
322
  idle_ttl_seconds?: number;
@@ -16,6 +16,7 @@ export interface SandboxListResponse {
16
16
  }
17
17
  export interface SandboxResponse {
18
18
  id?: string;
19
+ cpu_millicores?: number;
19
20
  created_at?: string;
20
21
  created_by?: string;
21
22
  dataplane_url?: string;
@@ -0,0 +1,53 @@
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.Sessions = 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 Sessions extends resource_js_1.APIResource {
11
+ /**
12
+ * Create a new project.
13
+ */
14
+ create(params, options) {
15
+ const { upsert, ...body } = params;
16
+ return this._client.post('/api/v1/sessions', { query: { upsert }, body, ...options });
17
+ }
18
+ /**
19
+ * Get a specific project.
20
+ */
21
+ retrieve(project_id, params = {}, options) {
22
+ const { accept, ...query } = params ?? {};
23
+ return this._client.get((0, path_js_1.path) `/api/v1/sessions/${project_id}`, {
24
+ query,
25
+ ...options,
26
+ headers: (0, headers_js_1.buildHeaders)([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
27
+ });
28
+ }
29
+ /**
30
+ * Update a project.
31
+ */
32
+ update(project_id, body, options) {
33
+ return this._client.patch((0, path_js_1.path) `/api/v1/sessions/${project_id}`, { body, ...options });
34
+ }
35
+ /**
36
+ * List all projects.
37
+ */
38
+ list(params = {}, options) {
39
+ const { accept, ...query } = params ?? {};
40
+ return this._client.getAPIList('/api/v1/sessions', (pagination_js_1.OffsetPaginationTopLevelArray), {
41
+ query,
42
+ ...options,
43
+ headers: (0, headers_js_1.buildHeaders)([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
44
+ });
45
+ }
46
+ /**
47
+ * Delete a specific project.
48
+ */
49
+ delete(project_id, options) {
50
+ return this._client.delete((0, path_js_1.path) `/api/v1/sessions/${project_id}`, options);
51
+ }
52
+ }
53
+ exports.Sessions = Sessions;
@@ -1,35 +1,28 @@
1
- import { APIResource } from '../../core/resource.js';
2
- import * as InsightsAPI from './insights.js';
3
- import { CreateRunClusteringJobRequest, InsightCreateParams, InsightCreateResponse, InsightDeleteParams, InsightDeleteResponse, InsightListParams, InsightListResponse, InsightListResponsesOffsetPaginationInsightsClusteringJobs, InsightRetrieveJobParams, InsightRetrieveJobResponse, InsightRetrieveRunsParams, InsightRetrieveRunsResponse, InsightUpdateParams, InsightUpdateResponse, Insights } from './insights.js';
4
- import { APIPromise } from '../../core/api-promise.js';
5
- import { OffsetPaginationTopLevelArray, type OffsetPaginationTopLevelArrayParams, PagePromise } from '../../core/pagination.js';
6
- import { RequestOptions } from '../../internal/request-options.js';
1
+ import { APIResource } from '../core/resource.js';
2
+ import { APIPromise } from '../core/api-promise.js';
3
+ import { OffsetPaginationTopLevelArray, type OffsetPaginationTopLevelArrayParams, PagePromise } from '../core/pagination.js';
4
+ import { RequestOptions } from '../internal/request-options.js';
7
5
  export declare class Sessions extends APIResource {
8
- insights: InsightsAPI.Insights;
9
6
  /**
10
- * Create a new session.
7
+ * Create a new project.
11
8
  */
12
9
  create(params: SessionCreateParams, options?: RequestOptions): APIPromise<TracerSessionWithoutVirtualFields>;
13
10
  /**
14
- * Get a specific session.
11
+ * Get a specific project.
15
12
  */
16
- retrieve(sessionID: string, params?: SessionRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<TracerSession>;
13
+ retrieve(project_id: string, params?: SessionRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<TracerSession>;
17
14
  /**
18
- * Update a session.
15
+ * Update a project.
19
16
  */
20
- update(sessionID: string, body: SessionUpdateParams, options?: RequestOptions): APIPromise<TracerSessionWithoutVirtualFields>;
17
+ update(project_id: string, body: SessionUpdateParams, options?: RequestOptions): APIPromise<TracerSessionWithoutVirtualFields>;
21
18
  /**
22
- * Get all sessions.
19
+ * List all projects.
23
20
  */
24
21
  list(params?: SessionListParams | null | undefined, options?: RequestOptions): PagePromise<TracerSessionsOffsetPaginationTopLevelArray, TracerSession>;
25
22
  /**
26
- * Delete a specific session.
23
+ * Delete a specific project.
27
24
  */
28
- delete(sessionID: string, options?: RequestOptions): APIPromise<unknown>;
29
- /**
30
- * Get a prebuilt dashboard for a tracing project.
31
- */
32
- dashboard(sessionID: string, params: SessionDashboardParams, options?: RequestOptions): APIPromise<CustomChartsSection>;
25
+ delete(project_id: string, options?: RequestOptions): APIPromise<unknown>;
33
26
  }
34
27
  export type TracerSessionsOffsetPaginationTopLevelArray = OffsetPaginationTopLevelArray<TracerSession>;
35
28
  export interface CustomChartsSection {
@@ -388,7 +381,7 @@ export interface RunStatsGroupBy {
388
381
  max_groups?: number;
389
382
  path?: string | null;
390
383
  }
391
- export type SessionSortableColumns = 'name' | 'start_time' | 'last_run_start_time' | 'latency_p50' | 'latency_p99' | 'error_rate' | 'feedback' | 'runs_count';
384
+ export type SessionSortableColumns = 'name' | 'start_time' | 'last_run_start_time' | 'latency_p50' | 'latency_p99' | 'error_rate' | 'feedback';
392
385
  /**
393
386
  * Timedelta input.
394
387
  */
@@ -638,37 +631,6 @@ export interface SessionListParams extends OffsetPaginationTopLevelArrayParams {
638
631
  */
639
632
  accept?: string;
640
633
  }
641
- export interface SessionDashboardParams {
642
- /**
643
- * Body param
644
- */
645
- end_time?: string | null;
646
- /**
647
- * Body param: Group by param for run stats.
648
- */
649
- group_by?: RunStatsGroupBy | null;
650
- /**
651
- * Body param
652
- */
653
- omit_data?: boolean;
654
- /**
655
- * Body param
656
- */
657
- start_time?: string | null;
658
- /**
659
- * Body param: Timedelta input.
660
- */
661
- stride?: TimedeltaInput;
662
- /**
663
- * Body param
664
- */
665
- timezone?: string;
666
- /**
667
- * Header param
668
- */
669
- accept?: string;
670
- }
671
634
  export declare namespace Sessions {
672
- export { type CustomChartsSection as CustomChartsSection, type CustomChartsSectionRequest as CustomChartsSectionRequest, type RunStatsGroupBy as RunStatsGroupBy, type SessionSortableColumns as SessionSortableColumns, type TimedeltaInput as TimedeltaInput, type TracerSession as TracerSession, type TracerSessionWithoutVirtualFields as TracerSessionWithoutVirtualFields, type SessionDeleteResponse as SessionDeleteResponse, type TracerSessionsOffsetPaginationTopLevelArray as TracerSessionsOffsetPaginationTopLevelArray, type SessionCreateParams as SessionCreateParams, type SessionRetrieveParams as SessionRetrieveParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, type SessionDashboardParams as SessionDashboardParams, };
673
- export { Insights as Insights, type CreateRunClusteringJobRequest as CreateRunClusteringJobRequest, type InsightCreateResponse as InsightCreateResponse, type InsightUpdateResponse as InsightUpdateResponse, type InsightListResponse as InsightListResponse, type InsightDeleteResponse as InsightDeleteResponse, type InsightRetrieveJobResponse as InsightRetrieveJobResponse, type InsightRetrieveRunsResponse as InsightRetrieveRunsResponse, type InsightListResponsesOffsetPaginationInsightsClusteringJobs as InsightListResponsesOffsetPaginationInsightsClusteringJobs, type InsightCreateParams as InsightCreateParams, type InsightUpdateParams as InsightUpdateParams, type InsightListParams as InsightListParams, type InsightDeleteParams as InsightDeleteParams, type InsightRetrieveJobParams as InsightRetrieveJobParams, type InsightRetrieveRunsParams as InsightRetrieveRunsParams, };
635
+ export { type CustomChartsSection as CustomChartsSection, type CustomChartsSectionRequest as CustomChartsSectionRequest, type RunStatsGroupBy as RunStatsGroupBy, type SessionSortableColumns as SessionSortableColumns, type TimedeltaInput as TimedeltaInput, type TracerSession as TracerSession, type TracerSessionWithoutVirtualFields as TracerSessionWithoutVirtualFields, type SessionDeleteResponse as SessionDeleteResponse, type TracerSessionsOffsetPaginationTopLevelArray as TracerSessionsOffsetPaginationTopLevelArray, type SessionCreateParams as SessionCreateParams, type SessionRetrieveParams as SessionRetrieveParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, };
674
636
  }
@@ -0,0 +1,49 @@
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 { OffsetPaginationTopLevelArray, } from '../core/pagination.js';
5
+ import { buildHeaders } from '../internal/headers.js';
6
+ import { path } from '../internal/utils/path.js';
7
+ export class Sessions extends APIResource {
8
+ /**
9
+ * Create a new project.
10
+ */
11
+ create(params, options) {
12
+ const { upsert, ...body } = params;
13
+ return this._client.post('/api/v1/sessions', { query: { upsert }, body, ...options });
14
+ }
15
+ /**
16
+ * Get a specific project.
17
+ */
18
+ retrieve(project_id, params = {}, options) {
19
+ const { accept, ...query } = params ?? {};
20
+ return this._client.get(path `/api/v1/sessions/${project_id}`, {
21
+ query,
22
+ ...options,
23
+ headers: buildHeaders([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
24
+ });
25
+ }
26
+ /**
27
+ * Update a project.
28
+ */
29
+ update(project_id, body, options) {
30
+ return this._client.patch(path `/api/v1/sessions/${project_id}`, { body, ...options });
31
+ }
32
+ /**
33
+ * List all projects.
34
+ */
35
+ list(params = {}, options) {
36
+ const { accept, ...query } = params ?? {};
37
+ return this._client.getAPIList('/api/v1/sessions', (OffsetPaginationTopLevelArray), {
38
+ query,
39
+ ...options,
40
+ headers: buildHeaders([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
41
+ });
42
+ }
43
+ /**
44
+ * Delete a specific project.
45
+ */
46
+ delete(project_id, options) {
47
+ return this._client.delete(path `/api/v1/sessions/${project_id}`, options);
48
+ }
49
+ }
package/dist/client.cjs CHANGED
@@ -543,6 +543,12 @@ class Client {
543
543
  writable: true,
544
544
  value: void 0
545
545
  });
546
+ Object.defineProperty(this, "anonymizer", {
547
+ enumerable: true,
548
+ configurable: true,
549
+ writable: true,
550
+ value: void 0
551
+ });
546
552
  Object.defineProperty(this, "omitTracedRuntimeInfo", {
547
553
  enumerable: true,
548
554
  configurable: true,
@@ -794,6 +800,7 @@ class Client {
794
800
  this.hideOutputs =
795
801
  config.hideOutputs ?? config.anonymizer ?? defaultConfig.hideOutputs;
796
802
  this.hideMetadata = config.hideMetadata ?? defaultConfig.hideMetadata;
803
+ this.anonymizer = config.anonymizer;
797
804
  this.omitTracedRuntimeInfo = config.omitTracedRuntimeInfo ?? false;
798
805
  this.autoBatchTracing = config.autoBatchTracing ?? this.autoBatchTracing;
799
806
  this.autoBatchQueue = new AutoBatchQueue(maxMemory);
@@ -975,6 +982,14 @@ class Client {
975
982
  get sandboxes() {
976
983
  return this.openAPIClient.sandboxes;
977
984
  }
985
+ /** Access the projects resource. */
986
+ get projects() {
987
+ return this.openAPIClient.sessions;
988
+ }
989
+ /** Access the v2 datasets resource (experimentRuns, etc.). */
990
+ get datasets() {
991
+ return this.openAPIClient.datasets;
992
+ }
978
993
  async processInputs(inputs) {
979
994
  if (this.hideInputs === false) {
980
995
  return inputs;
@@ -1011,6 +1026,25 @@ class Client {
1011
1026
  }
1012
1027
  return metadata;
1013
1028
  }
1029
+ /**
1030
+ * Apply the configured anonymizer to a run's error string.
1031
+ *
1032
+ * Unlike inputs/outputs, `error` is a plain string (an exception message or
1033
+ * traceback) that can carry credentials the user never explicitly logged --
1034
+ * e.g. an HTTP-client error whose message embeds an `Authorization` header.
1035
+ * The anonymizer is typed `(KVMap) => KVMap`, so the string is wrapped as
1036
+ * `{ error }`, scrubbed, and unwrapped. Mirrors the Python SDK's
1037
+ * `Client._hide_run_error`.
1038
+ *
1039
+ * TODO: Update anonymizer to always nest inputs/outputs/error for consistency
1040
+ */
1041
+ async processError(error) {
1042
+ if (this.anonymizer == null) {
1043
+ return error;
1044
+ }
1045
+ const result = await this.anonymizer({ error });
1046
+ return typeof result?.error === "string" ? result.error : error;
1047
+ }
1014
1048
  /**
1015
1049
  * Filter content from new_token events to prevent streaming LLM output
1016
1050
  * from being uploaded via events.
@@ -1037,6 +1071,9 @@ class Client {
1037
1071
  if (runParams.outputs !== undefined) {
1038
1072
  runParams.outputs = await this.processOutputs(runParams.outputs);
1039
1073
  }
1074
+ if (runParams.error !== undefined) {
1075
+ runParams.error = await this.processError(runParams.error);
1076
+ }
1040
1077
  if (runParams.extra != null && "metadata" in runParams.extra) {
1041
1078
  runParams.extra = {
1042
1079
  ...runParams.extra,
@@ -1893,6 +1930,9 @@ class Client {
1893
1930
  if (run.outputs) {
1894
1931
  run.outputs = await this.processOutputs(run.outputs);
1895
1932
  }
1933
+ if (run.error) {
1934
+ run.error = await this.processError(run.error);
1935
+ }
1896
1936
  if (run.extra != null && "metadata" in run.extra) {
1897
1937
  run.extra = {
1898
1938
  ...run.extra,