langsmith 0.7.9 → 0.7.11

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 (99) hide show
  1. package/README.md +46 -15
  2. package/dist/_openapi_client/client.cjs +0 -88
  3. package/dist/_openapi_client/client.d.ts +0 -33
  4. package/dist/_openapi_client/client.js +0 -88
  5. package/dist/_openapi_client/internal/headers.d.ts +13 -0
  6. package/dist/_openapi_client/internal/types.d.ts +1 -28
  7. package/dist/_openapi_client/resources/datasets/datasets.d.ts +52 -4
  8. package/dist/_openapi_client/resources/datasets/runs.d.ts +1 -2
  9. package/dist/_openapi_client/resources/index.cjs +1 -23
  10. package/dist/_openapi_client/resources/index.d.ts +0 -11
  11. package/dist/_openapi_client/resources/index.js +0 -11
  12. package/dist/anonymizer/index.cjs +142 -0
  13. package/dist/anonymizer/index.d.ts +45 -0
  14. package/dist/anonymizer/index.js +140 -0
  15. package/dist/client.cjs +26 -1
  16. package/dist/client.d.ts +4 -1
  17. package/dist/client.js +25 -1
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/sandbox/client.cjs +5 -8
  22. package/dist/sandbox/client.js +5 -8
  23. package/dist/sandbox/index.cjs +2 -1
  24. package/dist/sandbox/index.d.ts +2 -2
  25. package/dist/sandbox/index.js +1 -1
  26. package/dist/sandbox/mounts.cjs +157 -18
  27. package/dist/sandbox/mounts.d.ts +10 -2
  28. package/dist/sandbox/mounts.js +155 -18
  29. package/dist/sandbox/proxy_config.cjs +19 -44
  30. package/dist/sandbox/proxy_config.d.ts +2 -4
  31. package/dist/sandbox/proxy_config.js +19 -43
  32. package/dist/sandbox/types.d.ts +56 -15
  33. package/dist/utils/constants.cjs +4 -0
  34. package/dist/utils/constants.d.ts +1 -0
  35. package/dist/utils/constants.js +1 -0
  36. package/package.json +2 -2
  37. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.cjs +0 -138
  38. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.d.ts +0 -367
  39. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.js +0 -101
  40. package/dist/_openapi_client/resources/annotation-queues/runs.cjs +0 -46
  41. package/dist/_openapi_client/resources/annotation-queues/runs.d.ts +0 -128
  42. package/dist/_openapi_client/resources/annotation-queues/runs.js +0 -42
  43. package/dist/_openapi_client/resources/commits.cjs +0 -44
  44. package/dist/_openapi_client/resources/commits.d.ts +0 -204
  45. package/dist/_openapi_client/resources/commits.js +0 -40
  46. package/dist/_openapi_client/resources/evaluators.cjs +0 -15
  47. package/dist/_openapi_client/resources/evaluators.d.ts +0 -125
  48. package/dist/_openapi_client/resources/evaluators.js +0 -11
  49. package/dist/_openapi_client/resources/examples/bulk.cjs +0 -24
  50. package/dist/_openapi_client/resources/examples/bulk.d.ts +0 -78
  51. package/dist/_openapi_client/resources/examples/bulk.js +0 -20
  52. package/dist/_openapi_client/resources/examples/examples.cjs +0 -124
  53. package/dist/_openapi_client/resources/examples/examples.d.ts +0 -182
  54. package/dist/_openapi_client/resources/examples/examples.js +0 -87
  55. package/dist/_openapi_client/resources/examples/validate.cjs +0 -21
  56. package/dist/_openapi_client/resources/examples/validate.d.ts +0 -38
  57. package/dist/_openapi_client/resources/examples/validate.js +0 -17
  58. package/dist/_openapi_client/resources/feedback/configs.cjs +0 -24
  59. package/dist/_openapi_client/resources/feedback/configs.d.ts +0 -18
  60. package/dist/_openapi_client/resources/feedback/configs.js +0 -20
  61. package/dist/_openapi_client/resources/feedback/feedback.cjs +0 -98
  62. package/dist/_openapi_client/resources/feedback/feedback.d.ts +0 -275
  63. package/dist/_openapi_client/resources/feedback/feedback.js +0 -61
  64. package/dist/_openapi_client/resources/feedback/tokens.cjs +0 -35
  65. package/dist/_openapi_client/resources/feedback/tokens.d.ts +0 -130
  66. package/dist/_openapi_client/resources/feedback/tokens.js +0 -31
  67. package/dist/_openapi_client/resources/public/datasets.cjs +0 -47
  68. package/dist/_openapi_client/resources/public/datasets.d.ts +0 -152
  69. package/dist/_openapi_client/resources/public/datasets.js +0 -43
  70. package/dist/_openapi_client/resources/public/public.cjs +0 -62
  71. package/dist/_openapi_client/resources/public/public.d.ts +0 -32
  72. package/dist/_openapi_client/resources/public/public.js +0 -25
  73. package/dist/_openapi_client/resources/repos/directories.cjs +0 -40
  74. package/dist/_openapi_client/resources/repos/directories.d.ts +0 -72
  75. package/dist/_openapi_client/resources/repos/directories.js +0 -36
  76. package/dist/_openapi_client/resources/repos/repos.cjs +0 -93
  77. package/dist/_openapi_client/resources/repos/repos.d.ts +0 -188
  78. package/dist/_openapi_client/resources/repos/repos.js +0 -56
  79. package/dist/_openapi_client/resources/runs/rules.cjs +0 -9
  80. package/dist/_openapi_client/resources/runs/rules.d.ts +0 -3
  81. package/dist/_openapi_client/resources/runs/rules.js +0 -5
  82. package/dist/_openapi_client/resources/runs/runs.cjs +0 -102
  83. package/dist/_openapi_client/resources/runs/runs.d.ts +0 -542
  84. package/dist/_openapi_client/resources/runs/runs.js +0 -65
  85. package/dist/_openapi_client/resources/sandboxes/boxes.cjs +0 -86
  86. package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +0 -1121
  87. package/dist/_openapi_client/resources/sandboxes/boxes.js +0 -82
  88. package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +0 -63
  89. package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +0 -13
  90. package/dist/_openapi_client/resources/sandboxes/sandboxes.js +0 -26
  91. package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +0 -39
  92. package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +0 -130
  93. package/dist/_openapi_client/resources/sandboxes/snapshots.js +0 -35
  94. package/dist/_openapi_client/resources/settings.cjs +0 -15
  95. package/dist/_openapi_client/resources/settings.d.ts +0 -18
  96. package/dist/_openapi_client/resources/settings.js +0 -11
  97. package/dist/_openapi_client/resources/workspaces.cjs +0 -35
  98. package/dist/_openapi_client/resources/workspaces.d.ts +0 -84
  99. package/dist/_openapi_client/resources/workspaces.js +0 -31
@@ -1,44 +0,0 @@
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.Commits = 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 Commits extends resource_js_1.APIResource {
10
- /**
11
- * Creates a new commit in a repository. Requires authentication and write access
12
- * to the repository.
13
- */
14
- create(repo, params, options) {
15
- const { owner, ...body } = params;
16
- return this._client.post((0, path_js_1.path) `/commits/${owner}/${repo}`, { body, ...options });
17
- }
18
- /**
19
- * Retrieves a specific commit by hash, tag, or "latest" for a repository. This
20
- * endpoint supports both authenticated and unauthenticated access. Authenticated
21
- * users can access private repos, while unauthenticated users can only access
22
- * public repos. Commit resolution logic:
23
- *
24
- * - "latest" or empty: Get the most recent commit
25
- * - Less than 8 characters: Only check for tags
26
- * - 8 or more characters: Prioritize commit hash over tag, check both
27
- */
28
- retrieve(commit, params, options) {
29
- const { owner, repo, ...query } = params;
30
- return this._client.get((0, path_js_1.path) `/commits/${owner}/${repo}/${commit}`, { query, ...options });
31
- }
32
- /**
33
- * Lists all commits for a repository with pagination support. This endpoint
34
- * supports both authenticated and unauthenticated access. Authenticated users can
35
- * access private repos, while unauthenticated users can only access public repos.
36
- * The include_stats parameter controls whether download and view statistics are
37
- * computed (defaults to true).
38
- */
39
- list(repo, params, options) {
40
- const { owner, ...query } = params;
41
- return this._client.getAPIList((0, path_js_1.path) `/commits/${owner}/${repo}`, (pagination_js_1.OffsetPaginationCommits), { query, ...options });
42
- }
43
- }
44
- exports.Commits = Commits;
@@ -1,204 +0,0 @@
1
- import { APIResource } from '../core/resource.js';
2
- import { APIPromise } from '../core/api-promise.js';
3
- import { OffsetPaginationCommits, type OffsetPaginationCommitsParams, PagePromise } from '../core/pagination.js';
4
- import { RequestOptions } from '../internal/request-options.js';
5
- export declare class Commits extends APIResource {
6
- /**
7
- * Creates a new commit in a repository. Requires authentication and write access
8
- * to the repository.
9
- */
10
- create(repo: string, params: CommitCreateParams, options?: RequestOptions): APIPromise<CommitCreateResponse>;
11
- /**
12
- * Retrieves a specific commit by hash, tag, or "latest" for a repository. This
13
- * endpoint supports both authenticated and unauthenticated access. Authenticated
14
- * users can access private repos, while unauthenticated users can only access
15
- * public repos. Commit resolution logic:
16
- *
17
- * - "latest" or empty: Get the most recent commit
18
- * - Less than 8 characters: Only check for tags
19
- * - 8 or more characters: Prioritize commit hash over tag, check both
20
- */
21
- retrieve(commit: string, params: CommitRetrieveParams, options?: RequestOptions): APIPromise<CommitRetrieveResponse>;
22
- /**
23
- * Lists all commits for a repository with pagination support. This endpoint
24
- * supports both authenticated and unauthenticated access. Authenticated users can
25
- * access private repos, while unauthenticated users can only access public repos.
26
- * The include_stats parameter controls whether download and view statistics are
27
- * computed (defaults to true).
28
- */
29
- list(repo: string, params: CommitListParams, options?: RequestOptions): PagePromise<CommitWithLookupsOffsetPaginationCommits, CommitWithLookups>;
30
- }
31
- export type CommitWithLookupsOffsetPaginationCommits = OffsetPaginationCommits<CommitWithLookups>;
32
- /**
33
- * Response model for get_commit_manifest.
34
- */
35
- export interface CommitManifestResponse {
36
- commit_hash: string;
37
- manifest: {
38
- [key: string]: unknown;
39
- };
40
- examples?: Array<CommitManifestResponse.Example> | null;
41
- }
42
- export declare namespace CommitManifestResponse {
43
- /**
44
- * Response model for example runs
45
- */
46
- interface Example {
47
- id: string;
48
- session_id: string;
49
- inputs?: {
50
- [key: string]: unknown;
51
- } | null;
52
- outputs?: {
53
- [key: string]: unknown;
54
- } | null;
55
- start_time?: string | null;
56
- }
57
- }
58
- export interface CommitWithLookups {
59
- /**
60
- * The commit ID
61
- */
62
- id?: string;
63
- /**
64
- * The hash of the commit
65
- */
66
- commit_hash?: string;
67
- /**
68
- * When the commit was created
69
- */
70
- created_at?: string;
71
- /**
72
- * Optional human-readable description for the commit
73
- */
74
- description?: string;
75
- /**
76
- * Example run IDs associated with the commit
77
- */
78
- example_run_ids?: Array<string>;
79
- /**
80
- * Author's full name
81
- */
82
- full_name?: string;
83
- /**
84
- * The manifest of the commit
85
- */
86
- manifest?: unknown;
87
- /**
88
- * The SHA of the manifest
89
- */
90
- manifest_sha?: Array<number>;
91
- /**
92
- * Number of API downloads
93
- */
94
- num_downloads?: number;
95
- /**
96
- * Number of web views
97
- */
98
- num_views?: number;
99
- /**
100
- * The hash of the parent commit
101
- */
102
- parent_commit_hash?: string;
103
- /**
104
- * The ID of the parent commit
105
- */
106
- parent_id?: string;
107
- /**
108
- * Repository ID
109
- */
110
- repo_id?: string;
111
- /**
112
- * When the commit was last updated
113
- */
114
- updated_at?: string;
115
- }
116
- export interface CommitCreateResponse {
117
- commit?: CommitWithLookups;
118
- }
119
- export interface CommitRetrieveResponse {
120
- commit_hash?: string;
121
- description?: string;
122
- examples?: Array<CommitRetrieveResponse.Example>;
123
- is_draft?: boolean;
124
- manifest?: unknown;
125
- model_config?: unknown;
126
- model_provider?: string;
127
- }
128
- export declare namespace CommitRetrieveResponse {
129
- interface Example {
130
- id?: string;
131
- inputs?: unknown;
132
- outputs?: unknown;
133
- session_id?: string;
134
- start_time?: string;
135
- }
136
- }
137
- export interface CommitCreateParams {
138
- /**
139
- * Path param: Repository owner (tenant handle) or '-' for private repos
140
- */
141
- owner: string;
142
- /**
143
- * Body param
144
- */
145
- description?: string;
146
- /**
147
- * Body param
148
- */
149
- manifest?: unknown;
150
- /**
151
- * Body param
152
- */
153
- parent_commit?: string;
154
- /**
155
- * Body param: SkipWebhooks allows skipping webhook notifications. Can be true
156
- * (boolean) to skip all, or an array of webhook UUIDs to skip specific ones.
157
- */
158
- skip_webhooks?: unknown;
159
- }
160
- export interface CommitRetrieveParams {
161
- /**
162
- * Path param: Repository owner (tenant handle) or '-' for private repos
163
- */
164
- owner: string;
165
- /**
166
- * Path param: Repository handle
167
- */
168
- repo: string;
169
- /**
170
- * Query param
171
- */
172
- get_examples?: boolean;
173
- /**
174
- * Query param: Comma-separated list of optional fields: "model", "is_draft"
175
- */
176
- include?: string;
177
- /**
178
- * Query param: Deprecated: use Include instead
179
- */
180
- include_model?: boolean;
181
- /**
182
- * Query param
183
- */
184
- is_view?: boolean;
185
- }
186
- export interface CommitListParams extends OffsetPaginationCommitsParams {
187
- /**
188
- * Path param: Repository owner (tenant handle) or '-' for private repos
189
- */
190
- owner: string;
191
- /**
192
- * Query param: IncludeStats determines whether to compute num_downloads and
193
- * num_views
194
- */
195
- include_stats?: boolean;
196
- /**
197
- * Query param: Tag filters commits to only those with a specific tag (e.g.
198
- * "production", "staging")
199
- */
200
- tag?: string;
201
- }
202
- export declare namespace Commits {
203
- export { type CommitManifestResponse as CommitManifestResponse, type CommitWithLookups as CommitWithLookups, type CommitCreateResponse as CommitCreateResponse, type CommitRetrieveResponse as CommitRetrieveResponse, type CommitWithLookupsOffsetPaginationCommits as CommitWithLookupsOffsetPaginationCommits, type CommitCreateParams as CommitCreateParams, type CommitRetrieveParams as CommitRetrieveParams, type CommitListParams as CommitListParams, };
204
- }
@@ -1,40 +0,0 @@
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 { OffsetPaginationCommits } from '../core/pagination.js';
5
- import { path } from '../internal/utils/path.js';
6
- export class Commits extends APIResource {
7
- /**
8
- * Creates a new commit in a repository. Requires authentication and write access
9
- * to the repository.
10
- */
11
- create(repo, params, options) {
12
- const { owner, ...body } = params;
13
- return this._client.post(path `/commits/${owner}/${repo}`, { body, ...options });
14
- }
15
- /**
16
- * Retrieves a specific commit by hash, tag, or "latest" for a repository. This
17
- * endpoint supports both authenticated and unauthenticated access. Authenticated
18
- * users can access private repos, while unauthenticated users can only access
19
- * public repos. Commit resolution logic:
20
- *
21
- * - "latest" or empty: Get the most recent commit
22
- * - Less than 8 characters: Only check for tags
23
- * - 8 or more characters: Prioritize commit hash over tag, check both
24
- */
25
- retrieve(commit, params, options) {
26
- const { owner, repo, ...query } = params;
27
- return this._client.get(path `/commits/${owner}/${repo}/${commit}`, { query, ...options });
28
- }
29
- /**
30
- * Lists all commits for a repository with pagination support. This endpoint
31
- * supports both authenticated and unauthenticated access. Authenticated users can
32
- * access private repos, while unauthenticated users can only access public repos.
33
- * The include_stats parameter controls whether download and view statistics are
34
- * computed (defaults to true).
35
- */
36
- list(repo, params, options) {
37
- const { owner, ...query } = params;
38
- return this._client.getAPIList(path `/commits/${owner}/${repo}`, (OffsetPaginationCommits), { query, ...options });
39
- }
40
- }
@@ -1,15 +0,0 @@
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.Evaluators = void 0;
6
- const resource_js_1 = require("../core/resource.cjs");
7
- class Evaluators extends resource_js_1.APIResource {
8
- /**
9
- * List all run rules.
10
- */
11
- list(query = {}, options) {
12
- return this._client.get('/api/v1/runs/rules', { query, ...options });
13
- }
14
- }
15
- exports.Evaluators = Evaluators;
@@ -1,125 +0,0 @@
1
- import { APIResource } from '../core/resource.js';
2
- import { APIPromise } from '../core/api-promise.js';
3
- import { RequestOptions } from '../internal/request-options.js';
4
- export declare class Evaluators extends APIResource {
5
- /**
6
- * List all run rules.
7
- */
8
- list(query?: EvaluatorListParams | null | undefined, options?: RequestOptions): APIPromise<EvaluatorListResponse>;
9
- }
10
- export interface CodeEvaluatorTopLevel {
11
- code: string;
12
- language?: 'python' | 'javascript' | null;
13
- }
14
- /**
15
- * Run rules schema.
16
- */
17
- export interface Evaluator {
18
- id: string;
19
- created_at: string;
20
- display_name: string;
21
- evaluator_version: number;
22
- sampling_rate: number;
23
- tenant_id: string;
24
- updated_at: string;
25
- webhooks: Array<EvaluatorWebhook> | null;
26
- add_to_annotation_queue_id?: string | null;
27
- add_to_annotation_queue_name?: string | null;
28
- add_to_dataset_id?: string | null;
29
- add_to_dataset_name?: string | null;
30
- add_to_dataset_prefer_correction?: boolean;
31
- alerts?: Array<EvaluatorPagerdutyAlert> | null;
32
- alignment_annotation_queue_id?: string | null;
33
- backfill_completed_at?: string | null;
34
- backfill_error?: string | null;
35
- backfill_from?: string | null;
36
- backfill_id?: string | null;
37
- backfill_progress?: number | null;
38
- backfill_status?: string | null;
39
- code_evaluators?: Array<CodeEvaluatorTopLevel> | null;
40
- corrections_dataset_id?: string | null;
41
- dataset_id?: string | null;
42
- dataset_name?: string | null;
43
- evaluator_id?: string | null;
44
- evaluators?: Array<EvaluatorTopLevel> | null;
45
- extend_evaluator_trace_retention?: boolean | null;
46
- extend_only?: boolean;
47
- filter?: string | null;
48
- group_by?: 'thread_id' | null;
49
- include_extended_stats?: boolean;
50
- is_enabled?: boolean;
51
- num_few_shot_examples?: number | null;
52
- session_id?: string | null;
53
- session_name?: string | null;
54
- spend_limit?: Evaluator.SpendLimit | null;
55
- spend_usd?: number | null;
56
- trace_count?: number | null;
57
- trace_filter?: string | null;
58
- transient?: boolean;
59
- tree_filter?: string | null;
60
- use_corrections_dataset?: boolean;
61
- }
62
- export declare namespace Evaluator {
63
- interface SpendLimit {
64
- limit_usd: string;
65
- window: 'weekly';
66
- }
67
- }
68
- export interface EvaluatorPagerdutyAlert {
69
- routing_key: string;
70
- /**
71
- * Enum for severity.
72
- */
73
- severity?: 'critical' | 'warning' | 'error' | 'info' | null;
74
- summary?: string | null;
75
- /**
76
- * Enum for alert types.
77
- */
78
- type?: 'pagerduty' | null;
79
- }
80
- export interface EvaluatorTopLevel {
81
- /**
82
- * Evaluator structured output schema.
83
- */
84
- structured: EvaluatorTopLevel.Structured;
85
- }
86
- export declare namespace EvaluatorTopLevel {
87
- /**
88
- * Evaluator structured output schema.
89
- */
90
- interface Structured {
91
- hub_ref?: string | null;
92
- model?: {
93
- [key: string]: unknown;
94
- } | null;
95
- playground_settings_id?: string | null;
96
- prompt?: Array<Array<unknown>> | null;
97
- schema?: {
98
- [key: string]: unknown;
99
- } | null;
100
- template_format?: string | null;
101
- variable_mapping?: {
102
- [key: string]: string;
103
- } | null;
104
- }
105
- }
106
- export interface EvaluatorWebhook {
107
- url: string;
108
- headers?: {
109
- [key: string]: string;
110
- } | null;
111
- }
112
- export type EvaluatorListResponse = Array<Evaluator>;
113
- export interface EvaluatorListParams {
114
- id?: Array<string> | null;
115
- dataset_id?: string | null;
116
- evaluator_id?: string | null;
117
- include_backfill_progress?: boolean;
118
- name_contains?: string | null;
119
- session_id?: string | null;
120
- tag_value_id?: Array<string> | null;
121
- type?: 'session' | 'dataset' | null;
122
- }
123
- export declare namespace Evaluators {
124
- export { type CodeEvaluatorTopLevel as CodeEvaluatorTopLevel, type Evaluator as Evaluator, type EvaluatorPagerdutyAlert as EvaluatorPagerdutyAlert, type EvaluatorTopLevel as EvaluatorTopLevel, type EvaluatorWebhook as EvaluatorWebhook, type EvaluatorListResponse as EvaluatorListResponse, type EvaluatorListParams as EvaluatorListParams, };
125
- }
@@ -1,11 +0,0 @@
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
- export class Evaluators extends APIResource {
5
- /**
6
- * List all run rules.
7
- */
8
- list(query = {}, options) {
9
- return this._client.get('/api/v1/runs/rules', { query, ...options });
10
- }
11
- }
@@ -1,24 +0,0 @@
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.Bulk = void 0;
6
- const resource_js_1 = require("../../core/resource.cjs");
7
- class Bulk extends resource_js_1.APIResource {
8
- /**
9
- * Create bulk examples.
10
- */
11
- create(params, options) {
12
- const { body } = params;
13
- return this._client.post('/api/v1/examples/bulk', { body: body, ...options });
14
- }
15
- /**
16
- * Legacy update examples in bulk. For update involving attachments, use PATCH
17
- * /v1/platform/datasets/{dataset_id}/examples instead.
18
- */
19
- patchAll(params, options) {
20
- const { body } = params;
21
- return this._client.patch('/api/v1/examples/bulk', { body: body, ...options });
22
- }
23
- }
24
- exports.Bulk = Bulk;
@@ -1,78 +0,0 @@
1
- import { APIResource } from '../../core/resource.js';
2
- import * as ExamplesAPI from './examples.js';
3
- import { APIPromise } from '../../core/api-promise.js';
4
- import { RequestOptions } from '../../internal/request-options.js';
5
- export declare class Bulk extends APIResource {
6
- /**
7
- * Create bulk examples.
8
- */
9
- create(params: BulkCreateParams, options?: RequestOptions): APIPromise<BulkCreateResponse>;
10
- /**
11
- * Legacy update examples in bulk. For update involving attachments, use PATCH
12
- * /v1/platform/datasets/{dataset_id}/examples instead.
13
- */
14
- patchAll(params: BulkPatchAllParams, options?: RequestOptions): APIPromise<unknown>;
15
- }
16
- export type BulkCreateResponse = Array<ExamplesAPI.Example>;
17
- export type BulkPatchAllResponse = unknown;
18
- export interface BulkCreateParams {
19
- /**
20
- * Schema for a batch of examples to be created.
21
- */
22
- body: Array<BulkCreateParams.Body>;
23
- }
24
- export declare namespace BulkCreateParams {
25
- /**
26
- * Example with optional created_at to prevent duplicate versions in bulk
27
- * operations.
28
- */
29
- interface Body {
30
- dataset_id: string;
31
- id?: string | null;
32
- created_at?: string | null;
33
- inputs?: {
34
- [key: string]: unknown;
35
- } | null;
36
- metadata?: {
37
- [key: string]: unknown;
38
- } | null;
39
- outputs?: {
40
- [key: string]: unknown;
41
- } | null;
42
- source_run_id?: string | null;
43
- split?: Array<string> | string | null;
44
- /**
45
- * Use Legacy Message Format for LLM runs
46
- */
47
- use_legacy_message_format?: boolean;
48
- use_source_run_attachments?: Array<string>;
49
- use_source_run_io?: boolean;
50
- }
51
- }
52
- export interface BulkPatchAllParams {
53
- body: Array<BulkPatchAllParams.Body>;
54
- }
55
- export declare namespace BulkPatchAllParams {
56
- /**
57
- * Bulk update class for Example (includes example id).
58
- */
59
- interface Body {
60
- id: string;
61
- attachments_operations?: ExamplesAPI.AttachmentsOperations | null;
62
- dataset_id?: string | null;
63
- inputs?: {
64
- [key: string]: unknown;
65
- } | null;
66
- metadata?: {
67
- [key: string]: unknown;
68
- } | null;
69
- outputs?: {
70
- [key: string]: unknown;
71
- } | null;
72
- overwrite?: boolean;
73
- split?: Array<string> | string | null;
74
- }
75
- }
76
- export declare namespace Bulk {
77
- export { type BulkCreateResponse as BulkCreateResponse, type BulkPatchAllResponse as BulkPatchAllResponse, type BulkCreateParams as BulkCreateParams, type BulkPatchAllParams as BulkPatchAllParams, };
78
- }
@@ -1,20 +0,0 @@
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
- export class Bulk extends APIResource {
5
- /**
6
- * Create bulk examples.
7
- */
8
- create(params, options) {
9
- const { body } = params;
10
- return this._client.post('/api/v1/examples/bulk', { body: body, ...options });
11
- }
12
- /**
13
- * Legacy update examples in bulk. For update involving attachments, use PATCH
14
- * /v1/platform/datasets/{dataset_id}/examples instead.
15
- */
16
- patchAll(params, options) {
17
- const { body } = params;
18
- return this._client.patch('/api/v1/examples/bulk', { body: body, ...options });
19
- }
20
- }
@@ -1,124 +0,0 @@
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.Examples = void 0;
39
- const resource_js_1 = require("../../core/resource.cjs");
40
- const BulkAPI = __importStar(require("./bulk.cjs"));
41
- const bulk_js_1 = require("./bulk.cjs");
42
- const ValidateAPI = __importStar(require("./validate.cjs"));
43
- const validate_js_1 = require("./validate.cjs");
44
- const pagination_js_1 = require("../../core/pagination.cjs");
45
- const uploads_js_1 = require("../../internal/uploads.cjs");
46
- const path_js_1 = require("../../internal/utils/path.cjs");
47
- class Examples extends resource_js_1.APIResource {
48
- constructor() {
49
- super(...arguments);
50
- Object.defineProperty(this, "bulk", {
51
- enumerable: true,
52
- configurable: true,
53
- writable: true,
54
- value: new BulkAPI.Bulk(this._client)
55
- });
56
- Object.defineProperty(this, "validate", {
57
- enumerable: true,
58
- configurable: true,
59
- writable: true,
60
- value: new ValidateAPI.Validate(this._client)
61
- });
62
- }
63
- /**
64
- * Create a new example.
65
- */
66
- create(body, options) {
67
- return this._client.post('/api/v1/examples', { body, ...options });
68
- }
69
- /**
70
- * Get a specific example.
71
- */
72
- retrieve(exampleID, query = {}, options) {
73
- return this._client.get((0, path_js_1.path) `/api/v1/examples/${exampleID}`, { query, ...options });
74
- }
75
- /**
76
- * Update a specific example.
77
- */
78
- update(exampleID, body, options) {
79
- return this._client.patch((0, path_js_1.path) `/api/v1/examples/${exampleID}`, { body, ...options });
80
- }
81
- /**
82
- * Get all examples by query params
83
- */
84
- list(query = {}, options) {
85
- return this._client.getAPIList('/api/v1/examples', (pagination_js_1.OffsetPaginationTopLevelArray), {
86
- query,
87
- ...options,
88
- });
89
- }
90
- /**
91
- * Soft delete an example. Only deletes the example in the 'latest' version of the
92
- * dataset.
93
- */
94
- delete(exampleID, options) {
95
- return this._client.delete((0, path_js_1.path) `/api/v1/examples/${exampleID}`, options);
96
- }
97
- /**
98
- * Soft delete examples. Only deletes the examples in the 'latest' version of the
99
- * dataset.
100
- */
101
- deleteAll(params, options) {
102
- const { example_ids } = params;
103
- return this._client.delete('/api/v1/examples', { query: { example_ids }, ...options });
104
- }
105
- /**
106
- * Count all examples by query params
107
- */
108
- retrieveCount(query = {}, options) {
109
- return this._client.get('/api/v1/examples/count', { query, ...options });
110
- }
111
- /**
112
- * Upload examples from a CSV file.
113
- *
114
- * Note: For non-csv upload, please use the POST
115
- * /v1/platform/datasets/{dataset_id}/examples endpoint which provides more
116
- * efficient upload.
117
- */
118
- uploadFromCsv(datasetID, body, options) {
119
- return this._client.post((0, path_js_1.path) `/api/v1/examples/upload/${datasetID}`, (0, uploads_js_1.multipartFormRequestOptions)({ body, ...options }, this._client));
120
- }
121
- }
122
- exports.Examples = Examples;
123
- Examples.Bulk = bulk_js_1.Bulk;
124
- Examples.Validate = validate_js_1.Validate;