openlayer 0.18.0 → 0.20.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 (56) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/client.d.mts +4 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/internal/to-file.d.mts +1 -1
  11. package/internal/to-file.d.ts +1 -1
  12. package/internal/to-file.js +1 -1
  13. package/internal/to-file.mjs +1 -1
  14. package/package.json +1 -1
  15. package/resources/index.d.mts +1 -0
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +1 -0
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +3 -1
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +1 -0
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/inference-pipelines/inference-pipelines.d.mts +90 -0
  24. package/resources/inference-pipelines/inference-pipelines.d.mts.map +1 -1
  25. package/resources/inference-pipelines/inference-pipelines.d.ts +90 -0
  26. package/resources/inference-pipelines/inference-pipelines.d.ts.map +1 -1
  27. package/resources/inference-pipelines/inference-pipelines.js.map +1 -1
  28. package/resources/inference-pipelines/inference-pipelines.mjs.map +1 -1
  29. package/resources/projects/inference-pipelines.d.mts +267 -0
  30. package/resources/projects/inference-pipelines.d.mts.map +1 -1
  31. package/resources/projects/inference-pipelines.d.ts +267 -0
  32. package/resources/projects/inference-pipelines.d.ts.map +1 -1
  33. package/resources/projects/tests.d.mts +60 -0
  34. package/resources/projects/tests.d.mts.map +1 -1
  35. package/resources/projects/tests.d.ts +60 -0
  36. package/resources/projects/tests.d.ts.map +1 -1
  37. package/resources/tests.d.mts +78 -0
  38. package/resources/tests.d.mts.map +1 -0
  39. package/resources/tests.d.ts +78 -0
  40. package/resources/tests.d.ts.map +1 -0
  41. package/resources/tests.js +27 -0
  42. package/resources/tests.js.map +1 -0
  43. package/resources/tests.mjs +23 -0
  44. package/resources/tests.mjs.map +1 -0
  45. package/src/client.ts +10 -1
  46. package/src/internal/to-file.ts +1 -1
  47. package/src/resources/index.ts +1 -0
  48. package/src/resources/inference-pipelines/inference-pipelines.ts +158 -0
  49. package/src/resources/projects/inference-pipelines.ts +397 -0
  50. package/src/resources/projects/tests.ts +72 -0
  51. package/src/resources/tests.ts +100 -0
  52. package/src/version.ts +1 -1
  53. package/version.d.mts +1 -1
  54. package/version.d.ts +1 -1
  55. package/version.js +1 -1
  56. package/version.mjs +1 -1
@@ -122,8 +122,27 @@ export interface InferencePipelineCreateResponse {
122
122
  */
123
123
  totalGoalCount: number;
124
124
 
125
+ dataBackend?:
126
+ | InferencePipelineCreateResponse.UnionMember0
127
+ | InferencePipelineCreateResponse.BackendType
128
+ | InferencePipelineCreateResponse.UnionMember2
129
+ | InferencePipelineCreateResponse.UnionMember3
130
+ | InferencePipelineCreateResponse.UnionMember4
131
+ | InferencePipelineCreateResponse.UnionMember5
132
+ | null;
133
+
134
+ /**
135
+ * The last time the data was polled.
136
+ */
137
+ dateLastPolled?: string | null;
138
+
125
139
  project?: InferencePipelineCreateResponse.Project | null;
126
140
 
141
+ /**
142
+ * The total number of records in the data backend.
143
+ */
144
+ totalRecordsCount?: number | null;
145
+
127
146
  workspace?: InferencePipelineCreateResponse.Workspace | null;
128
147
 
129
148
  /**
@@ -137,6 +156,66 @@ export namespace InferencePipelineCreateResponse {
137
156
  app: string;
138
157
  }
139
158
 
159
+ export interface UnionMember0 {
160
+ backendType: 'bigquery';
161
+
162
+ bigqueryConnectionId: string | null;
163
+
164
+ datasetId: string;
165
+
166
+ projectId: string;
167
+
168
+ tableId: string | null;
169
+
170
+ partitionType?: 'DAY' | 'MONTH' | 'YEAR' | null;
171
+ }
172
+
173
+ export interface BackendType {
174
+ backendType: 'default';
175
+ }
176
+
177
+ export interface UnionMember2 {
178
+ backendType: 'snowflake';
179
+
180
+ database: string;
181
+
182
+ schema: string;
183
+
184
+ snowflakeConnectionId: string | null;
185
+
186
+ table: string | null;
187
+ }
188
+
189
+ export interface UnionMember3 {
190
+ backendType: 'databricks_dtl';
191
+
192
+ databricksDtlConnectionId: string | null;
193
+
194
+ tableId: string | null;
195
+ }
196
+
197
+ export interface UnionMember4 {
198
+ backendType: 'redshift';
199
+
200
+ redshiftConnectionId: string | null;
201
+
202
+ schemaName: string;
203
+
204
+ tableName: string;
205
+ }
206
+
207
+ export interface UnionMember5 {
208
+ backendType: 'postgres';
209
+
210
+ database: string;
211
+
212
+ postgresConnectionId: string | null;
213
+
214
+ schema: string;
215
+
216
+ table: string | null;
217
+ }
218
+
140
219
  export interface Project {
141
220
  /**
142
221
  * The project id.
@@ -416,8 +495,27 @@ export namespace InferencePipelineListResponse {
416
495
  */
417
496
  totalGoalCount: number;
418
497
 
498
+ dataBackend?:
499
+ | Item.UnionMember0
500
+ | Item.BackendType
501
+ | Item.UnionMember2
502
+ | Item.UnionMember3
503
+ | Item.UnionMember4
504
+ | Item.UnionMember5
505
+ | null;
506
+
507
+ /**
508
+ * The last time the data was polled.
509
+ */
510
+ dateLastPolled?: string | null;
511
+
419
512
  project?: Item.Project | null;
420
513
 
514
+ /**
515
+ * The total number of records in the data backend.
516
+ */
517
+ totalRecordsCount?: number | null;
518
+
421
519
  workspace?: Item.Workspace | null;
422
520
 
423
521
  /**
@@ -431,6 +529,66 @@ export namespace InferencePipelineListResponse {
431
529
  app: string;
432
530
  }
433
531
 
532
+ export interface UnionMember0 {
533
+ backendType: 'bigquery';
534
+
535
+ bigqueryConnectionId: string | null;
536
+
537
+ datasetId: string;
538
+
539
+ projectId: string;
540
+
541
+ tableId: string | null;
542
+
543
+ partitionType?: 'DAY' | 'MONTH' | 'YEAR' | null;
544
+ }
545
+
546
+ export interface BackendType {
547
+ backendType: 'default';
548
+ }
549
+
550
+ export interface UnionMember2 {
551
+ backendType: 'snowflake';
552
+
553
+ database: string;
554
+
555
+ schema: string;
556
+
557
+ snowflakeConnectionId: string | null;
558
+
559
+ table: string | null;
560
+ }
561
+
562
+ export interface UnionMember3 {
563
+ backendType: 'databricks_dtl';
564
+
565
+ databricksDtlConnectionId: string | null;
566
+
567
+ tableId: string | null;
568
+ }
569
+
570
+ export interface UnionMember4 {
571
+ backendType: 'redshift';
572
+
573
+ redshiftConnectionId: string | null;
574
+
575
+ schemaName: string;
576
+
577
+ tableName: string;
578
+ }
579
+
580
+ export interface UnionMember5 {
581
+ backendType: 'postgres';
582
+
583
+ database: string;
584
+
585
+ postgresConnectionId: string | null;
586
+
587
+ schema: string;
588
+
589
+ table: string | null;
590
+ }
591
+
434
592
  export interface Project {
435
593
  /**
436
594
  * The project id.
@@ -644,12 +802,251 @@ export interface InferencePipelineCreateParams {
644
802
  */
645
803
  name: string;
646
804
 
805
+ dataBackend?:
806
+ | InferencePipelineCreateParams.UnionMember0
807
+ | InferencePipelineCreateParams.BackendType
808
+ | InferencePipelineCreateParams.UnionMember2
809
+ | InferencePipelineCreateParams.UnionMember3
810
+ | InferencePipelineCreateParams.UnionMember4
811
+ | InferencePipelineCreateParams.UnionMember5
812
+ | null;
813
+
647
814
  project?: InferencePipelineCreateParams.Project | null;
648
815
 
649
816
  workspace?: InferencePipelineCreateParams.Workspace | null;
650
817
  }
651
818
 
652
819
  export namespace InferencePipelineCreateParams {
820
+ export interface UnionMember0 {
821
+ backendType: 'bigquery';
822
+
823
+ bigqueryConnectionId: string | null;
824
+
825
+ config: UnionMember0.Config;
826
+
827
+ datasetId: string;
828
+
829
+ projectId: string;
830
+
831
+ tableId: string | null;
832
+
833
+ partitionType?: 'DAY' | 'MONTH' | 'YEAR' | null;
834
+ }
835
+
836
+ export namespace UnionMember0 {
837
+ export interface Config {
838
+ /**
839
+ * Name of the column with the ground truths.
840
+ */
841
+ groundTruthColumnName?: string | null;
842
+
843
+ /**
844
+ * Name of the column with human feedback.
845
+ */
846
+ humanFeedbackColumnName?: string | null;
847
+
848
+ /**
849
+ * Name of the column with the inference ids. This is useful if you want to update
850
+ * rows at a later point in time. If not provided, a unique id is generated by
851
+ * Openlayer.
852
+ */
853
+ inferenceIdColumnName?: string | null;
854
+
855
+ /**
856
+ * Name of the column with the latencies.
857
+ */
858
+ latencyColumnName?: string | null;
859
+
860
+ /**
861
+ * Name of the column with the timestamps. Timestamps must be in UNIX sec format.
862
+ * If not provided, the upload timestamp is used.
863
+ */
864
+ timestampColumnName?: string | null;
865
+ }
866
+ }
867
+
868
+ export interface BackendType {
869
+ backendType: 'default';
870
+ }
871
+
872
+ export interface UnionMember2 {
873
+ backendType: 'snowflake';
874
+
875
+ config: UnionMember2.Config;
876
+
877
+ database: string;
878
+
879
+ schema: string;
880
+
881
+ snowflakeConnectionId: string | null;
882
+
883
+ table: string | null;
884
+ }
885
+
886
+ export namespace UnionMember2 {
887
+ export interface Config {
888
+ /**
889
+ * Name of the column with the ground truths.
890
+ */
891
+ groundTruthColumnName?: string | null;
892
+
893
+ /**
894
+ * Name of the column with human feedback.
895
+ */
896
+ humanFeedbackColumnName?: string | null;
897
+
898
+ /**
899
+ * Name of the column with the inference ids. This is useful if you want to update
900
+ * rows at a later point in time. If not provided, a unique id is generated by
901
+ * Openlayer.
902
+ */
903
+ inferenceIdColumnName?: string | null;
904
+
905
+ /**
906
+ * Name of the column with the latencies.
907
+ */
908
+ latencyColumnName?: string | null;
909
+
910
+ /**
911
+ * Name of the column with the timestamps. Timestamps must be in UNIX sec format.
912
+ * If not provided, the upload timestamp is used.
913
+ */
914
+ timestampColumnName?: string | null;
915
+ }
916
+ }
917
+
918
+ export interface UnionMember3 {
919
+ backendType: 'databricks_dtl';
920
+
921
+ config: UnionMember3.Config;
922
+
923
+ databricksDtlConnectionId: string | null;
924
+
925
+ tableId: string | null;
926
+ }
927
+
928
+ export namespace UnionMember3 {
929
+ export interface Config {
930
+ /**
931
+ * Name of the column with the ground truths.
932
+ */
933
+ groundTruthColumnName?: string | null;
934
+
935
+ /**
936
+ * Name of the column with human feedback.
937
+ */
938
+ humanFeedbackColumnName?: string | null;
939
+
940
+ /**
941
+ * Name of the column with the inference ids. This is useful if you want to update
942
+ * rows at a later point in time. If not provided, a unique id is generated by
943
+ * Openlayer.
944
+ */
945
+ inferenceIdColumnName?: string | null;
946
+
947
+ /**
948
+ * Name of the column with the latencies.
949
+ */
950
+ latencyColumnName?: string | null;
951
+
952
+ /**
953
+ * Name of the column with the timestamps. Timestamps must be in UNIX sec format.
954
+ * If not provided, the upload timestamp is used.
955
+ */
956
+ timestampColumnName?: string | null;
957
+ }
958
+ }
959
+
960
+ export interface UnionMember4 {
961
+ backendType: 'redshift';
962
+
963
+ config: UnionMember4.Config;
964
+
965
+ redshiftConnectionId: string | null;
966
+
967
+ schemaName: string;
968
+
969
+ tableName: string;
970
+ }
971
+
972
+ export namespace UnionMember4 {
973
+ export interface Config {
974
+ /**
975
+ * Name of the column with the ground truths.
976
+ */
977
+ groundTruthColumnName?: string | null;
978
+
979
+ /**
980
+ * Name of the column with human feedback.
981
+ */
982
+ humanFeedbackColumnName?: string | null;
983
+
984
+ /**
985
+ * Name of the column with the inference ids. This is useful if you want to update
986
+ * rows at a later point in time. If not provided, a unique id is generated by
987
+ * Openlayer.
988
+ */
989
+ inferenceIdColumnName?: string | null;
990
+
991
+ /**
992
+ * Name of the column with the latencies.
993
+ */
994
+ latencyColumnName?: string | null;
995
+
996
+ /**
997
+ * Name of the column with the timestamps. Timestamps must be in UNIX sec format.
998
+ * If not provided, the upload timestamp is used.
999
+ */
1000
+ timestampColumnName?: string | null;
1001
+ }
1002
+ }
1003
+
1004
+ export interface UnionMember5 {
1005
+ backendType: 'postgres';
1006
+
1007
+ config: UnionMember5.Config;
1008
+
1009
+ database: string;
1010
+
1011
+ postgresConnectionId: string | null;
1012
+
1013
+ schema: string;
1014
+
1015
+ table: string | null;
1016
+ }
1017
+
1018
+ export namespace UnionMember5 {
1019
+ export interface Config {
1020
+ /**
1021
+ * Name of the column with the ground truths.
1022
+ */
1023
+ groundTruthColumnName?: string | null;
1024
+
1025
+ /**
1026
+ * Name of the column with human feedback.
1027
+ */
1028
+ humanFeedbackColumnName?: string | null;
1029
+
1030
+ /**
1031
+ * Name of the column with the inference ids. This is useful if you want to update
1032
+ * rows at a later point in time. If not provided, a unique id is generated by
1033
+ * Openlayer.
1034
+ */
1035
+ inferenceIdColumnName?: string | null;
1036
+
1037
+ /**
1038
+ * Name of the column with the latencies.
1039
+ */
1040
+ latencyColumnName?: string | null;
1041
+
1042
+ /**
1043
+ * Name of the column with the timestamps. Timestamps must be in UNIX sec format.
1044
+ * If not provided, the upload timestamp is used.
1045
+ */
1046
+ timestampColumnName?: string | null;
1047
+ }
1048
+ }
1049
+
653
1050
  export interface Project {
654
1051
  /**
655
1052
  * The project name.
@@ -188,6 +188,12 @@ export interface TestCreateResponse {
188
188
  */
189
189
  archived?: boolean;
190
190
 
191
+ /**
192
+ * Whether to apply the test to all pipelines (data sources) or to a specific set
193
+ * of pipelines. Only applies to tests that use production data.
194
+ */
195
+ defaultToAllPipelines?: boolean | null;
196
+
191
197
  /**
192
198
  * The delay window in seconds. Only applies to tests that use production data.
193
199
  */
@@ -199,6 +205,24 @@ export interface TestCreateResponse {
199
205
  */
200
206
  evaluationWindow?: number | null;
201
207
 
208
+ /**
209
+ * Array of pipelines (data sources) to which the test should not be applied. Only
210
+ * applies to tests that use production data.
211
+ */
212
+ excludePipelines?: Array<string> | null;
213
+
214
+ /**
215
+ * Whether to include historical data in the test result. Only applies to tests
216
+ * that use production data.
217
+ */
218
+ includeHistoricalData?: boolean | null;
219
+
220
+ /**
221
+ * Array of pipelines (data sources) to which the test should be applied. Only
222
+ * applies to tests that use production data.
223
+ */
224
+ includePipelines?: Array<string> | null;
225
+
202
226
  /**
203
227
  * Whether the test uses an ML model.
204
228
  */
@@ -431,6 +455,12 @@ export namespace TestListResponse {
431
455
  */
432
456
  archived?: boolean;
433
457
 
458
+ /**
459
+ * Whether to apply the test to all pipelines (data sources) or to a specific set
460
+ * of pipelines. Only applies to tests that use production data.
461
+ */
462
+ defaultToAllPipelines?: boolean | null;
463
+
434
464
  /**
435
465
  * The delay window in seconds. Only applies to tests that use production data.
436
466
  */
@@ -442,6 +472,24 @@ export namespace TestListResponse {
442
472
  */
443
473
  evaluationWindow?: number | null;
444
474
 
475
+ /**
476
+ * Array of pipelines (data sources) to which the test should not be applied. Only
477
+ * applies to tests that use production data.
478
+ */
479
+ excludePipelines?: Array<string> | null;
480
+
481
+ /**
482
+ * Whether to include historical data in the test result. Only applies to tests
483
+ * that use production data.
484
+ */
485
+ includeHistoricalData?: boolean | null;
486
+
487
+ /**
488
+ * Array of pipelines (data sources) to which the test should be applied. Only
489
+ * applies to tests that use production data.
490
+ */
491
+ includePipelines?: Array<string> | null;
492
+
445
493
  /**
446
494
  * Whether the test uses an ML model.
447
495
  */
@@ -619,6 +667,12 @@ export interface TestCreateParams {
619
667
  */
620
668
  archived?: boolean;
621
669
 
670
+ /**
671
+ * Whether to apply the test to all pipelines (data sources) or to a specific set
672
+ * of pipelines. Only applies to tests that use production data.
673
+ */
674
+ defaultToAllPipelines?: boolean | null;
675
+
622
676
  /**
623
677
  * The delay window in seconds. Only applies to tests that use production data.
624
678
  */
@@ -630,6 +684,24 @@ export interface TestCreateParams {
630
684
  */
631
685
  evaluationWindow?: number | null;
632
686
 
687
+ /**
688
+ * Array of pipelines (data sources) to which the test should not be applied. Only
689
+ * applies to tests that use production data.
690
+ */
691
+ excludePipelines?: Array<string> | null;
692
+
693
+ /**
694
+ * Whether to include historical data in the test result. Only applies to tests
695
+ * that use production data.
696
+ */
697
+ includeHistoricalData?: boolean | null;
698
+
699
+ /**
700
+ * Array of pipelines (data sources) to which the test should be applied. Only
701
+ * applies to tests that use production data.
702
+ */
703
+ includePipelines?: Array<string> | null;
704
+
633
705
  /**
634
706
  * Whether the test uses an ML model.
635
707
  */
@@ -0,0 +1,100 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class Tests extends APIResource {
9
+ /**
10
+ * Triggers one-off evaluation of a specific monitoring test for a custom timestamp
11
+ * range. This allows evaluating tests for historical data or custom time periods
12
+ * outside the regular evaluation window schedule. It also allows overwriting the
13
+ * existing test results.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const response = await client.tests.evaluate(
18
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
19
+ * { endTimestamp: 1700006400, startTimestamp: 1699920000 },
20
+ * );
21
+ * ```
22
+ */
23
+ evaluate(
24
+ testID: string,
25
+ body: TestEvaluateParams,
26
+ options?: RequestOptions,
27
+ ): APIPromise<TestEvaluateResponse> {
28
+ return this._client.post(path`/tests/${testID}/evaluate`, { body, ...options });
29
+ }
30
+ }
31
+
32
+ export interface TestEvaluateResponse {
33
+ message: string;
34
+
35
+ /**
36
+ * Number of inference pipelines the test was queued for evaluation on
37
+ */
38
+ pipelineCount: number;
39
+
40
+ /**
41
+ * The end timestamp you requested (in seconds)
42
+ */
43
+ requestedEndTimestamp: number;
44
+
45
+ /**
46
+ * The start timestamp you requested (in seconds)
47
+ */
48
+ requestedStartTimestamp: number;
49
+
50
+ /**
51
+ * Array of background task information for each pipeline evaluation
52
+ */
53
+ tasks: Array<TestEvaluateResponse.Task>;
54
+ }
55
+
56
+ export namespace TestEvaluateResponse {
57
+ export interface Task {
58
+ /**
59
+ * ID of the inference pipeline this task is for
60
+ */
61
+ pipelineId: string;
62
+
63
+ /**
64
+ * ID of the background task
65
+ */
66
+ taskResultId: string;
67
+
68
+ /**
69
+ * URL to check the status of this background task
70
+ */
71
+ taskResultUrl: string;
72
+ }
73
+ }
74
+
75
+ export interface TestEvaluateParams {
76
+ /**
77
+ * End timestamp in seconds (Unix epoch)
78
+ */
79
+ endTimestamp: number;
80
+
81
+ /**
82
+ * Start timestamp in seconds (Unix epoch)
83
+ */
84
+ startTimestamp: number;
85
+
86
+ /**
87
+ * ID of the inference pipeline to evaluate. If not provided, all inference
88
+ * pipelines the test applies to will be evaluated.
89
+ */
90
+ inferencePipelineId?: string;
91
+
92
+ /**
93
+ * Whether to overwrite existing test results
94
+ */
95
+ overwriteResults?: boolean;
96
+ }
97
+
98
+ export declare namespace Tests {
99
+ export { type TestEvaluateResponse as TestEvaluateResponse, type TestEvaluateParams as TestEvaluateParams };
100
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.18.0'; // x-release-please-version
1
+ export const VERSION = '0.20.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.18.0";
1
+ export declare const VERSION = "0.20.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.18.0";
1
+ export declare const VERSION = "0.20.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.18.0'; // x-release-please-version
4
+ exports.VERSION = '0.20.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.18.0'; // x-release-please-version
1
+ export const VERSION = '0.20.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map