langsmith 0.8.7 → 0.8.9

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 (83) hide show
  1. package/dist/_openapi_client/client.cjs +8 -0
  2. package/dist/_openapi_client/client.d.ts +3 -0
  3. package/dist/_openapi_client/client.js +8 -0
  4. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.cjs +157 -0
  5. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.d.ts +382 -0
  6. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.js +120 -0
  7. package/dist/_openapi_client/resources/annotation-queues/items.cjs +84 -0
  8. package/dist/_openapi_client/resources/annotation-queues/items.d.ts +207 -0
  9. package/dist/_openapi_client/resources/annotation-queues/items.js +80 -0
  10. package/dist/_openapi_client/resources/annotation-queues/runs.cjs +73 -0
  11. package/dist/_openapi_client/resources/annotation-queues/runs.d.ts +197 -0
  12. package/dist/_openapi_client/resources/annotation-queues/runs.js +69 -0
  13. package/dist/_openapi_client/resources/datasets/experiment-runs.cjs +3 -1
  14. package/dist/_openapi_client/resources/datasets/experiment-runs.d.ts +2 -0
  15. package/dist/_openapi_client/resources/datasets/experiment-runs.js +3 -1
  16. package/dist/_openapi_client/resources/index.cjs +3 -1
  17. package/dist/_openapi_client/resources/index.d.ts +1 -0
  18. package/dist/_openapi_client/resources/index.js +1 -0
  19. package/dist/_openapi_client/resources/info.cjs +3 -1
  20. package/dist/_openapi_client/resources/info.d.ts +16 -22
  21. package/dist/_openapi_client/resources/info.js +3 -1
  22. package/dist/_openapi_client/resources/issues.cjs +2 -2
  23. package/dist/_openapi_client/resources/issues.d.ts +1 -1
  24. package/dist/_openapi_client/resources/issues.js +2 -2
  25. package/dist/_openapi_client/resources/online-evaluators.cjs +7 -7
  26. package/dist/_openapi_client/resources/online-evaluators.d.ts +8 -0
  27. package/dist/_openapi_client/resources/online-evaluators.js +7 -7
  28. package/dist/_openapi_client/resources/public/runs.cjs +10 -8
  29. package/dist/_openapi_client/resources/public/runs.d.ts +9 -7
  30. package/dist/_openapi_client/resources/public/runs.js +10 -8
  31. package/dist/_openapi_client/resources/runs/runs.cjs +14 -9
  32. package/dist/_openapi_client/resources/runs/runs.d.ts +20 -10
  33. package/dist/_openapi_client/resources/runs/runs.js +14 -9
  34. package/dist/_openapi_client/resources/runs/share.cjs +6 -2
  35. package/dist/_openapi_client/resources/runs/share.d.ts +4 -0
  36. package/dist/_openapi_client/resources/runs/share.js +6 -2
  37. package/dist/_openapi_client/resources/sandboxes/boxes.cjs +10 -10
  38. package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +40 -0
  39. package/dist/_openapi_client/resources/sandboxes/boxes.js +10 -10
  40. package/dist/_openapi_client/resources/sandboxes/registries.cjs +5 -5
  41. package/dist/_openapi_client/resources/sandboxes/registries.js +5 -5
  42. package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +17 -0
  43. package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +4 -4
  44. package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +12 -0
  45. package/dist/_openapi_client/resources/sandboxes/snapshots.js +4 -4
  46. package/dist/_openapi_client/resources/threads.cjs +14 -11
  47. package/dist/_openapi_client/resources/threads.d.ts +13 -9
  48. package/dist/_openapi_client/resources/threads.js +14 -11
  49. package/dist/_openapi_client/resources/traces.cjs +8 -5
  50. package/dist/_openapi_client/resources/traces.d.ts +7 -4
  51. package/dist/_openapi_client/resources/traces.js +8 -5
  52. package/dist/client.cjs +318 -40
  53. package/dist/client.d.ts +111 -25
  54. package/dist/client.js +318 -40
  55. package/dist/evaluation/evaluate_comparative.cjs +7 -4
  56. package/dist/evaluation/evaluate_comparative.js +7 -4
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/sandbox/command_handle.cjs +38 -11
  61. package/dist/sandbox/command_handle.d.ts +1 -0
  62. package/dist/sandbox/command_handle.js +39 -12
  63. package/dist/sandbox/errors.cjs +16 -1
  64. package/dist/sandbox/errors.d.ts +11 -0
  65. package/dist/sandbox/errors.js +14 -0
  66. package/dist/sandbox/index.cjs +2 -1
  67. package/dist/sandbox/index.d.ts +1 -1
  68. package/dist/sandbox/index.js +1 -1
  69. package/dist/sandbox/sandbox.cjs +22 -4
  70. package/dist/sandbox/sandbox.js +24 -6
  71. package/dist/sandbox/ws_execute.cjs +82 -11
  72. package/dist/sandbox/ws_execute.d.ts +12 -2
  73. package/dist/sandbox/ws_execute.js +79 -11
  74. package/dist/utils/v2_migration.cjs +18 -0
  75. package/dist/utils/v2_migration.d.ts +8 -0
  76. package/dist/utils/v2_migration.js +16 -0
  77. package/dist/utils/warn.cjs +30 -4
  78. package/dist/utils/warn.d.ts +4 -1
  79. package/dist/utils/warn.js +29 -4
  80. package/package.json +1 -1
  81. package/dist/utils/constants.cjs +0 -4
  82. package/dist/utils/constants.d.ts +0 -1
  83. package/dist/utils/constants.js +0 -1
@@ -4,9 +4,10 @@ import { RequestOptions } from '../../internal/request-options.js';
4
4
  import * as RunsAPI_ from '../runs/runs.js';
5
5
  export declare class Runs extends APIResource {
6
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.
7
+ * Returns one run within the trace identified by the share token. The request
8
+ * supplies only the run ID and that run's exact start_time coordinate.
9
+ *
10
+ * Self-hosted deployments require LangSmith `v0.16` or later.
10
11
  *
11
12
  * @example
12
13
  * ```ts
@@ -22,9 +23,10 @@ export declare class Runs extends APIResource {
22
23
  */
23
24
  retrieve(runID: string, params: RunRetrieveParams, options?: RequestOptions): APIPromise<RunsAPI_.Run>;
24
25
  /**
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.
26
+ * Returns all runs within the trace identified by the share token. The share token
27
+ * supplies the tenant, project, and trace scope.
28
+ *
29
+ * Self-hosted deployments require LangSmith `v0.16` or later.
28
30
  *
29
31
  * @example
30
32
  * ```ts
@@ -65,7 +67,7 @@ export interface RunQueryParams {
65
67
  * Body param: `selects` lists which public run properties to include on each
66
68
  * returned run.
67
69
  */
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'>;
70
+ 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' | 'FEEDBACK_STATS'>;
69
71
  /**
70
72
  * Header param: application/json
71
73
  */
@@ -5,9 +5,10 @@ import { buildHeaders } from '../../internal/headers.js';
5
5
  import { path } from '../../internal/utils/path.js';
6
6
  export class Runs extends APIResource {
7
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.
8
+ * Returns one run within the trace identified by the share token. The request
9
+ * supplies only the run ID and that run's exact start_time coordinate.
10
+ *
11
+ * Self-hosted deployments require LangSmith `v0.16` or later.
11
12
  *
12
13
  * @example
13
14
  * ```ts
@@ -23,16 +24,17 @@ export class Runs extends APIResource {
23
24
  */
24
25
  retrieve(runID, params, options) {
25
26
  const { share_token, Accept, ...query } = params;
26
- return this._client.get(path `/v2/public/${share_token}/run/${runID}`, {
27
+ return this._client.get(path `/api/v2/public/${share_token}/run/${runID}`, {
27
28
  query,
28
29
  ...options,
29
30
  headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
30
31
  });
31
32
  }
32
33
  /**
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.
34
+ * Returns all runs within the trace identified by the share token. The share token
35
+ * supplies the tenant, project, and trace scope.
36
+ *
37
+ * Self-hosted deployments require LangSmith `v0.16` or later.
36
38
  *
37
39
  * @example
38
40
  * ```ts
@@ -43,7 +45,7 @@ export class Runs extends APIResource {
43
45
  */
44
46
  query(shareToken, params, options) {
45
47
  const { Accept, ...body } = params;
46
- return this._client.post(path `/v2/public/${shareToken}/runs/v2/query`, {
48
+ return this._client.post(path `/api/v2/public/${shareToken}/runs/query`, {
47
49
  body,
48
50
  ...options,
49
51
  headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
@@ -69,6 +69,8 @@ class Runs extends resource_js_1.APIResource {
69
69
  * supply the run's project_id and trace_id as query parameters; start_time is
70
70
  * optional.
71
71
  *
72
+ * Self-hosted deployments require LangSmith `v0.16` or later.
73
+ *
72
74
  * @example
73
75
  * ```ts
74
76
  * const response = await client.runs.getURL(
@@ -78,12 +80,14 @@ class Runs extends resource_js_1.APIResource {
78
80
  * ```
79
81
  */
80
82
  getURL(runID, query, options) {
81
- return this._client.get((0, path_js_1.path) `/v2/runs/${runID}/url`, { query, ...options });
83
+ return this._client.get((0, path_js_1.path) `/api/v2/runs/${runID}/url`, { query, ...options });
82
84
  }
83
85
  /**
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.
86
+ * Returns a paginated list of runs for the given projects within min/max
87
+ * start_time. Supports filters, cursor pagination, and `selects` to select fields
88
+ * to return.
89
+ *
90
+ * Self-hosted deployments require LangSmith `v0.16` or later.
87
91
  *
88
92
  * @example
89
93
  * ```ts
@@ -95,7 +99,7 @@ class Runs extends resource_js_1.APIResource {
95
99
  */
96
100
  queryV2(params, options) {
97
101
  const { Accept, ...body } = params;
98
- return this._client.getAPIList('/v2/runs/query', (pagination_js_1.ItemsCursorPostPagination), {
102
+ return this._client.getAPIList('/api/v2/runs/query', (pagination_js_1.ItemsCursorPostPagination), {
99
103
  body,
100
104
  method: 'post',
101
105
  ...options,
@@ -103,9 +107,10 @@ class Runs extends resource_js_1.APIResource {
103
107
  });
104
108
  }
105
109
  /**
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.
110
+ * Returns one run by ID for the given session. Use the `selects` query parameter
111
+ * (repeatable) to select fields to return.
112
+ *
113
+ * Self-hosted deployments require LangSmith `v0.16` or later.
109
114
  *
110
115
  * @example
111
116
  * ```ts
@@ -117,7 +122,7 @@ class Runs extends resource_js_1.APIResource {
117
122
  */
118
123
  retrieveV2(runID, params, options) {
119
124
  const { Accept, ...query } = params;
120
- return this._client.get((0, path_js_1.path) `/v2/runs/${runID}`, {
125
+ return this._client.get((0, path_js_1.path) `/api/v2/runs/${runID}`, {
121
126
  query,
122
127
  ...options,
123
128
  headers: (0, headers_js_1.buildHeaders)([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
@@ -11,6 +11,8 @@ export declare class Runs extends APIResource {
11
11
  * supply the run's project_id and trace_id as query parameters; start_time is
12
12
  * optional.
13
13
  *
14
+ * Self-hosted deployments require LangSmith `v0.16` or later.
15
+ *
14
16
  * @example
15
17
  * ```ts
16
18
  * const response = await client.runs.getURL(
@@ -21,9 +23,11 @@ export declare class Runs extends APIResource {
21
23
  */
22
24
  getURL(runID: string, query: RunGetURLParams, options?: RequestOptions): APIPromise<RunGetURLResponse>;
23
25
  /**
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.
26
+ * Returns a paginated list of runs for the given projects within min/max
27
+ * start_time. Supports filters, cursor pagination, and `selects` to select fields
28
+ * to return.
29
+ *
30
+ * Self-hosted deployments require LangSmith `v0.16` or later.
27
31
  *
28
32
  * @example
29
33
  * ```ts
@@ -35,9 +39,10 @@ export declare class Runs extends APIResource {
35
39
  */
36
40
  queryV2(params: RunQueryV2Params, options?: RequestOptions): PagePromise<RunsItemsCursorPostPagination, Run>;
37
41
  /**
38
- * **Alpha:** The request and response contract may change; Returns one run by ID
39
- * for the given session. Use the `selects` query parameter (repeatable) to select
40
- * fields to return.
42
+ * Returns one run by ID for the given session. Use the `selects` query parameter
43
+ * (repeatable) to select fields to return.
44
+ *
45
+ * Self-hosted deployments require LangSmith `v0.16` or later.
41
46
  *
42
47
  * @example
43
48
  * ```ts
@@ -150,6 +155,11 @@ export interface Run {
150
155
  * `is_root` is true when this run has no parent (it is the trace root).
151
156
  */
152
157
  is_root?: boolean;
158
+ /**
159
+ * `last_queued_at` is the most recent time this run was added to an annotation
160
+ * queue.
161
+ */
162
+ last_queued_at?: string;
153
163
  /**
154
164
  * `latency_seconds` is wall-clock duration from start to end in seconds.
155
165
  */
@@ -545,11 +555,12 @@ export interface RunSchema {
545
555
  trace_upgrade?: boolean;
546
556
  ttl_seconds?: number | null;
547
557
  }
548
- export type RunSelectField = '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';
558
+ export type RunSelectField = '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' | 'LAST_QUEUED_AT' | 'SHARE_URL' | 'FEEDBACK_STATS';
549
559
  /**
550
560
  * Query params for run stats.
551
561
  */
552
562
  export interface RunStatsQueryParams {
563
+ session: Array<string>;
553
564
  id?: Array<string> | null;
554
565
  /**
555
566
  * Enum for run data source types.
@@ -576,7 +587,6 @@ export interface RunStatsQueryParams {
576
587
  run_type?: RunTypeEnum | null;
577
588
  search_filter?: string | null;
578
589
  select?: Array<'run_count' | 'latency_p50' | 'latency_p99' | 'latency_avg' | 'first_token_p50' | 'first_token_p99' | 'total_tokens' | 'prompt_tokens' | 'completion_tokens' | 'median_tokens' | 'completion_tokens_p50' | 'prompt_tokens_p50' | 'tokens_p99' | 'completion_tokens_p99' | 'prompt_tokens_p99' | 'last_run_start_time' | 'feedback_stats' | 'thread_feedback_stats' | 'run_facets' | 'error_rate' | 'streaming_rate' | 'total_cost' | 'prompt_cost' | 'completion_cost' | 'cost_p50' | 'cost_p99' | 'session_feedback_stats' | 'all_run_stats' | 'all_token_stats' | 'group_count' | 'prompt_token_details' | 'completion_token_details' | 'prompt_cost_details' | 'completion_cost_details'> | null;
579
- session?: Array<string> | null;
580
590
  skip_pagination?: boolean | null;
581
591
  start_time?: string | null;
582
592
  /**
@@ -725,7 +735,7 @@ export interface RunRetrieveV2Params {
725
735
  * (repeatable query parameter). Accepts any value of the `RunSelectField` enum. If
726
736
  * omitted, only `id` is returned.
727
737
  */
728
- 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'>;
738
+ 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' | 'LAST_QUEUED_AT' | 'SHARE_URL' | 'FEEDBACK_STATS'>;
729
739
  /**
730
740
  * Query param: `start_time` is the run's `start_time` (RFC3339 date-time).
731
741
  * Providing it speeds up retrieval.
@@ -746,7 +756,7 @@ export interface RunRetrieveParams {
746
756
  * (repeatable query parameter). Accepts any value of the `RunSelectField` enum. If
747
757
  * omitted, only `id` is returned.
748
758
  */
749
- 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'>;
759
+ 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' | 'LAST_QUEUED_AT' | 'SHARE_URL' | 'FEEDBACK_STATS'>;
750
760
  /**
751
761
  * Query param: `start_time` is the run's `start_time` (RFC3339 date-time).
752
762
  * Providing it speeds up retrieval.
@@ -33,6 +33,8 @@ export class Runs extends APIResource {
33
33
  * supply the run's project_id and trace_id as query parameters; start_time is
34
34
  * optional.
35
35
  *
36
+ * Self-hosted deployments require LangSmith `v0.16` or later.
37
+ *
36
38
  * @example
37
39
  * ```ts
38
40
  * const response = await client.runs.getURL(
@@ -42,12 +44,14 @@ export class Runs extends APIResource {
42
44
  * ```
43
45
  */
44
46
  getURL(runID, query, options) {
45
- return this._client.get(path `/v2/runs/${runID}/url`, { query, ...options });
47
+ return this._client.get(path `/api/v2/runs/${runID}/url`, { query, ...options });
46
48
  }
47
49
  /**
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.
50
+ * Returns a paginated list of runs for the given projects within min/max
51
+ * start_time. Supports filters, cursor pagination, and `selects` to select fields
52
+ * to return.
53
+ *
54
+ * Self-hosted deployments require LangSmith `v0.16` or later.
51
55
  *
52
56
  * @example
53
57
  * ```ts
@@ -59,7 +63,7 @@ export class Runs extends APIResource {
59
63
  */
60
64
  queryV2(params, options) {
61
65
  const { Accept, ...body } = params;
62
- return this._client.getAPIList('/v2/runs/query', (ItemsCursorPostPagination), {
66
+ return this._client.getAPIList('/api/v2/runs/query', (ItemsCursorPostPagination), {
63
67
  body,
64
68
  method: 'post',
65
69
  ...options,
@@ -67,9 +71,10 @@ export class Runs extends APIResource {
67
71
  });
68
72
  }
69
73
  /**
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.
74
+ * Returns one run by ID for the given session. Use the `selects` query parameter
75
+ * (repeatable) to select fields to return.
76
+ *
77
+ * Self-hosted deployments require LangSmith `v0.16` or later.
73
78
  *
74
79
  * @example
75
80
  * ```ts
@@ -81,7 +86,7 @@ export class Runs extends APIResource {
81
86
  */
82
87
  retrieveV2(runID, params, options) {
83
88
  const { Accept, ...query } = params;
84
- return this._client.get(path `/v2/runs/${runID}`, {
89
+ return this._client.get(path `/api/v2/runs/${runID}`, {
85
90
  query,
86
91
  ...options,
87
92
  headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
@@ -10,6 +10,8 @@ class Share extends resource_js_1.APIResource {
10
10
  /**
11
11
  * Creates or returns a share token for a run. Child runs share their trace root.
12
12
  *
13
+ * Self-hosted deployments require LangSmith `v0.16` or later.
14
+ *
13
15
  * @example
14
16
  * ```ts
15
17
  * const share = await client.runs.share.create(
@@ -18,12 +20,14 @@ class Share extends resource_js_1.APIResource {
18
20
  * ```
19
21
  */
20
22
  create(runID, body, options) {
21
- return this._client.post((0, path_js_1.path) `/v2/runs/${runID}/share`, { body, ...options });
23
+ return this._client.post((0, path_js_1.path) `/api/v2/runs/${runID}/share`, { body, ...options });
22
24
  }
23
25
  /**
24
26
  * Deletes the share token for the trace identified by trace_id and session_id.
25
27
  * Idempotent: returns 204 whether or not a share token existed.
26
28
  *
29
+ * Self-hosted deployments require LangSmith `v0.16` or later.
30
+ *
27
31
  * @example
28
32
  * ```ts
29
33
  * await client.runs.share.delete(
@@ -32,7 +36,7 @@ class Share extends resource_js_1.APIResource {
32
36
  * ```
33
37
  */
34
38
  delete(traceID, body, options) {
35
- return this._client.delete((0, path_js_1.path) `/v2/runs/${traceID}/share`, {
39
+ return this._client.delete((0, path_js_1.path) `/api/v2/runs/${traceID}/share`, {
36
40
  body,
37
41
  ...options,
38
42
  headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
@@ -5,6 +5,8 @@ export declare class Share extends APIResource {
5
5
  /**
6
6
  * Creates or returns a share token for a run. Child runs share their trace root.
7
7
  *
8
+ * Self-hosted deployments require LangSmith `v0.16` or later.
9
+ *
8
10
  * @example
9
11
  * ```ts
10
12
  * const share = await client.runs.share.create(
@@ -17,6 +19,8 @@ export declare class Share extends APIResource {
17
19
  * Deletes the share token for the trace identified by trace_id and session_id.
18
20
  * Idempotent: returns 204 whether or not a share token existed.
19
21
  *
22
+ * Self-hosted deployments require LangSmith `v0.16` or later.
23
+ *
20
24
  * @example
21
25
  * ```ts
22
26
  * await client.runs.share.delete(
@@ -7,6 +7,8 @@ export class Share extends APIResource {
7
7
  /**
8
8
  * Creates or returns a share token for a run. Child runs share their trace root.
9
9
  *
10
+ * Self-hosted deployments require LangSmith `v0.16` or later.
11
+ *
10
12
  * @example
11
13
  * ```ts
12
14
  * const share = await client.runs.share.create(
@@ -15,12 +17,14 @@ export class Share extends APIResource {
15
17
  * ```
16
18
  */
17
19
  create(runID, body, options) {
18
- return this._client.post(path `/v2/runs/${runID}/share`, { body, ...options });
20
+ return this._client.post(path `/api/v2/runs/${runID}/share`, { body, ...options });
19
21
  }
20
22
  /**
21
23
  * Deletes the share token for the trace identified by trace_id and session_id.
22
24
  * Idempotent: returns 204 whether or not a share token existed.
23
25
  *
26
+ * Self-hosted deployments require LangSmith `v0.16` or later.
27
+ *
24
28
  * @example
25
29
  * ```ts
26
30
  * await client.runs.share.delete(
@@ -29,7 +33,7 @@ export class Share extends APIResource {
29
33
  * ```
30
34
  */
31
35
  delete(traceID, body, options) {
32
- return this._client.delete(path `/v2/runs/${traceID}/share`, {
36
+ return this._client.delete(path `/api/v2/runs/${traceID}/share`, {
33
37
  body,
34
38
  ...options,
35
39
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
@@ -12,33 +12,33 @@ class Boxes extends resource_js_1.APIResource {
12
12
  * `snapshot_name`; if neither is provided, the server uses the default snapshot.
13
13
  */
14
14
  create(body, options) {
15
- return this._client.post('/v2/sandboxes/boxes', { body, ...options });
15
+ return this._client.post('/api/v2/sandboxes/boxes', { body, ...options });
16
16
  }
17
17
  /**
18
18
  * Retrieve a sandbox by name. Stale provisioning sandboxes are auto-failed.
19
19
  */
20
20
  retrieve(name, options) {
21
- return this._client.get((0, path_js_1.path) `/v2/sandboxes/boxes/${name}`, options);
21
+ return this._client.get((0, path_js_1.path) `/api/v2/sandboxes/boxes/${name}`, options);
22
22
  }
23
23
  /**
24
24
  * Update a sandbox's display name. The name must be unique within the tenant.
25
25
  */
26
26
  update(name, body, options) {
27
- return this._client.patch((0, path_js_1.path) `/v2/sandboxes/boxes/${name}`, { body, ...options });
27
+ return this._client.patch((0, path_js_1.path) `/api/v2/sandboxes/boxes/${name}`, { body, ...options });
28
28
  }
29
29
  /**
30
30
  * List sandboxes for the authenticated tenant, with optional filtering, sorting,
31
31
  * and pagination.
32
32
  */
33
33
  list(query = {}, options) {
34
- return this._client.get('/v2/sandboxes/boxes', { query, ...options });
34
+ return this._client.get('/api/v2/sandboxes/boxes', { query, ...options });
35
35
  }
36
36
  /**
37
37
  * Delete a sandbox by name or UUID. Tears down the sandbox runtime and removes the
38
38
  * DB record.
39
39
  */
40
40
  delete(name, options) {
41
- return this._client.delete((0, path_js_1.path) `/v2/sandboxes/boxes/${name}`, {
41
+ return this._client.delete((0, path_js_1.path) `/api/v2/sandboxes/boxes/${name}`, {
42
42
  ...options,
43
43
  headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
44
44
  });
@@ -48,7 +48,7 @@ class Boxes extends resource_js_1.APIResource {
48
48
  * existing checkpoint.
49
49
  */
50
50
  createSnapshot(name, body, options) {
51
- return this._client.post((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/snapshot`, { body, ...options });
51
+ return this._client.post((0, path_js_1.path) `/api/v2/sandboxes/boxes/${name}/snapshot`, { body, ...options });
52
52
  }
53
53
  /**
54
54
  * Create a short-lived JWT for accessing an HTTP service running on a specific
@@ -57,26 +57,26 @@ class Boxes extends resource_js_1.APIResource {
57
57
  * token, and its expiry.
58
58
  */
59
59
  generateServiceURL(name, body, options) {
60
- return this._client.post((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/service-url`, { body, ...options });
60
+ return this._client.post((0, path_js_1.path) `/api/v2/sandboxes/boxes/${name}/service-url`, { body, ...options });
61
61
  }
62
62
  /**
63
63
  * Retrieve the lightweight status of a sandbox for polling.
64
64
  */
65
65
  getStatus(name, options) {
66
- return this._client.get((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/status`, options);
66
+ return this._client.get((0, path_js_1.path) `/api/v2/sandboxes/boxes/${name}/status`, options);
67
67
  }
68
68
  /**
69
69
  * Start a stopped or failed sandbox. This endpoint is not idempotent.
70
70
  */
71
71
  start(name, options) {
72
- return this._client.post((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/start`, options);
72
+ return this._client.post((0, path_js_1.path) `/api/v2/sandboxes/boxes/${name}/start`, options);
73
73
  }
74
74
  /**
75
75
  * Stop a ready sandbox. This endpoint is not idempotent; the filesystem is
76
76
  * preserved for later restart.
77
77
  */
78
78
  stop(name, options) {
79
- return this._client.post((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/stop`, {
79
+ return this._client.post((0, path_js_1.path) `/api/v2/sandboxes/boxes/${name}/stop`, {
80
80
  ...options,
81
81
  headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
82
82
  });
@@ -65,6 +65,13 @@ export interface BoxCreateParams {
65
65
  };
66
66
  fs_capacity_bytes?: number;
67
67
  idle_ttl_seconds?: number;
68
+ /**
69
+ * Labels are free-form key/value metadata persisted with the sandbox and returned
70
+ * on reads. Labels from the source snapshot are inherited unless overridden here.
71
+ */
72
+ labels?: {
73
+ [key: string]: string;
74
+ };
68
75
  mem_bytes?: number;
69
76
  mount_config?: BoxCreateParams.MountConfig;
70
77
  name?: string;
@@ -369,6 +376,17 @@ export declare namespace BoxCreateParams {
369
376
  name: string;
370
377
  aws?: Rule.Aws;
371
378
  enabled?: boolean;
379
+ /**
380
+ * EnvVars are plaintext env vars set for every command in the sandbox while this
381
+ * rule is enabled. Use them for tools that refuse to run unless a credential env
382
+ * var is present (e.g. gh needs GH_TOKEN) even though this rule injects the real
383
+ * credential on the wire — set a dummy value here so the command starts. Explicit
384
+ * per-sandbox env_vars win over these, and provider-managed (AWS/GCP) vars win
385
+ * over both.
386
+ */
387
+ env_vars?: {
388
+ [key: string]: string;
389
+ };
372
390
  gcp?: Rule.Gcp;
373
391
  headers?: Array<Rule.Header>;
374
392
  /**
@@ -458,6 +476,17 @@ export declare namespace BoxUpdateParams {
458
476
  name: string;
459
477
  aws?: Rule.Aws;
460
478
  enabled?: boolean;
479
+ /**
480
+ * EnvVars are plaintext env vars set for every command in the sandbox while this
481
+ * rule is enabled. Use them for tools that refuse to run unless a credential env
482
+ * var is present (e.g. gh needs GH_TOKEN) even though this rule injects the real
483
+ * credential on the wire — set a dummy value here so the command starts. Explicit
484
+ * per-sandbox env_vars win over these, and provider-managed (AWS/GCP) vars win
485
+ * over both.
486
+ */
487
+ env_vars?: {
488
+ [key: string]: string;
489
+ };
461
490
  gcp?: Rule.Gcp;
462
491
  headers?: Array<Rule.Header>;
463
492
  /**
@@ -510,6 +539,11 @@ export interface BoxListParams {
510
539
  * Filter by creator identity. Only 'me' is supported.
511
540
  */
512
541
  created_by?: string;
542
+ /**
543
+ * Filter by label. Repeatable; all must match. Use 'key' to match on key presence
544
+ * or 'key=value' for equality.
545
+ */
546
+ label?: Array<string>;
513
547
  /**
514
548
  * Maximum number of results
515
549
  */
@@ -556,6 +590,12 @@ export interface BoxCreateSnapshotParams {
556
590
  * snapshots small unless memory restore is explicitly desired.
557
591
  */
558
592
  include_memory?: boolean;
593
+ /**
594
+ * Labels seed the captured snapshot's labels.
595
+ */
596
+ labels?: {
597
+ [key: string]: string;
598
+ };
559
599
  }
560
600
  export interface BoxGenerateServiceURLParams {
561
601
  expires_in_seconds?: number;
@@ -9,33 +9,33 @@ export class Boxes extends APIResource {
9
9
  * `snapshot_name`; if neither is provided, the server uses the default snapshot.
10
10
  */
11
11
  create(body, options) {
12
- return this._client.post('/v2/sandboxes/boxes', { body, ...options });
12
+ return this._client.post('/api/v2/sandboxes/boxes', { body, ...options });
13
13
  }
14
14
  /**
15
15
  * Retrieve a sandbox by name. Stale provisioning sandboxes are auto-failed.
16
16
  */
17
17
  retrieve(name, options) {
18
- return this._client.get(path `/v2/sandboxes/boxes/${name}`, options);
18
+ return this._client.get(path `/api/v2/sandboxes/boxes/${name}`, options);
19
19
  }
20
20
  /**
21
21
  * Update a sandbox's display name. The name must be unique within the tenant.
22
22
  */
23
23
  update(name, body, options) {
24
- return this._client.patch(path `/v2/sandboxes/boxes/${name}`, { body, ...options });
24
+ return this._client.patch(path `/api/v2/sandboxes/boxes/${name}`, { body, ...options });
25
25
  }
26
26
  /**
27
27
  * List sandboxes for the authenticated tenant, with optional filtering, sorting,
28
28
  * and pagination.
29
29
  */
30
30
  list(query = {}, options) {
31
- return this._client.get('/v2/sandboxes/boxes', { query, ...options });
31
+ return this._client.get('/api/v2/sandboxes/boxes', { query, ...options });
32
32
  }
33
33
  /**
34
34
  * Delete a sandbox by name or UUID. Tears down the sandbox runtime and removes the
35
35
  * DB record.
36
36
  */
37
37
  delete(name, options) {
38
- return this._client.delete(path `/v2/sandboxes/boxes/${name}`, {
38
+ return this._client.delete(path `/api/v2/sandboxes/boxes/${name}`, {
39
39
  ...options,
40
40
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
41
41
  });
@@ -45,7 +45,7 @@ export class Boxes extends APIResource {
45
45
  * existing checkpoint.
46
46
  */
47
47
  createSnapshot(name, body, options) {
48
- return this._client.post(path `/v2/sandboxes/boxes/${name}/snapshot`, { body, ...options });
48
+ return this._client.post(path `/api/v2/sandboxes/boxes/${name}/snapshot`, { body, ...options });
49
49
  }
50
50
  /**
51
51
  * Create a short-lived JWT for accessing an HTTP service running on a specific
@@ -54,26 +54,26 @@ export class Boxes extends APIResource {
54
54
  * token, and its expiry.
55
55
  */
56
56
  generateServiceURL(name, body, options) {
57
- return this._client.post(path `/v2/sandboxes/boxes/${name}/service-url`, { body, ...options });
57
+ return this._client.post(path `/api/v2/sandboxes/boxes/${name}/service-url`, { body, ...options });
58
58
  }
59
59
  /**
60
60
  * Retrieve the lightweight status of a sandbox for polling.
61
61
  */
62
62
  getStatus(name, options) {
63
- return this._client.get(path `/v2/sandboxes/boxes/${name}/status`, options);
63
+ return this._client.get(path `/api/v2/sandboxes/boxes/${name}/status`, options);
64
64
  }
65
65
  /**
66
66
  * Start a stopped or failed sandbox. This endpoint is not idempotent.
67
67
  */
68
68
  start(name, options) {
69
- return this._client.post(path `/v2/sandboxes/boxes/${name}/start`, options);
69
+ return this._client.post(path `/api/v2/sandboxes/boxes/${name}/start`, options);
70
70
  }
71
71
  /**
72
72
  * Stop a ready sandbox. This endpoint is not idempotent; the filesystem is
73
73
  * preserved for later restart.
74
74
  */
75
75
  stop(name, options) {
76
- return this._client.post(path `/v2/sandboxes/boxes/${name}/stop`, {
76
+ return this._client.post(path `/api/v2/sandboxes/boxes/${name}/stop`, {
77
77
  ...options,
78
78
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
79
79
  });