scorecard-ai 1.0.0-alpha.2 → 1.0.0-alpha.3
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 +14 -0
- package/README.md +9 -11
- package/client.d.mts +3 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -3
- package/client.d.ts.map +1 -1
- package/client.js +9 -7
- package/client.js.map +1 -1
- package/client.mjs +9 -7
- package/client.mjs.map +1 -1
- package/internal/headers.d.mts +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +2 -0
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +2 -0
- package/internal/headers.mjs.map +1 -1
- package/internal/utils/base64.d.mts.map +1 -1
- package/internal/utils/base64.d.ts.map +1 -1
- package/internal/utils/base64.js +4 -3
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +4 -3
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +32 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/lib/runAndEvaluate.d.mts +19 -0
- package/lib/runAndEvaluate.d.mts.map +1 -0
- package/lib/runAndEvaluate.d.ts +19 -0
- package/lib/runAndEvaluate.d.ts.map +1 -0
- package/lib/runAndEvaluate.js +40 -0
- package/lib/runAndEvaluate.js.map +1 -0
- package/lib/runAndEvaluate.mjs +36 -0
- package/lib/runAndEvaluate.mjs.map +1 -0
- package/package.json +11 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/projects.d.mts +5 -5
- package/resources/projects.d.ts +5 -5
- package/resources/projects.js +2 -2
- package/resources/projects.mjs +2 -2
- package/resources/records.d.mts +63 -0
- package/resources/records.d.mts.map +1 -0
- package/resources/records.d.ts +63 -0
- package/resources/records.d.ts.map +1 -0
- package/resources/{execution-records.js → records.js} +6 -6
- package/resources/records.js.map +1 -0
- package/resources/{execution-records.mjs → records.mjs} +4 -4
- package/resources/records.mjs.map +1 -0
- package/resources/runs.d.mts +13 -13
- package/resources/runs.d.ts +13 -13
- package/resources/runs.js +2 -2
- package/resources/runs.mjs +2 -2
- package/resources/shared.d.mts +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/system-configs.d.mts +11 -11
- package/resources/system-configs.d.ts +11 -11
- package/resources/systems.d.mts +20 -20
- package/resources/systems.d.ts +20 -20
- package/resources/testcases.d.mts +23 -23
- package/resources/testcases.d.ts +23 -23
- package/resources/testcases.js +5 -5
- package/resources/testcases.mjs +5 -5
- package/resources/testsets.d.mts +43 -42
- package/resources/testsets.d.mts.map +1 -1
- package/resources/testsets.d.ts +43 -42
- package/resources/testsets.d.ts.map +1 -1
- package/resources/testsets.js +5 -5
- package/resources/testsets.mjs +5 -5
- package/src/client.ts +11 -15
- package/src/internal/headers.ts +3 -2
- package/src/internal/utils/base64.ts +5 -4
- package/src/internal/utils/bytes.ts +32 -0
- package/src/lib/runAndEvaluate.ts +54 -0
- package/src/resources/index.ts +1 -5
- package/src/resources/projects.ts +5 -5
- package/src/resources/records.ts +79 -0
- package/src/resources/runs.ts +13 -13
- package/src/resources/shared.ts +1 -1
- package/src/resources/system-configs.ts +11 -11
- package/src/resources/systems.ts +20 -20
- package/src/resources/testcases.ts +23 -23
- package/src/resources/testsets.ts +43 -42
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/execution-records.d.mts +0 -62
- package/resources/execution-records.d.mts.map +0 -1
- package/resources/execution-records.d.ts +0 -62
- package/resources/execution-records.d.ts.map +0 -1
- package/resources/execution-records.js.map +0 -1
- package/resources/execution-records.mjs.map +0 -1
- package/src/resources/execution-records.ts +0 -85
|
@@ -4,72 +4,72 @@ import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "..
|
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
5
|
export declare class Testcases extends APIResource {
|
|
6
6
|
/**
|
|
7
|
-
* Create multiple
|
|
7
|
+
* Create multiple Testcases in the specified Testset.
|
|
8
8
|
*/
|
|
9
9
|
create(testsetID: string, body: TestcaseCreateParams, options?: RequestOptions): APIPromise<TestcaseCreateResponse>;
|
|
10
10
|
/**
|
|
11
|
-
* Replace the data of an existing
|
|
11
|
+
* Replace the data of an existing Testcase while keeping its ID.
|
|
12
12
|
*/
|
|
13
13
|
update(testcaseID: string, body: TestcaseUpdateParams, options?: RequestOptions): APIPromise<Testcase>;
|
|
14
14
|
/**
|
|
15
|
-
* Retrieve a paginated list of
|
|
15
|
+
* Retrieve a paginated list of Testcases belonging to a Testset.
|
|
16
16
|
*/
|
|
17
17
|
list(testsetID: string, query?: TestcaseListParams | null | undefined, options?: RequestOptions): PagePromise<TestcasesPaginatedResponse, Testcase>;
|
|
18
18
|
/**
|
|
19
|
-
* Delete multiple
|
|
19
|
+
* Delete multiple Testcases by their IDs.
|
|
20
20
|
*/
|
|
21
21
|
delete(body: TestcaseDeleteParams, options?: RequestOptions): APIPromise<TestcaseDeleteResponse>;
|
|
22
22
|
/**
|
|
23
|
-
* Retrieve a specific
|
|
23
|
+
* Retrieve a specific Testcase by ID.
|
|
24
24
|
*/
|
|
25
25
|
get(testcaseID: string, options?: RequestOptions): APIPromise<Testcase>;
|
|
26
26
|
}
|
|
27
27
|
export type TestcasesPaginatedResponse = PaginatedResponse<Testcase>;
|
|
28
28
|
/**
|
|
29
29
|
* A test case in the Scorecard system. Contains JSON data that is validated
|
|
30
|
-
* against the schema defined by its
|
|
31
|
-
* derived from the `data` field based on the
|
|
30
|
+
* against the schema defined by its Testset. The `inputs` and `labels` fields are
|
|
31
|
+
* derived from the `data` field based on the Testset's `fieldMapping`, and include
|
|
32
32
|
* all mapped fields, including those with validation errors. Testcases are stored
|
|
33
33
|
* regardless of validation results, with any validation errors included in the
|
|
34
34
|
* `validationErrors` field.
|
|
35
35
|
*/
|
|
36
36
|
export interface Testcase {
|
|
37
37
|
/**
|
|
38
|
-
* The ID of the
|
|
38
|
+
* The ID of the Testcase.
|
|
39
39
|
*/
|
|
40
40
|
id: string;
|
|
41
41
|
/**
|
|
42
|
-
* Derived from data based on the
|
|
42
|
+
* Derived from data based on the Testset's fieldMapping. Contains all fields
|
|
43
43
|
* marked as inputs, including those with validation errors.
|
|
44
44
|
*/
|
|
45
45
|
inputs: Record<string, unknown>;
|
|
46
46
|
/**
|
|
47
|
-
* The JSON data of the
|
|
47
|
+
* The JSON data of the Testcase, which is validated against the Testset's schema.
|
|
48
48
|
*/
|
|
49
49
|
jsonData: Record<string, unknown>;
|
|
50
50
|
/**
|
|
51
|
-
* Derived from data based on the
|
|
51
|
+
* Derived from data based on the Testset's fieldMapping. Contains all fields
|
|
52
52
|
* marked as labels, including those with validation errors.
|
|
53
53
|
*/
|
|
54
54
|
labels: Record<string, unknown>;
|
|
55
55
|
/**
|
|
56
|
-
* The ID of the
|
|
56
|
+
* The ID of the Testset this Testcase belongs to.
|
|
57
57
|
*/
|
|
58
58
|
testsetId: string;
|
|
59
59
|
/**
|
|
60
|
-
* Validation errors found in the
|
|
61
|
-
* fully conform to its
|
|
60
|
+
* Validation errors found in the Testcase data. If present, the Testcase doesn't
|
|
61
|
+
* fully conform to its Testset's schema.
|
|
62
62
|
*/
|
|
63
63
|
validationErrors?: Array<Testcase.ValidationError>;
|
|
64
64
|
}
|
|
65
65
|
export declare namespace Testcase {
|
|
66
66
|
interface ValidationError {
|
|
67
67
|
/**
|
|
68
|
-
* Human-readable error description
|
|
68
|
+
* Human-readable error description.
|
|
69
69
|
*/
|
|
70
70
|
message: string;
|
|
71
71
|
/**
|
|
72
|
-
* JSON Pointer to the field with the validation error
|
|
72
|
+
* JSON Pointer to the field with the validation error.
|
|
73
73
|
*/
|
|
74
74
|
path: string;
|
|
75
75
|
}
|
|
@@ -79,35 +79,35 @@ export interface TestcaseCreateResponse {
|
|
|
79
79
|
}
|
|
80
80
|
export interface TestcaseDeleteResponse {
|
|
81
81
|
/**
|
|
82
|
-
* Whether the deletion was successful
|
|
82
|
+
* Whether the deletion was successful.
|
|
83
83
|
*/
|
|
84
84
|
success: boolean;
|
|
85
85
|
}
|
|
86
86
|
export interface TestcaseCreateParams {
|
|
87
87
|
/**
|
|
88
|
-
* Testcases to create (max 100)
|
|
88
|
+
* Testcases to create (max 100).
|
|
89
89
|
*/
|
|
90
90
|
items: Array<TestcaseCreateParams.Item>;
|
|
91
91
|
}
|
|
92
92
|
export declare namespace TestcaseCreateParams {
|
|
93
93
|
/**
|
|
94
94
|
* A test case in the Scorecard system. Contains JSON data that is validated
|
|
95
|
-
* against the schema defined by its
|
|
96
|
-
* derived from the `data` field based on the
|
|
95
|
+
* against the schema defined by its Testset. The `inputs` and `labels` fields are
|
|
96
|
+
* derived from the `data` field based on the Testset's `fieldMapping`, and include
|
|
97
97
|
* all mapped fields, including those with validation errors. Testcases are stored
|
|
98
98
|
* regardless of validation results, with any validation errors included in the
|
|
99
99
|
* `validationErrors` field.
|
|
100
100
|
*/
|
|
101
101
|
interface Item {
|
|
102
102
|
/**
|
|
103
|
-
* The JSON data of the
|
|
103
|
+
* The JSON data of the Testcase, which is validated against the Testset's schema.
|
|
104
104
|
*/
|
|
105
105
|
jsonData: Record<string, unknown>;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
export interface TestcaseUpdateParams {
|
|
109
109
|
/**
|
|
110
|
-
* The JSON data of the
|
|
110
|
+
* The JSON data of the Testcase, which is validated against the Testset's schema.
|
|
111
111
|
*/
|
|
112
112
|
jsonData: Record<string, unknown>;
|
|
113
113
|
}
|
|
@@ -115,7 +115,7 @@ export interface TestcaseListParams extends PaginatedResponseParams {
|
|
|
115
115
|
}
|
|
116
116
|
export interface TestcaseDeleteParams {
|
|
117
117
|
/**
|
|
118
|
-
* IDs of
|
|
118
|
+
* IDs of Testcases to delete.
|
|
119
119
|
*/
|
|
120
120
|
ids: Array<string>;
|
|
121
121
|
}
|
package/resources/testcases.d.ts
CHANGED
|
@@ -4,72 +4,72 @@ import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "..
|
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
5
5
|
export declare class Testcases extends APIResource {
|
|
6
6
|
/**
|
|
7
|
-
* Create multiple
|
|
7
|
+
* Create multiple Testcases in the specified Testset.
|
|
8
8
|
*/
|
|
9
9
|
create(testsetID: string, body: TestcaseCreateParams, options?: RequestOptions): APIPromise<TestcaseCreateResponse>;
|
|
10
10
|
/**
|
|
11
|
-
* Replace the data of an existing
|
|
11
|
+
* Replace the data of an existing Testcase while keeping its ID.
|
|
12
12
|
*/
|
|
13
13
|
update(testcaseID: string, body: TestcaseUpdateParams, options?: RequestOptions): APIPromise<Testcase>;
|
|
14
14
|
/**
|
|
15
|
-
* Retrieve a paginated list of
|
|
15
|
+
* Retrieve a paginated list of Testcases belonging to a Testset.
|
|
16
16
|
*/
|
|
17
17
|
list(testsetID: string, query?: TestcaseListParams | null | undefined, options?: RequestOptions): PagePromise<TestcasesPaginatedResponse, Testcase>;
|
|
18
18
|
/**
|
|
19
|
-
* Delete multiple
|
|
19
|
+
* Delete multiple Testcases by their IDs.
|
|
20
20
|
*/
|
|
21
21
|
delete(body: TestcaseDeleteParams, options?: RequestOptions): APIPromise<TestcaseDeleteResponse>;
|
|
22
22
|
/**
|
|
23
|
-
* Retrieve a specific
|
|
23
|
+
* Retrieve a specific Testcase by ID.
|
|
24
24
|
*/
|
|
25
25
|
get(testcaseID: string, options?: RequestOptions): APIPromise<Testcase>;
|
|
26
26
|
}
|
|
27
27
|
export type TestcasesPaginatedResponse = PaginatedResponse<Testcase>;
|
|
28
28
|
/**
|
|
29
29
|
* A test case in the Scorecard system. Contains JSON data that is validated
|
|
30
|
-
* against the schema defined by its
|
|
31
|
-
* derived from the `data` field based on the
|
|
30
|
+
* against the schema defined by its Testset. The `inputs` and `labels` fields are
|
|
31
|
+
* derived from the `data` field based on the Testset's `fieldMapping`, and include
|
|
32
32
|
* all mapped fields, including those with validation errors. Testcases are stored
|
|
33
33
|
* regardless of validation results, with any validation errors included in the
|
|
34
34
|
* `validationErrors` field.
|
|
35
35
|
*/
|
|
36
36
|
export interface Testcase {
|
|
37
37
|
/**
|
|
38
|
-
* The ID of the
|
|
38
|
+
* The ID of the Testcase.
|
|
39
39
|
*/
|
|
40
40
|
id: string;
|
|
41
41
|
/**
|
|
42
|
-
* Derived from data based on the
|
|
42
|
+
* Derived from data based on the Testset's fieldMapping. Contains all fields
|
|
43
43
|
* marked as inputs, including those with validation errors.
|
|
44
44
|
*/
|
|
45
45
|
inputs: Record<string, unknown>;
|
|
46
46
|
/**
|
|
47
|
-
* The JSON data of the
|
|
47
|
+
* The JSON data of the Testcase, which is validated against the Testset's schema.
|
|
48
48
|
*/
|
|
49
49
|
jsonData: Record<string, unknown>;
|
|
50
50
|
/**
|
|
51
|
-
* Derived from data based on the
|
|
51
|
+
* Derived from data based on the Testset's fieldMapping. Contains all fields
|
|
52
52
|
* marked as labels, including those with validation errors.
|
|
53
53
|
*/
|
|
54
54
|
labels: Record<string, unknown>;
|
|
55
55
|
/**
|
|
56
|
-
* The ID of the
|
|
56
|
+
* The ID of the Testset this Testcase belongs to.
|
|
57
57
|
*/
|
|
58
58
|
testsetId: string;
|
|
59
59
|
/**
|
|
60
|
-
* Validation errors found in the
|
|
61
|
-
* fully conform to its
|
|
60
|
+
* Validation errors found in the Testcase data. If present, the Testcase doesn't
|
|
61
|
+
* fully conform to its Testset's schema.
|
|
62
62
|
*/
|
|
63
63
|
validationErrors?: Array<Testcase.ValidationError>;
|
|
64
64
|
}
|
|
65
65
|
export declare namespace Testcase {
|
|
66
66
|
interface ValidationError {
|
|
67
67
|
/**
|
|
68
|
-
* Human-readable error description
|
|
68
|
+
* Human-readable error description.
|
|
69
69
|
*/
|
|
70
70
|
message: string;
|
|
71
71
|
/**
|
|
72
|
-
* JSON Pointer to the field with the validation error
|
|
72
|
+
* JSON Pointer to the field with the validation error.
|
|
73
73
|
*/
|
|
74
74
|
path: string;
|
|
75
75
|
}
|
|
@@ -79,35 +79,35 @@ export interface TestcaseCreateResponse {
|
|
|
79
79
|
}
|
|
80
80
|
export interface TestcaseDeleteResponse {
|
|
81
81
|
/**
|
|
82
|
-
* Whether the deletion was successful
|
|
82
|
+
* Whether the deletion was successful.
|
|
83
83
|
*/
|
|
84
84
|
success: boolean;
|
|
85
85
|
}
|
|
86
86
|
export interface TestcaseCreateParams {
|
|
87
87
|
/**
|
|
88
|
-
* Testcases to create (max 100)
|
|
88
|
+
* Testcases to create (max 100).
|
|
89
89
|
*/
|
|
90
90
|
items: Array<TestcaseCreateParams.Item>;
|
|
91
91
|
}
|
|
92
92
|
export declare namespace TestcaseCreateParams {
|
|
93
93
|
/**
|
|
94
94
|
* A test case in the Scorecard system. Contains JSON data that is validated
|
|
95
|
-
* against the schema defined by its
|
|
96
|
-
* derived from the `data` field based on the
|
|
95
|
+
* against the schema defined by its Testset. The `inputs` and `labels` fields are
|
|
96
|
+
* derived from the `data` field based on the Testset's `fieldMapping`, and include
|
|
97
97
|
* all mapped fields, including those with validation errors. Testcases are stored
|
|
98
98
|
* regardless of validation results, with any validation errors included in the
|
|
99
99
|
* `validationErrors` field.
|
|
100
100
|
*/
|
|
101
101
|
interface Item {
|
|
102
102
|
/**
|
|
103
|
-
* The JSON data of the
|
|
103
|
+
* The JSON data of the Testcase, which is validated against the Testset's schema.
|
|
104
104
|
*/
|
|
105
105
|
jsonData: Record<string, unknown>;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
export interface TestcaseUpdateParams {
|
|
109
109
|
/**
|
|
110
|
-
* The JSON data of the
|
|
110
|
+
* The JSON data of the Testcase, which is validated against the Testset's schema.
|
|
111
111
|
*/
|
|
112
112
|
jsonData: Record<string, unknown>;
|
|
113
113
|
}
|
|
@@ -115,7 +115,7 @@ export interface TestcaseListParams extends PaginatedResponseParams {
|
|
|
115
115
|
}
|
|
116
116
|
export interface TestcaseDeleteParams {
|
|
117
117
|
/**
|
|
118
|
-
* IDs of
|
|
118
|
+
* IDs of Testcases to delete.
|
|
119
119
|
*/
|
|
120
120
|
ids: Array<string>;
|
|
121
121
|
}
|
package/resources/testcases.js
CHANGED
|
@@ -7,19 +7,19 @@ const pagination_1 = require("../core/pagination.js");
|
|
|
7
7
|
const path_1 = require("../internal/utils/path.js");
|
|
8
8
|
class Testcases extends resource_1.APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Create multiple
|
|
10
|
+
* Create multiple Testcases in the specified Testset.
|
|
11
11
|
*/
|
|
12
12
|
create(testsetID, body, options) {
|
|
13
13
|
return this._client.post((0, path_1.path) `/testsets/${testsetID}/testcases`, { body, ...options });
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Replace the data of an existing
|
|
16
|
+
* Replace the data of an existing Testcase while keeping its ID.
|
|
17
17
|
*/
|
|
18
18
|
update(testcaseID, body, options) {
|
|
19
19
|
return this._client.put((0, path_1.path) `/testcases/${testcaseID}`, { body, ...options });
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Retrieve a paginated list of
|
|
22
|
+
* Retrieve a paginated list of Testcases belonging to a Testset.
|
|
23
23
|
*/
|
|
24
24
|
list(testsetID, query = {}, options) {
|
|
25
25
|
return this._client.getAPIList((0, path_1.path) `/testsets/${testsetID}/testcases`, (pagination_1.PaginatedResponse), {
|
|
@@ -28,13 +28,13 @@ class Testcases extends resource_1.APIResource {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* Delete multiple
|
|
31
|
+
* Delete multiple Testcases by their IDs.
|
|
32
32
|
*/
|
|
33
33
|
delete(body, options) {
|
|
34
34
|
return this._client.post('/testcases/bulk-delete', { body, ...options });
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* Retrieve a specific
|
|
37
|
+
* Retrieve a specific Testcase by ID.
|
|
38
38
|
*/
|
|
39
39
|
get(testcaseID, options) {
|
|
40
40
|
return this._client.get((0, path_1.path) `/testcases/${testcaseID}`, options);
|
package/resources/testcases.mjs
CHANGED
|
@@ -4,19 +4,19 @@ import { PaginatedResponse } from "../core/pagination.mjs";
|
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
5
|
export class Testcases extends APIResource {
|
|
6
6
|
/**
|
|
7
|
-
* Create multiple
|
|
7
|
+
* Create multiple Testcases in the specified Testset.
|
|
8
8
|
*/
|
|
9
9
|
create(testsetID, body, options) {
|
|
10
10
|
return this._client.post(path `/testsets/${testsetID}/testcases`, { body, ...options });
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Replace the data of an existing
|
|
13
|
+
* Replace the data of an existing Testcase while keeping its ID.
|
|
14
14
|
*/
|
|
15
15
|
update(testcaseID, body, options) {
|
|
16
16
|
return this._client.put(path `/testcases/${testcaseID}`, { body, ...options });
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Retrieve a paginated list of
|
|
19
|
+
* Retrieve a paginated list of Testcases belonging to a Testset.
|
|
20
20
|
*/
|
|
21
21
|
list(testsetID, query = {}, options) {
|
|
22
22
|
return this._client.getAPIList(path `/testsets/${testsetID}/testcases`, (PaginatedResponse), {
|
|
@@ -25,13 +25,13 @@ export class Testcases extends APIResource {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Delete multiple
|
|
28
|
+
* Delete multiple Testcases by their IDs.
|
|
29
29
|
*/
|
|
30
30
|
delete(body, options) {
|
|
31
31
|
return this._client.post('/testcases/bulk-delete', { body, ...options });
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Retrieve a specific
|
|
34
|
+
* Retrieve a specific Testcase by ID.
|
|
35
35
|
*/
|
|
36
36
|
get(testcaseID, options) {
|
|
37
37
|
return this._client.get(path `/testcases/${testcaseID}`, options);
|
package/resources/testsets.d.mts
CHANGED
|
@@ -4,12 +4,12 @@ import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "..
|
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
5
|
export declare class Testsets extends APIResource {
|
|
6
6
|
/**
|
|
7
|
-
* Create a new
|
|
7
|
+
* Create a new Testset for a Project. The Testset will be created in the Project
|
|
8
8
|
* specified in the path.
|
|
9
9
|
*/
|
|
10
10
|
create(projectID: string, body: TestsetCreateParams, options?: RequestOptions): APIPromise<Testset>;
|
|
11
11
|
/**
|
|
12
|
-
* Update a
|
|
12
|
+
* Update a Testset. Only the fields provided in the request body will be updated.
|
|
13
13
|
* If a field is provided, the new content will replace the existing content. If a
|
|
14
14
|
* field is not provided, the existing content will remain unchanged.
|
|
15
15
|
*
|
|
@@ -24,167 +24,168 @@ export declare class Testsets extends APIResource {
|
|
|
24
24
|
*/
|
|
25
25
|
update(testsetID: string, body?: TestsetUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Testset>;
|
|
26
26
|
/**
|
|
27
|
-
* Retrieve a paginated list of
|
|
27
|
+
* Retrieve a paginated list of Testsets belonging to a Project.
|
|
28
28
|
*/
|
|
29
29
|
list(projectID: string, query?: TestsetListParams | null | undefined, options?: RequestOptions): PagePromise<TestsetsPaginatedResponse, Testset>;
|
|
30
30
|
/**
|
|
31
|
-
* Delete
|
|
31
|
+
* Delete Testset
|
|
32
32
|
*/
|
|
33
33
|
delete(testsetID: string, options?: RequestOptions): APIPromise<TestsetDeleteResponse>;
|
|
34
34
|
/**
|
|
35
|
-
* Get
|
|
35
|
+
* Get Testset by ID
|
|
36
36
|
*/
|
|
37
37
|
get(testsetID: string, options?: RequestOptions): APIPromise<Testset>;
|
|
38
38
|
}
|
|
39
39
|
export type TestsetsPaginatedResponse = PaginatedResponse<Testset>;
|
|
40
40
|
/**
|
|
41
|
-
* A collection of
|
|
42
|
-
* structure of its
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* A collection of Testcases that share the same schema. Each Testset defines the
|
|
42
|
+
* structure of its Testcases through a JSON schema. The `fieldMapping` object maps
|
|
43
|
+
* top-level keys of the Testcase schema to their roles (input/label). Fields not
|
|
44
|
+
* mentioned in the `fieldMapping` during creation or update are treated as
|
|
45
45
|
* metadata.
|
|
46
46
|
*
|
|
47
47
|
* ## JSON Schema validation constraints supported:
|
|
48
48
|
*
|
|
49
49
|
* - **Required fields** - Fields listed in the schema's `required` array must be
|
|
50
|
-
* present in
|
|
50
|
+
* present in Testcases.
|
|
51
51
|
* - **Type validation** - Values must match the specified type (string, number,
|
|
52
|
-
* boolean, null, integer, object, array)
|
|
52
|
+
* boolean, null, integer, object, array).
|
|
53
53
|
* - **Enum validation** - Values must be one of the options specified in the
|
|
54
|
-
* `enum` array
|
|
54
|
+
* `enum` array.
|
|
55
55
|
* - **Object property validation** - Properties of objects must conform to their
|
|
56
|
-
* defined schemas
|
|
57
|
-
* - **Array item validation** - Items in arrays must conform to the `items`
|
|
56
|
+
* defined schemas.
|
|
57
|
+
* - **Array item validation** - Items in arrays must conform to the `items`
|
|
58
|
+
* schema.
|
|
58
59
|
* - **Logical composition** - Values must conform to at least one schema in the
|
|
59
|
-
* `anyOf` array
|
|
60
|
+
* `anyOf` array.
|
|
60
61
|
*
|
|
61
62
|
* Testcases that fail validation will still be stored, but will include
|
|
62
|
-
* `validationErrors` detailing the issues. Extra fields in the
|
|
63
|
+
* `validationErrors` detailing the issues. Extra fields in the Testcase data that
|
|
63
64
|
* are not in the schema will be stored but are ignored during validation.
|
|
64
65
|
*/
|
|
65
66
|
export interface Testset {
|
|
66
67
|
/**
|
|
67
|
-
* The ID of the
|
|
68
|
+
* The ID of the Testset.
|
|
68
69
|
*/
|
|
69
70
|
id: string;
|
|
70
71
|
/**
|
|
71
|
-
* The description of the
|
|
72
|
+
* The description of the Testset.
|
|
72
73
|
*/
|
|
73
74
|
description: string;
|
|
74
75
|
/**
|
|
75
|
-
* Maps top-level keys of the
|
|
76
|
+
* Maps top-level keys of the Testcase schema to their roles (input/label).
|
|
76
77
|
* Unmapped fields are treated as metadata.
|
|
77
78
|
*/
|
|
78
79
|
fieldMapping: Testset.FieldMapping;
|
|
79
80
|
/**
|
|
80
|
-
* The JSON schema for each
|
|
81
|
+
* The JSON schema for each Testcase in the Testset.
|
|
81
82
|
*/
|
|
82
83
|
jsonSchema: Record<string, unknown>;
|
|
83
84
|
/**
|
|
84
|
-
* The name of the
|
|
85
|
+
* The name of the Testset.
|
|
85
86
|
*/
|
|
86
87
|
name: string;
|
|
87
88
|
}
|
|
88
89
|
export declare namespace Testset {
|
|
89
90
|
/**
|
|
90
|
-
* Maps top-level keys of the
|
|
91
|
+
* Maps top-level keys of the Testcase schema to their roles (input/label).
|
|
91
92
|
* Unmapped fields are treated as metadata.
|
|
92
93
|
*/
|
|
93
94
|
interface FieldMapping {
|
|
94
95
|
/**
|
|
95
|
-
* Fields that represent inputs to the AI system
|
|
96
|
+
* Fields that represent inputs to the AI system.
|
|
96
97
|
*/
|
|
97
98
|
inputs: Array<string>;
|
|
98
99
|
/**
|
|
99
|
-
* Fields that represent expected outputs/labels
|
|
100
|
+
* Fields that represent expected outputs/labels.
|
|
100
101
|
*/
|
|
101
102
|
labels: Array<string>;
|
|
102
103
|
/**
|
|
103
|
-
* Fields that are not inputs or labels
|
|
104
|
+
* Fields that are not inputs or labels.
|
|
104
105
|
*/
|
|
105
106
|
metadata: Array<string>;
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
export interface TestsetDeleteResponse {
|
|
109
110
|
/**
|
|
110
|
-
* Whether the deletion was successful
|
|
111
|
+
* Whether the deletion was successful.
|
|
111
112
|
*/
|
|
112
113
|
success: boolean;
|
|
113
114
|
}
|
|
114
115
|
export interface TestsetCreateParams {
|
|
115
116
|
/**
|
|
116
|
-
* The description of the
|
|
117
|
+
* The description of the Testset.
|
|
117
118
|
*/
|
|
118
119
|
description: string;
|
|
119
120
|
/**
|
|
120
|
-
* Maps top-level keys of the
|
|
121
|
+
* Maps top-level keys of the Testcase schema to their roles (input/label).
|
|
121
122
|
* Unmapped fields are treated as metadata.
|
|
122
123
|
*/
|
|
123
124
|
fieldMapping: TestsetCreateParams.FieldMapping;
|
|
124
125
|
/**
|
|
125
|
-
* The JSON schema for each
|
|
126
|
+
* The JSON schema for each Testcase in the Testset.
|
|
126
127
|
*/
|
|
127
128
|
jsonSchema: Record<string, unknown>;
|
|
128
129
|
/**
|
|
129
|
-
* The name of the
|
|
130
|
+
* The name of the Testset.
|
|
130
131
|
*/
|
|
131
132
|
name: string;
|
|
132
133
|
}
|
|
133
134
|
export declare namespace TestsetCreateParams {
|
|
134
135
|
/**
|
|
135
|
-
* Maps top-level keys of the
|
|
136
|
+
* Maps top-level keys of the Testcase schema to their roles (input/label).
|
|
136
137
|
* Unmapped fields are treated as metadata.
|
|
137
138
|
*/
|
|
138
139
|
interface FieldMapping {
|
|
139
140
|
/**
|
|
140
|
-
* Fields that represent inputs to the AI system
|
|
141
|
+
* Fields that represent inputs to the AI system.
|
|
141
142
|
*/
|
|
142
143
|
inputs: Array<string>;
|
|
143
144
|
/**
|
|
144
|
-
* Fields that represent expected outputs/labels
|
|
145
|
+
* Fields that represent expected outputs/labels.
|
|
145
146
|
*/
|
|
146
147
|
labels: Array<string>;
|
|
147
148
|
/**
|
|
148
|
-
* Fields that are not inputs or labels
|
|
149
|
+
* Fields that are not inputs or labels.
|
|
149
150
|
*/
|
|
150
151
|
metadata: Array<string>;
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
export interface TestsetUpdateParams {
|
|
154
155
|
/**
|
|
155
|
-
* The description of the
|
|
156
|
+
* The description of the Testset.
|
|
156
157
|
*/
|
|
157
158
|
description?: string;
|
|
158
159
|
/**
|
|
159
|
-
* Maps top-level keys of the
|
|
160
|
+
* Maps top-level keys of the Testcase schema to their roles (input/label).
|
|
160
161
|
* Unmapped fields are treated as metadata.
|
|
161
162
|
*/
|
|
162
163
|
fieldMapping?: TestsetUpdateParams.FieldMapping;
|
|
163
164
|
/**
|
|
164
|
-
* The JSON schema for each
|
|
165
|
+
* The JSON schema for each Testcase in the Testset.
|
|
165
166
|
*/
|
|
166
167
|
jsonSchema?: Record<string, unknown>;
|
|
167
168
|
/**
|
|
168
|
-
* The name of the
|
|
169
|
+
* The name of the Testset.
|
|
169
170
|
*/
|
|
170
171
|
name?: string;
|
|
171
172
|
}
|
|
172
173
|
export declare namespace TestsetUpdateParams {
|
|
173
174
|
/**
|
|
174
|
-
* Maps top-level keys of the
|
|
175
|
+
* Maps top-level keys of the Testcase schema to their roles (input/label).
|
|
175
176
|
* Unmapped fields are treated as metadata.
|
|
176
177
|
*/
|
|
177
178
|
interface FieldMapping {
|
|
178
179
|
/**
|
|
179
|
-
* Fields that represent inputs to the AI system
|
|
180
|
+
* Fields that represent inputs to the AI system.
|
|
180
181
|
*/
|
|
181
182
|
inputs: Array<string>;
|
|
182
183
|
/**
|
|
183
|
-
* Fields that represent expected outputs/labels
|
|
184
|
+
* Fields that represent expected outputs/labels.
|
|
184
185
|
*/
|
|
185
186
|
labels: Array<string>;
|
|
186
187
|
/**
|
|
187
|
-
* Fields that are not inputs or labels
|
|
188
|
+
* Fields that are not inputs or labels.
|
|
188
189
|
*/
|
|
189
190
|
metadata: Array<string>;
|
|
190
191
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testsets.d.mts","sourceRoot":"","sources":["../src/resources/testsets.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBA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