openlayer 0.12.0 → 0.13.0

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 (104) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +67 -77
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +17 -3
  7. package/core.d.ts.map +1 -1
  8. package/core.js +30 -17
  9. package/core.js.map +1 -1
  10. package/core.mjs +31 -18
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +8 -5
  13. package/index.d.ts +8 -5
  14. package/index.d.ts.map +1 -1
  15. package/index.js +6 -2
  16. package/index.js.map +1 -1
  17. package/index.mjs +6 -2
  18. package/index.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/resource.d.ts +1 -1
  21. package/resource.d.ts.map +1 -1
  22. package/resource.js.map +1 -1
  23. package/resource.mjs.map +1 -1
  24. package/resources/commits/test-results.d.ts +24 -6
  25. package/resources/commits/test-results.d.ts.map +1 -1
  26. package/resources/inference-pipelines/data.d.ts +23 -1
  27. package/resources/inference-pipelines/data.d.ts.map +1 -1
  28. package/resources/inference-pipelines/data.js +20 -0
  29. package/resources/inference-pipelines/data.js.map +1 -1
  30. package/resources/inference-pipelines/data.mjs +20 -0
  31. package/resources/inference-pipelines/data.mjs.map +1 -1
  32. package/resources/inference-pipelines/inference-pipelines.d.ts +95 -0
  33. package/resources/inference-pipelines/inference-pipelines.d.ts.map +1 -1
  34. package/resources/inference-pipelines/inference-pipelines.js +7 -0
  35. package/resources/inference-pipelines/inference-pipelines.js.map +1 -1
  36. package/resources/inference-pipelines/inference-pipelines.mjs +7 -0
  37. package/resources/inference-pipelines/inference-pipelines.mjs.map +1 -1
  38. package/resources/inference-pipelines/rows.d.ts +8 -0
  39. package/resources/inference-pipelines/rows.d.ts.map +1 -1
  40. package/resources/inference-pipelines/rows.js +8 -0
  41. package/resources/inference-pipelines/rows.js.map +1 -1
  42. package/resources/inference-pipelines/rows.mjs +8 -0
  43. package/resources/inference-pipelines/rows.mjs.map +1 -1
  44. package/resources/inference-pipelines/test-results.d.ts +31 -5
  45. package/resources/inference-pipelines/test-results.d.ts.map +1 -1
  46. package/resources/inference-pipelines/test-results.js.map +1 -1
  47. package/resources/inference-pipelines/test-results.mjs.map +1 -1
  48. package/resources/projects/commits.d.ts +18 -0
  49. package/resources/projects/commits.d.ts.map +1 -1
  50. package/resources/projects/commits.js +11 -0
  51. package/resources/projects/commits.js.map +1 -1
  52. package/resources/projects/commits.mjs +11 -0
  53. package/resources/projects/commits.mjs.map +1 -1
  54. package/resources/projects/index.d.ts +1 -0
  55. package/resources/projects/index.d.ts.map +1 -1
  56. package/resources/projects/index.js +3 -1
  57. package/resources/projects/index.js.map +1 -1
  58. package/resources/projects/index.mjs +1 -0
  59. package/resources/projects/index.mjs.map +1 -1
  60. package/resources/projects/inference-pipelines.d.ts +104 -0
  61. package/resources/projects/inference-pipelines.d.ts.map +1 -1
  62. package/resources/projects/inference-pipelines.js +12 -0
  63. package/resources/projects/inference-pipelines.js.map +1 -1
  64. package/resources/projects/inference-pipelines.mjs +12 -0
  65. package/resources/projects/inference-pipelines.mjs.map +1 -1
  66. package/resources/projects/projects.d.ts +17 -0
  67. package/resources/projects/projects.d.ts.map +1 -1
  68. package/resources/projects/projects.js +12 -0
  69. package/resources/projects/projects.js.map +1 -1
  70. package/resources/projects/projects.mjs +12 -0
  71. package/resources/projects/projects.mjs.map +1 -1
  72. package/resources/projects/tests.d.ts +501 -0
  73. package/resources/projects/tests.d.ts.map +1 -0
  74. package/resources/projects/tests.js +55 -0
  75. package/resources/projects/tests.js.map +1 -0
  76. package/resources/projects/tests.mjs +51 -0
  77. package/resources/projects/tests.mjs.map +1 -0
  78. package/resources.d.ts +2 -0
  79. package/resources.d.ts.map +1 -0
  80. package/resources.js +18 -0
  81. package/resources.js.map +1 -0
  82. package/resources.mjs +2 -0
  83. package/resources.mjs.map +1 -0
  84. package/src/_shims/index.d.ts +2 -0
  85. package/src/_shims/index.js +5 -1
  86. package/src/_shims/index.mjs +5 -1
  87. package/src/core.ts +49 -15
  88. package/src/index.ts +15 -5
  89. package/src/resource.ts +1 -1
  90. package/src/resources/commits/test-results.ts +102 -6
  91. package/src/resources/inference-pipelines/data.ts +21 -1
  92. package/src/resources/inference-pipelines/inference-pipelines.ts +95 -0
  93. package/src/resources/inference-pipelines/rows.ts +8 -0
  94. package/src/resources/inference-pipelines/test-results.ts +109 -5
  95. package/src/resources/projects/commits.ts +18 -0
  96. package/src/resources/projects/index.ts +9 -0
  97. package/src/resources/projects/inference-pipelines.ts +104 -0
  98. package/src/resources/projects/projects.ts +35 -0
  99. package/src/resources/projects/tests.ts +905 -0
  100. package/src/resources.ts +1 -0
  101. package/src/version.ts +1 -1
  102. package/version.d.ts +1 -1
  103. package/version.js +1 -1
  104. package/version.mjs +1 -1
@@ -7,6 +7,14 @@ import * as Core from '../../core';
7
7
  export class TestResults extends APIResource {
8
8
  /**
9
9
  * List the latest test results for an inference pipeline.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const testResults =
14
+ * await client.inferencePipelines.testResults.list(
15
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
16
+ * );
17
+ * ```
10
18
  */
11
19
  list(
12
20
  inferencePipelineId: string,
@@ -140,7 +148,48 @@ export namespace TestResultListResponse {
140
148
  /**
141
149
  * The test subtype.
142
150
  */
143
- subtype: string;
151
+ subtype:
152
+ | 'anomalousColumnCount'
153
+ | 'characterLength'
154
+ | 'classImbalanceRatio'
155
+ | 'expectColumnAToBeInColumnB'
156
+ | 'columnAverage'
157
+ | 'columnDrift'
158
+ | 'columnStatistic'
159
+ | 'columnValuesMatch'
160
+ | 'conflictingLabelRowCount'
161
+ | 'containsPii'
162
+ | 'containsValidUrl'
163
+ | 'correlatedFeatureCount'
164
+ | 'customMetricThreshold'
165
+ | 'duplicateRowCount'
166
+ | 'emptyFeature'
167
+ | 'emptyFeatureCount'
168
+ | 'driftedFeatureCount'
169
+ | 'featureMissingValues'
170
+ | 'featureValueValidation'
171
+ | 'greatExpectations'
172
+ | 'groupByColumnStatsCheck'
173
+ | 'illFormedRowCount'
174
+ | 'isCode'
175
+ | 'isJson'
176
+ | 'llmRubricThresholdV2'
177
+ | 'labelDrift'
178
+ | 'metricThreshold'
179
+ | 'newCategoryCount'
180
+ | 'newLabelCount'
181
+ | 'nullRowCount'
182
+ | 'rowCount'
183
+ | 'ppScoreValueValidation'
184
+ | 'quasiConstantFeature'
185
+ | 'quasiConstantFeatureCount'
186
+ | 'sqlQuery'
187
+ | 'dtypeValidation'
188
+ | 'sentenceLength'
189
+ | 'sizeRatio'
190
+ | 'specialCharactersRatio'
191
+ | 'stringValidation'
192
+ | 'trainValLeakageRowCount';
144
193
 
145
194
  /**
146
195
  * Whether the test is suggested or user-created.
@@ -152,7 +201,7 @@ export namespace TestResultListResponse {
152
201
  /**
153
202
  * The test type.
154
203
  */
155
- type: string;
204
+ type: 'integrity' | 'consistency' | 'performance';
156
205
 
157
206
  /**
158
207
  * Whether the test is archived.
@@ -201,9 +250,48 @@ export namespace TestResultListResponse {
201
250
  /**
202
251
  * The insight name to be evaluated.
203
252
  */
204
- insightName?: string;
253
+ insightName?:
254
+ | 'characterLength'
255
+ | 'classImbalance'
256
+ | 'expectColumnAToBeInColumnB'
257
+ | 'columnAverage'
258
+ | 'columnDrift'
259
+ | 'columnValuesMatch'
260
+ | 'confidenceDistribution'
261
+ | 'conflictingLabelRowCount'
262
+ | 'containsPii'
263
+ | 'containsValidUrl'
264
+ | 'correlatedFeatures'
265
+ | 'customMetric'
266
+ | 'duplicateRowCount'
267
+ | 'emptyFeatures'
268
+ | 'featureDrift'
269
+ | 'featureProfile'
270
+ | 'greatExpectations'
271
+ | 'groupByColumnStatsCheck'
272
+ | 'illFormedRowCount'
273
+ | 'isCode'
274
+ | 'isJson'
275
+ | 'llmRubricV2'
276
+ | 'labelDrift'
277
+ | 'metrics'
278
+ | 'newCategories'
279
+ | 'newLabels'
280
+ | 'nullRowCount'
281
+ | 'ppScore'
282
+ | 'quasiConstantFeatures'
283
+ | 'sentenceLength'
284
+ | 'sizeRatio'
285
+ | 'specialCharacters'
286
+ | 'stringValidation'
287
+ | 'trainValLeakageRowCount';
205
288
 
206
- insightParameters?: Array<unknown>;
289
+ /**
290
+ * The insight parameters. Required only for some test subtypes. For example, for
291
+ * tests that require a column name, the insight parameters will be [{'name':
292
+ * 'column_name', 'value': 'Age'}]
293
+ */
294
+ insightParameters?: Array<Threshold.InsightParameter> | null;
207
295
 
208
296
  /**
209
297
  * The measurement to be evaluated.
@@ -213,13 +301,29 @@ export namespace TestResultListResponse {
213
301
  /**
214
302
  * The operator to be used for the evaluation.
215
303
  */
216
- operator?: string;
304
+ operator?: 'is' | '>' | '>=' | '<' | '<=' | '!=';
305
+
306
+ /**
307
+ * Whether to use automatic anomaly detection or manual thresholds
308
+ */
309
+ thresholdMode?: 'automatic' | 'manual';
217
310
 
218
311
  /**
219
312
  * The value to be compared.
220
313
  */
221
314
  value?: number | boolean | string | Array<string>;
222
315
  }
316
+
317
+ export namespace Threshold {
318
+ export interface InsightParameter {
319
+ /**
320
+ * The name of the insight filter.
321
+ */
322
+ name: string;
323
+
324
+ value: unknown;
325
+ }
326
+ }
223
327
  }
224
328
  }
225
329
  }
@@ -7,6 +7,17 @@ import * as Core from '../../core';
7
7
  export class Commits extends APIResource {
8
8
  /**
9
9
  * Create a new commit (project version) in a project.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const commit = await client.projects.commits.create(
14
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
15
+ * {
16
+ * commit: { message: 'Updated the prompt.' },
17
+ * storageUri: 's3://...',
18
+ * },
19
+ * );
20
+ * ```
10
21
  */
11
22
  create(
12
23
  projectId: string,
@@ -18,6 +29,13 @@ export class Commits extends APIResource {
18
29
 
19
30
  /**
20
31
  * List the commits (project versions) in a project.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const commits = await client.projects.commits.list(
36
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
37
+ * );
38
+ * ```
21
39
  */
22
40
  list(
23
41
  projectId: string,
@@ -21,3 +21,12 @@ export {
21
21
  type ProjectCreateParams,
22
22
  type ProjectListParams,
23
23
  } from './projects';
24
+ export {
25
+ Tests,
26
+ type TestCreateResponse,
27
+ type TestUpdateResponse,
28
+ type TestListResponse,
29
+ type TestCreateParams,
30
+ type TestUpdateParams,
31
+ type TestListParams,
32
+ } from './tests';
@@ -7,6 +7,18 @@ import * as Core from '../../core';
7
7
  export class InferencePipelines extends APIResource {
8
8
  /**
9
9
  * Create an inference pipeline in a project.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const inferencePipeline =
14
+ * await client.projects.inferencePipelines.create(
15
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
16
+ * {
17
+ * description: 'This pipeline is used for production.',
18
+ * name: 'production',
19
+ * },
20
+ * );
21
+ * ```
10
22
  */
11
23
  create(
12
24
  projectId: string,
@@ -18,6 +30,14 @@ export class InferencePipelines extends APIResource {
18
30
 
19
31
  /**
20
32
  * List the inference pipelines in a project.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const inferencePipelines =
37
+ * await client.projects.inferencePipelines.list(
38
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
39
+ * );
40
+ * ```
21
41
  */
22
42
  list(
23
43
  projectId: string,
@@ -240,26 +260,59 @@ export namespace InferencePipelineCreateResponse {
240
260
  }
241
261
 
242
262
  export interface Workspace {
263
+ /**
264
+ * The workspace id.
265
+ */
243
266
  id: string;
244
267
 
268
+ /**
269
+ * The workspace creator id.
270
+ */
245
271
  creatorId: string | null;
246
272
 
273
+ /**
274
+ * The workspace creation date.
275
+ */
247
276
  dateCreated: string;
248
277
 
278
+ /**
279
+ * The workspace last updated date.
280
+ */
249
281
  dateUpdated: string;
250
282
 
283
+ /**
284
+ * The number of invites in the workspace.
285
+ */
251
286
  inviteCount: number;
252
287
 
288
+ /**
289
+ * The number of members in the workspace.
290
+ */
253
291
  memberCount: number;
254
292
 
293
+ /**
294
+ * The workspace name.
295
+ */
255
296
  name: string;
256
297
 
298
+ /**
299
+ * The end date of the current billing period.
300
+ */
257
301
  periodEndDate: string | null;
258
302
 
303
+ /**
304
+ * The start date of the current billing period.
305
+ */
259
306
  periodStartDate: string | null;
260
307
 
308
+ /**
309
+ * The number of projects in the workspace.
310
+ */
261
311
  projectCount: number;
262
312
 
313
+ /**
314
+ * The workspace slug.
315
+ */
263
316
  slug: string;
264
317
 
265
318
  status:
@@ -274,6 +327,9 @@ export namespace InferencePipelineCreateResponse {
274
327
 
275
328
  monthlyUsage?: Array<Workspace.MonthlyUsage>;
276
329
 
330
+ /**
331
+ * Whether the workspace only allows SAML authentication.
332
+ */
277
333
  samlOnlyAccess?: boolean;
278
334
 
279
335
  wildcardDomains?: Array<string>;
@@ -498,26 +554,59 @@ export namespace InferencePipelineListResponse {
498
554
  }
499
555
 
500
556
  export interface Workspace {
557
+ /**
558
+ * The workspace id.
559
+ */
501
560
  id: string;
502
561
 
562
+ /**
563
+ * The workspace creator id.
564
+ */
503
565
  creatorId: string | null;
504
566
 
567
+ /**
568
+ * The workspace creation date.
569
+ */
505
570
  dateCreated: string;
506
571
 
572
+ /**
573
+ * The workspace last updated date.
574
+ */
507
575
  dateUpdated: string;
508
576
 
577
+ /**
578
+ * The number of invites in the workspace.
579
+ */
509
580
  inviteCount: number;
510
581
 
582
+ /**
583
+ * The number of members in the workspace.
584
+ */
511
585
  memberCount: number;
512
586
 
587
+ /**
588
+ * The workspace name.
589
+ */
513
590
  name: string;
514
591
 
592
+ /**
593
+ * The end date of the current billing period.
594
+ */
515
595
  periodEndDate: string | null;
516
596
 
597
+ /**
598
+ * The start date of the current billing period.
599
+ */
517
600
  periodStartDate: string | null;
518
601
 
602
+ /**
603
+ * The number of projects in the workspace.
604
+ */
519
605
  projectCount: number;
520
606
 
607
+ /**
608
+ * The workspace slug.
609
+ */
521
610
  slug: string;
522
611
 
523
612
  status:
@@ -532,6 +621,9 @@ export namespace InferencePipelineListResponse {
532
621
 
533
622
  monthlyUsage?: Array<Workspace.MonthlyUsage>;
534
623
 
624
+ /**
625
+ * Whether the workspace only allows SAML authentication.
626
+ */
535
627
  samlOnlyAccess?: boolean;
536
628
 
537
629
  wildcardDomains?: Array<string>;
@@ -584,12 +676,24 @@ export namespace InferencePipelineCreateParams {
584
676
  }
585
677
 
586
678
  export interface Workspace {
679
+ /**
680
+ * The workspace name.
681
+ */
587
682
  name: string;
588
683
 
684
+ /**
685
+ * The workspace slug.
686
+ */
589
687
  slug: string;
590
688
 
689
+ /**
690
+ * The workspace invite code.
691
+ */
591
692
  inviteCode?: string;
592
693
 
694
+ /**
695
+ * Whether the workspace only allows SAML authentication.
696
+ */
593
697
  samlOnlyAccess?: boolean;
594
698
 
595
699
  wildcardDomains?: Array<string>;
@@ -19,15 +19,34 @@ import {
19
19
  InferencePipelineListResponse,
20
20
  InferencePipelines,
21
21
  } from './inference-pipelines';
22
+ import * as TestsAPI from './tests';
23
+ import {
24
+ TestCreateParams,
25
+ TestCreateResponse,
26
+ TestListParams,
27
+ TestListResponse,
28
+ TestUpdateParams,
29
+ TestUpdateResponse,
30
+ Tests,
31
+ } from './tests';
22
32
 
23
33
  export class Projects extends APIResource {
24
34
  commits: CommitsAPI.Commits = new CommitsAPI.Commits(this._client);
25
35
  inferencePipelines: InferencePipelinesAPI.InferencePipelines = new InferencePipelinesAPI.InferencePipelines(
26
36
  this._client,
27
37
  );
38
+ tests: TestsAPI.Tests = new TestsAPI.Tests(this._client);
28
39
 
29
40
  /**
30
41
  * Create a project in your workspace.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const project = await client.projects.create({
46
+ * name: 'My Project',
47
+ * taskType: 'llm-base',
48
+ * });
49
+ * ```
31
50
  */
32
51
  create(body: ProjectCreateParams, options?: Core.RequestOptions): Core.APIPromise<ProjectCreateResponse> {
33
52
  return this._client.post('/projects', { body, ...options });
@@ -35,6 +54,11 @@ export class Projects extends APIResource {
35
54
 
36
55
  /**
37
56
  * List your workspace's projects.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const projects = await client.projects.list();
61
+ * ```
38
62
  */
39
63
  list(query?: ProjectListParams, options?: Core.RequestOptions): Core.APIPromise<ProjectListResponse>;
40
64
  list(options?: Core.RequestOptions): Core.APIPromise<ProjectListResponse>;
@@ -324,6 +348,7 @@ export interface ProjectListParams {
324
348
 
325
349
  Projects.Commits = Commits;
326
350
  Projects.InferencePipelines = InferencePipelines;
351
+ Projects.Tests = Tests;
327
352
 
328
353
  export declare namespace Projects {
329
354
  export {
@@ -348,4 +373,14 @@ export declare namespace Projects {
348
373
  type InferencePipelineCreateParams as InferencePipelineCreateParams,
349
374
  type InferencePipelineListParams as InferencePipelineListParams,
350
375
  };
376
+
377
+ export {
378
+ Tests as Tests,
379
+ type TestCreateResponse as TestCreateResponse,
380
+ type TestUpdateResponse as TestUpdateResponse,
381
+ type TestListResponse as TestListResponse,
382
+ type TestCreateParams as TestCreateParams,
383
+ type TestUpdateParams as TestUpdateParams,
384
+ type TestListParams as TestListParams,
385
+ };
351
386
  }