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.
- package/CHANGELOG.md +76 -0
- package/README.md +67 -77
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +17 -3
- package/core.d.ts.map +1 -1
- package/core.js +30 -17
- package/core.js.map +1 -1
- package/core.mjs +31 -18
- package/core.mjs.map +1 -1
- package/index.d.mts +8 -5
- package/index.d.ts +8 -5
- package/index.d.ts.map +1 -1
- package/index.js +6 -2
- package/index.js.map +1 -1
- package/index.mjs +6 -2
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/commits/test-results.d.ts +24 -6
- package/resources/commits/test-results.d.ts.map +1 -1
- package/resources/inference-pipelines/data.d.ts +23 -1
- package/resources/inference-pipelines/data.d.ts.map +1 -1
- package/resources/inference-pipelines/data.js +20 -0
- package/resources/inference-pipelines/data.js.map +1 -1
- package/resources/inference-pipelines/data.mjs +20 -0
- package/resources/inference-pipelines/data.mjs.map +1 -1
- package/resources/inference-pipelines/inference-pipelines.d.ts +95 -0
- package/resources/inference-pipelines/inference-pipelines.d.ts.map +1 -1
- package/resources/inference-pipelines/inference-pipelines.js +7 -0
- package/resources/inference-pipelines/inference-pipelines.js.map +1 -1
- package/resources/inference-pipelines/inference-pipelines.mjs +7 -0
- package/resources/inference-pipelines/inference-pipelines.mjs.map +1 -1
- package/resources/inference-pipelines/rows.d.ts +8 -0
- package/resources/inference-pipelines/rows.d.ts.map +1 -1
- package/resources/inference-pipelines/rows.js +8 -0
- package/resources/inference-pipelines/rows.js.map +1 -1
- package/resources/inference-pipelines/rows.mjs +8 -0
- package/resources/inference-pipelines/rows.mjs.map +1 -1
- package/resources/inference-pipelines/test-results.d.ts +31 -5
- package/resources/inference-pipelines/test-results.d.ts.map +1 -1
- package/resources/inference-pipelines/test-results.js.map +1 -1
- package/resources/inference-pipelines/test-results.mjs.map +1 -1
- package/resources/projects/commits.d.ts +18 -0
- package/resources/projects/commits.d.ts.map +1 -1
- package/resources/projects/commits.js +11 -0
- package/resources/projects/commits.js.map +1 -1
- package/resources/projects/commits.mjs +11 -0
- package/resources/projects/commits.mjs.map +1 -1
- package/resources/projects/index.d.ts +1 -0
- package/resources/projects/index.d.ts.map +1 -1
- package/resources/projects/index.js +3 -1
- package/resources/projects/index.js.map +1 -1
- package/resources/projects/index.mjs +1 -0
- package/resources/projects/index.mjs.map +1 -1
- package/resources/projects/inference-pipelines.d.ts +104 -0
- package/resources/projects/inference-pipelines.d.ts.map +1 -1
- package/resources/projects/inference-pipelines.js +12 -0
- package/resources/projects/inference-pipelines.js.map +1 -1
- package/resources/projects/inference-pipelines.mjs +12 -0
- package/resources/projects/inference-pipelines.mjs.map +1 -1
- package/resources/projects/projects.d.ts +17 -0
- package/resources/projects/projects.d.ts.map +1 -1
- package/resources/projects/projects.js +12 -0
- package/resources/projects/projects.js.map +1 -1
- package/resources/projects/projects.mjs +12 -0
- package/resources/projects/projects.mjs.map +1 -1
- package/resources/projects/tests.d.ts +501 -0
- package/resources/projects/tests.d.ts.map +1 -0
- package/resources/projects/tests.js +55 -0
- package/resources/projects/tests.js.map +1 -0
- package/resources/projects/tests.mjs +51 -0
- package/resources/projects/tests.mjs.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +18 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/_shims/index.d.ts +2 -0
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +5 -1
- package/src/core.ts +49 -15
- package/src/index.ts +15 -5
- package/src/resource.ts +1 -1
- package/src/resources/commits/test-results.ts +102 -6
- package/src/resources/inference-pipelines/data.ts +21 -1
- package/src/resources/inference-pipelines/inference-pipelines.ts +95 -0
- package/src/resources/inference-pipelines/rows.ts +8 -0
- package/src/resources/inference-pipelines/test-results.ts +109 -5
- package/src/resources/projects/commits.ts +18 -0
- package/src/resources/projects/index.ts +9 -0
- package/src/resources/projects/inference-pipelines.ts +104 -0
- package/src/resources/projects/projects.ts +35 -0
- package/src/resources/projects/tests.ts +905 -0
- package/src/resources.ts +1 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
|
package/src/_shims/index.d.ts
CHANGED
|
@@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi
|
|
|
79
79
|
export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;
|
|
80
80
|
|
|
81
81
|
export function isFsReadStream(value: any): value is FsReadStream;
|
|
82
|
+
|
|
83
|
+
export const init: () => void;
|
package/src/_shims/index.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
const shims = require('./registry');
|
|
5
5
|
const auto = require('openlayer/_shims/auto/runtime');
|
|
6
|
-
|
|
6
|
+
exports.init = () => {
|
|
7
|
+
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
|
|
8
|
+
};
|
|
7
9
|
for (const property of Object.keys(shims)) {
|
|
8
10
|
Object.defineProperty(exports, property, {
|
|
9
11
|
get() {
|
|
@@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) {
|
|
|
11
13
|
},
|
|
12
14
|
});
|
|
13
15
|
}
|
|
16
|
+
|
|
17
|
+
exports.init();
|
package/src/_shims/index.mjs
CHANGED
|
@@ -3,5 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as shims from './registry.mjs';
|
|
5
5
|
import * as auto from "./auto/runtime";
|
|
6
|
-
|
|
6
|
+
export const init = () => {
|
|
7
|
+
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
|
|
8
|
+
};
|
|
7
9
|
export * from './registry.mjs';
|
|
10
|
+
|
|
11
|
+
init();
|
package/src/core.ts
CHANGED
|
@@ -16,7 +16,12 @@ import {
|
|
|
16
16
|
type RequestInit,
|
|
17
17
|
type Response,
|
|
18
18
|
type HeadersInit,
|
|
19
|
+
init,
|
|
19
20
|
} from './_shims/index';
|
|
21
|
+
|
|
22
|
+
// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881
|
|
23
|
+
init();
|
|
24
|
+
|
|
20
25
|
export { type Response };
|
|
21
26
|
import { BlobLike, isBlobLike, isMultipartBody } from './uploads';
|
|
22
27
|
export {
|
|
@@ -28,6 +33,20 @@ export {
|
|
|
28
33
|
|
|
29
34
|
export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
30
35
|
|
|
36
|
+
/**
|
|
37
|
+
* An alias to the builtin `Array` type so we can
|
|
38
|
+
* easily alias it in import statements if there are name clashes.
|
|
39
|
+
*/
|
|
40
|
+
type _Array<T> = Array<T>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* An alias to the builtin `Record` type so we can
|
|
44
|
+
* easily alias it in import statements if there are name clashes.
|
|
45
|
+
*/
|
|
46
|
+
type _Record<K extends keyof any, T> = Record<K, T>;
|
|
47
|
+
|
|
48
|
+
export type { _Array as Array, _Record as Record };
|
|
49
|
+
|
|
31
50
|
type PromiseOrValue<T> = T | Promise<T>;
|
|
32
51
|
|
|
33
52
|
type APIResponseProps = {
|
|
@@ -151,6 +170,7 @@ export class APIPromise<T> extends Promise<T> {
|
|
|
151
170
|
|
|
152
171
|
export abstract class APIClient {
|
|
153
172
|
baseURL: string;
|
|
173
|
+
#baseURLOverridden: boolean;
|
|
154
174
|
maxRetries: number;
|
|
155
175
|
timeout: number;
|
|
156
176
|
httpAgent: Agent | undefined;
|
|
@@ -160,18 +180,21 @@ export abstract class APIClient {
|
|
|
160
180
|
|
|
161
181
|
constructor({
|
|
162
182
|
baseURL,
|
|
183
|
+
baseURLOverridden,
|
|
163
184
|
maxRetries = 2,
|
|
164
185
|
timeout = 60000, // 1 minute
|
|
165
186
|
httpAgent,
|
|
166
187
|
fetch: overriddenFetch,
|
|
167
188
|
}: {
|
|
168
189
|
baseURL: string;
|
|
190
|
+
baseURLOverridden: boolean;
|
|
169
191
|
maxRetries?: number | undefined;
|
|
170
192
|
timeout: number | undefined;
|
|
171
193
|
httpAgent: Agent | undefined;
|
|
172
194
|
fetch: Fetch | undefined;
|
|
173
195
|
}) {
|
|
174
196
|
this.baseURL = baseURL;
|
|
197
|
+
this.#baseURLOverridden = baseURLOverridden;
|
|
175
198
|
this.maxRetries = validatePositiveInteger('maxRetries', maxRetries);
|
|
176
199
|
this.timeout = validatePositiveInteger('timeout', timeout);
|
|
177
200
|
this.httpAgent = httpAgent;
|
|
@@ -194,7 +217,7 @@ export abstract class APIClient {
|
|
|
194
217
|
protected defaultHeaders(opts: FinalRequestOptions): Headers {
|
|
195
218
|
return {
|
|
196
219
|
Accept: 'application/json',
|
|
197
|
-
'Content-Type': 'application/json',
|
|
220
|
+
...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }),
|
|
198
221
|
'User-Agent': this.getUserAgent(),
|
|
199
222
|
...getPlatformHeaders(),
|
|
200
223
|
...this.authHeaders(opts),
|
|
@@ -277,10 +300,11 @@ export abstract class APIClient {
|
|
|
277
300
|
}
|
|
278
301
|
|
|
279
302
|
buildRequest<Req>(
|
|
280
|
-
|
|
303
|
+
inputOptions: FinalRequestOptions<Req>,
|
|
281
304
|
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
282
305
|
): { req: RequestInit; url: string; timeout: number } {
|
|
283
|
-
const
|
|
306
|
+
const options = { ...inputOptions };
|
|
307
|
+
const { method, path, query, defaultBaseURL, headers: headers = {} } = options;
|
|
284
308
|
|
|
285
309
|
const body =
|
|
286
310
|
ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ?
|
|
@@ -290,11 +314,11 @@ export abstract class APIClient {
|
|
|
290
314
|
: null;
|
|
291
315
|
const contentLength = this.calculateContentLength(body);
|
|
292
316
|
|
|
293
|
-
const url = this.buildURL(path!, query);
|
|
317
|
+
const url = this.buildURL(path!, query, defaultBaseURL);
|
|
294
318
|
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
|
|
295
|
-
|
|
319
|
+
options.timeout = options.timeout ?? this.timeout;
|
|
296
320
|
const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
|
|
297
|
-
const minAgentTimeout = timeout + 1000;
|
|
321
|
+
const minAgentTimeout = options.timeout + 1000;
|
|
298
322
|
if (
|
|
299
323
|
typeof (httpAgent as any)?.options?.timeout === 'number' &&
|
|
300
324
|
minAgentTimeout > ((httpAgent as any).options.timeout ?? 0)
|
|
@@ -307,8 +331,8 @@ export abstract class APIClient {
|
|
|
307
331
|
}
|
|
308
332
|
|
|
309
333
|
if (this.idempotencyHeader && method !== 'get') {
|
|
310
|
-
if (!
|
|
311
|
-
headers[this.idempotencyHeader] =
|
|
334
|
+
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
|
|
335
|
+
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
|
|
312
336
|
}
|
|
313
337
|
|
|
314
338
|
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
|
|
@@ -323,7 +347,7 @@ export abstract class APIClient {
|
|
|
323
347
|
signal: options.signal ?? null,
|
|
324
348
|
};
|
|
325
349
|
|
|
326
|
-
return { req, url, timeout };
|
|
350
|
+
return { req, url, timeout: options.timeout };
|
|
327
351
|
}
|
|
328
352
|
|
|
329
353
|
private buildHeaders({
|
|
@@ -351,15 +375,22 @@ export abstract class APIClient {
|
|
|
351
375
|
delete reqHeaders['content-type'];
|
|
352
376
|
}
|
|
353
377
|
|
|
354
|
-
// Don't set
|
|
355
|
-
//
|
|
356
|
-
//
|
|
378
|
+
// Don't set theses headers if they were already set or removed through default headers or by the caller.
|
|
379
|
+
// We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account
|
|
380
|
+
// for the removal case.
|
|
357
381
|
if (
|
|
358
382
|
getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
|
|
359
383
|
getHeader(headers, 'x-stainless-retry-count') === undefined
|
|
360
384
|
) {
|
|
361
385
|
reqHeaders['x-stainless-retry-count'] = String(retryCount);
|
|
362
386
|
}
|
|
387
|
+
if (
|
|
388
|
+
getHeader(defaultHeaders, 'x-stainless-timeout') === undefined &&
|
|
389
|
+
getHeader(headers, 'x-stainless-timeout') === undefined &&
|
|
390
|
+
options.timeout
|
|
391
|
+
) {
|
|
392
|
+
reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000));
|
|
393
|
+
}
|
|
363
394
|
|
|
364
395
|
this.validateHeaders(reqHeaders, headers);
|
|
365
396
|
|
|
@@ -387,7 +418,7 @@ export abstract class APIClient {
|
|
|
387
418
|
!headers ? {}
|
|
388
419
|
: Symbol.iterator in headers ?
|
|
389
420
|
Object.fromEntries(Array.from(headers as Iterable<string[]>).map((header) => [...header]))
|
|
390
|
-
: { ...headers }
|
|
421
|
+
: { ...(headers as any as Record<string, string>) }
|
|
391
422
|
);
|
|
392
423
|
}
|
|
393
424
|
|
|
@@ -476,11 +507,12 @@ export abstract class APIClient {
|
|
|
476
507
|
return new PagePromise<PageClass, Item>(this, request, Page);
|
|
477
508
|
}
|
|
478
509
|
|
|
479
|
-
buildURL<Req>(path: string, query: Req | null | undefined): string {
|
|
510
|
+
buildURL<Req>(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string {
|
|
511
|
+
const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL;
|
|
480
512
|
const url =
|
|
481
513
|
isAbsoluteURL(path) ?
|
|
482
514
|
new URL(path)
|
|
483
|
-
: new URL(
|
|
515
|
+
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
484
516
|
|
|
485
517
|
const defaultQuery = this.defaultQuery();
|
|
486
518
|
if (!isEmptyObj(defaultQuery)) {
|
|
@@ -765,6 +797,7 @@ export type RequestOptions<
|
|
|
765
797
|
query?: Req | undefined;
|
|
766
798
|
body?: Req | null | undefined;
|
|
767
799
|
headers?: Headers | undefined;
|
|
800
|
+
defaultBaseURL?: string | undefined;
|
|
768
801
|
|
|
769
802
|
maxRetries?: number;
|
|
770
803
|
stream?: boolean | undefined;
|
|
@@ -786,6 +819,7 @@ const requestOptionsKeys: KeysEnum<RequestOptions> = {
|
|
|
786
819
|
query: true,
|
|
787
820
|
body: true,
|
|
788
821
|
headers: true,
|
|
822
|
+
defaultBaseURL: true,
|
|
789
823
|
|
|
790
824
|
maxRetries: true,
|
|
791
825
|
stream: true,
|
package/src/index.ts
CHANGED
|
@@ -42,8 +42,10 @@ export interface ClientOptions {
|
|
|
42
42
|
*
|
|
43
43
|
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
44
44
|
* much longer than this timeout before the promise succeeds or fails.
|
|
45
|
+
*
|
|
46
|
+
* @unit milliseconds
|
|
45
47
|
*/
|
|
46
|
-
timeout?: number;
|
|
48
|
+
timeout?: number | undefined;
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
* An HTTP agent used to manage HTTP(S) connections.
|
|
@@ -51,7 +53,7 @@ export interface ClientOptions {
|
|
|
51
53
|
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
52
54
|
* otherwise no agent is used.
|
|
53
55
|
*/
|
|
54
|
-
httpAgent?: Agent;
|
|
56
|
+
httpAgent?: Agent | undefined;
|
|
55
57
|
|
|
56
58
|
/**
|
|
57
59
|
* Specify a custom `fetch` function implementation.
|
|
@@ -67,7 +69,7 @@ export interface ClientOptions {
|
|
|
67
69
|
*
|
|
68
70
|
* @default 2
|
|
69
71
|
*/
|
|
70
|
-
maxRetries?: number;
|
|
72
|
+
maxRetries?: number | undefined;
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
75
|
* Default headers to include with every request to the API.
|
|
@@ -75,7 +77,7 @@ export interface ClientOptions {
|
|
|
75
77
|
* These can be removed in individual requests by explicitly setting the
|
|
76
78
|
* header to `undefined` or `null` in request options.
|
|
77
79
|
*/
|
|
78
|
-
defaultHeaders?: Core.Headers;
|
|
80
|
+
defaultHeaders?: Core.Headers | undefined;
|
|
79
81
|
|
|
80
82
|
/**
|
|
81
83
|
* Default query parameters to include with every request to the API.
|
|
@@ -83,7 +85,7 @@ export interface ClientOptions {
|
|
|
83
85
|
* These can be removed in individual requests by explicitly setting the
|
|
84
86
|
* param to `undefined` in request options.
|
|
85
87
|
*/
|
|
86
|
-
defaultQuery?: Core.DefaultQuery;
|
|
88
|
+
defaultQuery?: Core.DefaultQuery | undefined;
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
/**
|
|
@@ -119,6 +121,7 @@ export class Openlayer extends Core.APIClient {
|
|
|
119
121
|
|
|
120
122
|
super({
|
|
121
123
|
baseURL: options.baseURL!,
|
|
124
|
+
baseURLOverridden: baseURL ? baseURL !== 'https://api.openlayer.com/v1' : false,
|
|
122
125
|
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
123
126
|
httpAgent: options.httpAgent,
|
|
124
127
|
maxRetries: options.maxRetries,
|
|
@@ -135,6 +138,13 @@ export class Openlayer extends Core.APIClient {
|
|
|
135
138
|
inferencePipelines: API.InferencePipelines = new API.InferencePipelines(this);
|
|
136
139
|
storage: API.Storage = new API.Storage(this);
|
|
137
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Check whether the base URL is set to its default.
|
|
143
|
+
*/
|
|
144
|
+
#baseURLOverridden(): boolean {
|
|
145
|
+
return this.baseURL !== 'https://api.openlayer.com/v1';
|
|
146
|
+
}
|
|
147
|
+
|
|
138
148
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
|
139
149
|
return this._options.defaultQuery;
|
|
140
150
|
}
|
package/src/resource.ts
CHANGED
|
@@ -140,7 +140,48 @@ export namespace TestResultListResponse {
|
|
|
140
140
|
/**
|
|
141
141
|
* The test subtype.
|
|
142
142
|
*/
|
|
143
|
-
subtype:
|
|
143
|
+
subtype:
|
|
144
|
+
| 'anomalousColumnCount'
|
|
145
|
+
| 'characterLength'
|
|
146
|
+
| 'classImbalanceRatio'
|
|
147
|
+
| 'expectColumnAToBeInColumnB'
|
|
148
|
+
| 'columnAverage'
|
|
149
|
+
| 'columnDrift'
|
|
150
|
+
| 'columnStatistic'
|
|
151
|
+
| 'columnValuesMatch'
|
|
152
|
+
| 'conflictingLabelRowCount'
|
|
153
|
+
| 'containsPii'
|
|
154
|
+
| 'containsValidUrl'
|
|
155
|
+
| 'correlatedFeatureCount'
|
|
156
|
+
| 'customMetricThreshold'
|
|
157
|
+
| 'duplicateRowCount'
|
|
158
|
+
| 'emptyFeature'
|
|
159
|
+
| 'emptyFeatureCount'
|
|
160
|
+
| 'driftedFeatureCount'
|
|
161
|
+
| 'featureMissingValues'
|
|
162
|
+
| 'featureValueValidation'
|
|
163
|
+
| 'greatExpectations'
|
|
164
|
+
| 'groupByColumnStatsCheck'
|
|
165
|
+
| 'illFormedRowCount'
|
|
166
|
+
| 'isCode'
|
|
167
|
+
| 'isJson'
|
|
168
|
+
| 'llmRubricThresholdV2'
|
|
169
|
+
| 'labelDrift'
|
|
170
|
+
| 'metricThreshold'
|
|
171
|
+
| 'newCategoryCount'
|
|
172
|
+
| 'newLabelCount'
|
|
173
|
+
| 'nullRowCount'
|
|
174
|
+
| 'rowCount'
|
|
175
|
+
| 'ppScoreValueValidation'
|
|
176
|
+
| 'quasiConstantFeature'
|
|
177
|
+
| 'quasiConstantFeatureCount'
|
|
178
|
+
| 'sqlQuery'
|
|
179
|
+
| 'dtypeValidation'
|
|
180
|
+
| 'sentenceLength'
|
|
181
|
+
| 'sizeRatio'
|
|
182
|
+
| 'specialCharactersRatio'
|
|
183
|
+
| 'stringValidation'
|
|
184
|
+
| 'trainValLeakageRowCount';
|
|
144
185
|
|
|
145
186
|
/**
|
|
146
187
|
* Whether the test is suggested or user-created.
|
|
@@ -152,7 +193,7 @@ export namespace TestResultListResponse {
|
|
|
152
193
|
/**
|
|
153
194
|
* The test type.
|
|
154
195
|
*/
|
|
155
|
-
type:
|
|
196
|
+
type: 'integrity' | 'consistency' | 'performance';
|
|
156
197
|
|
|
157
198
|
/**
|
|
158
199
|
* Whether the test is archived.
|
|
@@ -201,9 +242,48 @@ export namespace TestResultListResponse {
|
|
|
201
242
|
/**
|
|
202
243
|
* The insight name to be evaluated.
|
|
203
244
|
*/
|
|
204
|
-
insightName?:
|
|
245
|
+
insightName?:
|
|
246
|
+
| 'characterLength'
|
|
247
|
+
| 'classImbalance'
|
|
248
|
+
| 'expectColumnAToBeInColumnB'
|
|
249
|
+
| 'columnAverage'
|
|
250
|
+
| 'columnDrift'
|
|
251
|
+
| 'columnValuesMatch'
|
|
252
|
+
| 'confidenceDistribution'
|
|
253
|
+
| 'conflictingLabelRowCount'
|
|
254
|
+
| 'containsPii'
|
|
255
|
+
| 'containsValidUrl'
|
|
256
|
+
| 'correlatedFeatures'
|
|
257
|
+
| 'customMetric'
|
|
258
|
+
| 'duplicateRowCount'
|
|
259
|
+
| 'emptyFeatures'
|
|
260
|
+
| 'featureDrift'
|
|
261
|
+
| 'featureProfile'
|
|
262
|
+
| 'greatExpectations'
|
|
263
|
+
| 'groupByColumnStatsCheck'
|
|
264
|
+
| 'illFormedRowCount'
|
|
265
|
+
| 'isCode'
|
|
266
|
+
| 'isJson'
|
|
267
|
+
| 'llmRubricV2'
|
|
268
|
+
| 'labelDrift'
|
|
269
|
+
| 'metrics'
|
|
270
|
+
| 'newCategories'
|
|
271
|
+
| 'newLabels'
|
|
272
|
+
| 'nullRowCount'
|
|
273
|
+
| 'ppScore'
|
|
274
|
+
| 'quasiConstantFeatures'
|
|
275
|
+
| 'sentenceLength'
|
|
276
|
+
| 'sizeRatio'
|
|
277
|
+
| 'specialCharacters'
|
|
278
|
+
| 'stringValidation'
|
|
279
|
+
| 'trainValLeakageRowCount';
|
|
205
280
|
|
|
206
|
-
|
|
281
|
+
/**
|
|
282
|
+
* The insight parameters. Required only for some test subtypes. For example, for
|
|
283
|
+
* tests that require a column name, the insight parameters will be [{'name':
|
|
284
|
+
* 'column_name', 'value': 'Age'}]
|
|
285
|
+
*/
|
|
286
|
+
insightParameters?: Array<Threshold.InsightParameter> | null;
|
|
207
287
|
|
|
208
288
|
/**
|
|
209
289
|
* The measurement to be evaluated.
|
|
@@ -213,20 +293,36 @@ export namespace TestResultListResponse {
|
|
|
213
293
|
/**
|
|
214
294
|
* The operator to be used for the evaluation.
|
|
215
295
|
*/
|
|
216
|
-
operator?:
|
|
296
|
+
operator?: 'is' | '>' | '>=' | '<' | '<=' | '!=';
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Whether to use automatic anomaly detection or manual thresholds
|
|
300
|
+
*/
|
|
301
|
+
thresholdMode?: 'automatic' | 'manual';
|
|
217
302
|
|
|
218
303
|
/**
|
|
219
304
|
* The value to be compared.
|
|
220
305
|
*/
|
|
221
306
|
value?: number | boolean | string | Array<string>;
|
|
222
307
|
}
|
|
308
|
+
|
|
309
|
+
export namespace Threshold {
|
|
310
|
+
export interface InsightParameter {
|
|
311
|
+
/**
|
|
312
|
+
* The name of the insight filter.
|
|
313
|
+
*/
|
|
314
|
+
name: string;
|
|
315
|
+
|
|
316
|
+
value: unknown;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
223
319
|
}
|
|
224
320
|
}
|
|
225
321
|
}
|
|
226
322
|
|
|
227
323
|
export interface TestResultListParams {
|
|
228
324
|
/**
|
|
229
|
-
*
|
|
325
|
+
* Filter for archived tests.
|
|
230
326
|
*/
|
|
231
327
|
includeArchived?: boolean;
|
|
232
328
|
|
|
@@ -6,6 +6,26 @@ import * as Core from '../../core';
|
|
|
6
6
|
export class Data extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Publish an inference data point to an inference pipeline.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const response =
|
|
13
|
+
* await client.inferencePipelines.data.stream(
|
|
14
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
15
|
+
* {
|
|
16
|
+
* config: { outputColumnName: 'output' },
|
|
17
|
+
* rows: [
|
|
18
|
+
* {
|
|
19
|
+
* user_query: 'bar',
|
|
20
|
+
* output: 'bar',
|
|
21
|
+
* tokens: 'bar',
|
|
22
|
+
* cost: 'bar',
|
|
23
|
+
* timestamp: 'bar',
|
|
24
|
+
* },
|
|
25
|
+
* ],
|
|
26
|
+
* },
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
9
29
|
*/
|
|
10
30
|
stream(
|
|
11
31
|
inferencePipelineId: string,
|
|
@@ -34,7 +54,7 @@ export interface DataStreamParams {
|
|
|
34
54
|
/**
|
|
35
55
|
* A list of inference data points with inputs and outputs
|
|
36
56
|
*/
|
|
37
|
-
rows: Array<
|
|
57
|
+
rows: Array<{ [key: string]: unknown }>;
|
|
38
58
|
}
|
|
39
59
|
|
|
40
60
|
export namespace DataStreamParams {
|
|
@@ -17,6 +17,14 @@ export class InferencePipelines extends APIResource {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Retrieve inference pipeline.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const inferencePipeline =
|
|
24
|
+
* await client.inferencePipelines.retrieve(
|
|
25
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
20
28
|
*/
|
|
21
29
|
retrieve(
|
|
22
30
|
inferencePipelineId: string,
|
|
@@ -40,6 +48,14 @@ export class InferencePipelines extends APIResource {
|
|
|
40
48
|
|
|
41
49
|
/**
|
|
42
50
|
* Update inference pipeline.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const inferencePipeline =
|
|
55
|
+
* await client.inferencePipelines.update(
|
|
56
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
57
|
+
* );
|
|
58
|
+
* ```
|
|
43
59
|
*/
|
|
44
60
|
update(
|
|
45
61
|
inferencePipelineId: string,
|
|
@@ -63,6 +79,13 @@ export class InferencePipelines extends APIResource {
|
|
|
63
79
|
|
|
64
80
|
/**
|
|
65
81
|
* Delete inference pipeline.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* await client.inferencePipelines.delete(
|
|
86
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
87
|
+
* );
|
|
88
|
+
* ```
|
|
66
89
|
*/
|
|
67
90
|
delete(inferencePipelineId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
68
91
|
return this._client.delete(`/inference-pipelines/${inferencePipelineId}`, {
|
|
@@ -275,26 +298,59 @@ export namespace InferencePipelineRetrieveResponse {
|
|
|
275
298
|
}
|
|
276
299
|
|
|
277
300
|
export interface Workspace {
|
|
301
|
+
/**
|
|
302
|
+
* The workspace id.
|
|
303
|
+
*/
|
|
278
304
|
id: string;
|
|
279
305
|
|
|
306
|
+
/**
|
|
307
|
+
* The workspace creator id.
|
|
308
|
+
*/
|
|
280
309
|
creatorId: string | null;
|
|
281
310
|
|
|
311
|
+
/**
|
|
312
|
+
* The workspace creation date.
|
|
313
|
+
*/
|
|
282
314
|
dateCreated: string;
|
|
283
315
|
|
|
316
|
+
/**
|
|
317
|
+
* The workspace last updated date.
|
|
318
|
+
*/
|
|
284
319
|
dateUpdated: string;
|
|
285
320
|
|
|
321
|
+
/**
|
|
322
|
+
* The number of invites in the workspace.
|
|
323
|
+
*/
|
|
286
324
|
inviteCount: number;
|
|
287
325
|
|
|
326
|
+
/**
|
|
327
|
+
* The number of members in the workspace.
|
|
328
|
+
*/
|
|
288
329
|
memberCount: number;
|
|
289
330
|
|
|
331
|
+
/**
|
|
332
|
+
* The workspace name.
|
|
333
|
+
*/
|
|
290
334
|
name: string;
|
|
291
335
|
|
|
336
|
+
/**
|
|
337
|
+
* The end date of the current billing period.
|
|
338
|
+
*/
|
|
292
339
|
periodEndDate: string | null;
|
|
293
340
|
|
|
341
|
+
/**
|
|
342
|
+
* The start date of the current billing period.
|
|
343
|
+
*/
|
|
294
344
|
periodStartDate: string | null;
|
|
295
345
|
|
|
346
|
+
/**
|
|
347
|
+
* The number of projects in the workspace.
|
|
348
|
+
*/
|
|
296
349
|
projectCount: number;
|
|
297
350
|
|
|
351
|
+
/**
|
|
352
|
+
* The workspace slug.
|
|
353
|
+
*/
|
|
298
354
|
slug: string;
|
|
299
355
|
|
|
300
356
|
status:
|
|
@@ -309,6 +365,9 @@ export namespace InferencePipelineRetrieveResponse {
|
|
|
309
365
|
|
|
310
366
|
monthlyUsage?: Array<Workspace.MonthlyUsage>;
|
|
311
367
|
|
|
368
|
+
/**
|
|
369
|
+
* Whether the workspace only allows SAML authentication.
|
|
370
|
+
*/
|
|
312
371
|
samlOnlyAccess?: boolean;
|
|
313
372
|
|
|
314
373
|
wildcardDomains?: Array<string>;
|
|
@@ -528,26 +587,59 @@ export namespace InferencePipelineUpdateResponse {
|
|
|
528
587
|
}
|
|
529
588
|
|
|
530
589
|
export interface Workspace {
|
|
590
|
+
/**
|
|
591
|
+
* The workspace id.
|
|
592
|
+
*/
|
|
531
593
|
id: string;
|
|
532
594
|
|
|
595
|
+
/**
|
|
596
|
+
* The workspace creator id.
|
|
597
|
+
*/
|
|
533
598
|
creatorId: string | null;
|
|
534
599
|
|
|
600
|
+
/**
|
|
601
|
+
* The workspace creation date.
|
|
602
|
+
*/
|
|
535
603
|
dateCreated: string;
|
|
536
604
|
|
|
605
|
+
/**
|
|
606
|
+
* The workspace last updated date.
|
|
607
|
+
*/
|
|
537
608
|
dateUpdated: string;
|
|
538
609
|
|
|
610
|
+
/**
|
|
611
|
+
* The number of invites in the workspace.
|
|
612
|
+
*/
|
|
539
613
|
inviteCount: number;
|
|
540
614
|
|
|
615
|
+
/**
|
|
616
|
+
* The number of members in the workspace.
|
|
617
|
+
*/
|
|
541
618
|
memberCount: number;
|
|
542
619
|
|
|
620
|
+
/**
|
|
621
|
+
* The workspace name.
|
|
622
|
+
*/
|
|
543
623
|
name: string;
|
|
544
624
|
|
|
625
|
+
/**
|
|
626
|
+
* The end date of the current billing period.
|
|
627
|
+
*/
|
|
545
628
|
periodEndDate: string | null;
|
|
546
629
|
|
|
630
|
+
/**
|
|
631
|
+
* The start date of the current billing period.
|
|
632
|
+
*/
|
|
547
633
|
periodStartDate: string | null;
|
|
548
634
|
|
|
635
|
+
/**
|
|
636
|
+
* The number of projects in the workspace.
|
|
637
|
+
*/
|
|
549
638
|
projectCount: number;
|
|
550
639
|
|
|
640
|
+
/**
|
|
641
|
+
* The workspace slug.
|
|
642
|
+
*/
|
|
551
643
|
slug: string;
|
|
552
644
|
|
|
553
645
|
status:
|
|
@@ -562,6 +654,9 @@ export namespace InferencePipelineUpdateResponse {
|
|
|
562
654
|
|
|
563
655
|
monthlyUsage?: Array<Workspace.MonthlyUsage>;
|
|
564
656
|
|
|
657
|
+
/**
|
|
658
|
+
* Whether the workspace only allows SAML authentication.
|
|
659
|
+
*/
|
|
565
660
|
samlOnlyAccess?: boolean;
|
|
566
661
|
|
|
567
662
|
wildcardDomains?: Array<string>;
|
|
@@ -6,6 +6,14 @@ import * as Core from '../../core';
|
|
|
6
6
|
export class Rows extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Update an inference data point in an inference pipeline.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const row = await client.inferencePipelines.rows.update(
|
|
13
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
14
|
+
* { inferenceId: 'inferenceId', row: {} },
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
9
17
|
*/
|
|
10
18
|
update(
|
|
11
19
|
inferencePipelineId: string,
|