scorecard-ai 1.0.0-alpha.0 → 1.0.0-alpha.2
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 +54 -0
- package/README.md +2 -2
- package/client.d.mts +13 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -1
- package/client.d.ts.map +1 -1
- package/client.js +15 -3
- package/client.js.map +1 -1
- package/client.mjs +15 -3
- package/client.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 +8 -4
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +8 -4
- package/internal/utils/base64.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/execution-records.d.mts +62 -0
- package/resources/execution-records.d.mts.map +1 -0
- package/resources/execution-records.d.ts +62 -0
- package/resources/execution-records.d.ts.map +1 -0
- package/resources/execution-records.js +16 -0
- package/resources/execution-records.js.map +1 -0
- package/resources/execution-records.mjs +12 -0
- package/resources/execution-records.mjs.map +1 -0
- package/resources/index.d.mts +4 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/runs.d.mts +72 -0
- package/resources/runs.d.mts.map +1 -0
- package/resources/runs.d.ts +72 -0
- package/resources/runs.d.ts.map +1 -0
- package/resources/runs.js +22 -0
- package/resources/runs.js.map +1 -0
- package/resources/runs.mjs +18 -0
- package/resources/runs.mjs.map +1 -0
- package/resources/system-configs.d.mts +122 -0
- package/resources/system-configs.d.mts.map +1 -0
- package/resources/system-configs.d.ts +122 -0
- package/resources/system-configs.d.ts.map +1 -0
- package/resources/system-configs.js +50 -0
- package/resources/system-configs.js.map +1 -0
- package/resources/system-configs.mjs +46 -0
- package/resources/system-configs.mjs.map +1 -0
- package/resources/systems.d.mts +152 -0
- package/resources/systems.d.mts.map +1 -0
- package/resources/systems.d.ts +152 -0
- package/resources/systems.d.ts.map +1 -0
- package/resources/systems.js +70 -0
- package/resources/systems.js.map +1 -0
- package/resources/systems.mjs +66 -0
- package/resources/systems.mjs.map +1 -0
- package/resources/testcases.d.mts +11 -27
- package/resources/testcases.d.mts.map +1 -1
- package/resources/testcases.d.ts +11 -27
- package/resources/testcases.d.ts.map +1 -1
- package/resources/testcases.js +3 -3
- package/resources/testcases.js.map +1 -1
- package/resources/testcases.mjs +3 -3
- package/resources/testcases.mjs.map +1 -1
- package/resources/testsets.d.mts +12 -9
- package/resources/testsets.d.mts.map +1 -1
- package/resources/testsets.d.ts +12 -9
- package/resources/testsets.d.ts.map +1 -1
- package/src/client.ts +67 -3
- package/src/internal/utils/base64.ts +8 -6
- package/src/resources/execution-records.ts +85 -0
- package/src/resources/index.ts +23 -0
- package/src/resources/runs.ts +118 -0
- package/src/resources/system-configs.ts +170 -0
- package/src/resources/systems.ts +206 -0
- package/src/resources/testcases.ts +13 -36
- package/src/resources/testsets.ts +13 -10
- 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
|
@@ -0,0 +1,85 @@
|
|
|
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 ExecutionRecords extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new execution record.
|
|
11
|
+
*/
|
|
12
|
+
create(
|
|
13
|
+
runID: string,
|
|
14
|
+
body: ExecutionRecordCreateParams,
|
|
15
|
+
options?: RequestOptions,
|
|
16
|
+
): APIPromise<ExecutionRecord> {
|
|
17
|
+
return this._client.post(path`/runs/${runID}/executionrecords`, { body, ...options });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* An execution record in the Scorecard system.
|
|
23
|
+
*/
|
|
24
|
+
export interface ExecutionRecord {
|
|
25
|
+
/**
|
|
26
|
+
* The ID of the execution record
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The actual inputs sent to the system, which should match the system's input
|
|
32
|
+
* schema
|
|
33
|
+
*/
|
|
34
|
+
inputs: Record<string, unknown>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The expected outputs for the testcase
|
|
38
|
+
*/
|
|
39
|
+
labels: Record<string, unknown>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The actual outputs from the system
|
|
43
|
+
*/
|
|
44
|
+
outputs: Record<string, unknown>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The ID of the run containing this execution record
|
|
48
|
+
*/
|
|
49
|
+
runId: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The ID of the testcase
|
|
53
|
+
*/
|
|
54
|
+
testcaseId?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ExecutionRecordCreateParams {
|
|
58
|
+
/**
|
|
59
|
+
* The actual inputs sent to the system, which should match the system's input
|
|
60
|
+
* schema
|
|
61
|
+
*/
|
|
62
|
+
inputs: Record<string, unknown>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The expected outputs for the testcase
|
|
66
|
+
*/
|
|
67
|
+
labels: Record<string, unknown>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The actual outputs from the system
|
|
71
|
+
*/
|
|
72
|
+
outputs: Record<string, unknown>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The ID of the testcase
|
|
76
|
+
*/
|
|
77
|
+
testcaseId?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare namespace ExecutionRecords {
|
|
81
|
+
export {
|
|
82
|
+
type ExecutionRecord as ExecutionRecord,
|
|
83
|
+
type ExecutionRecordCreateParams as ExecutionRecordCreateParams,
|
|
84
|
+
};
|
|
85
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export * from './shared';
|
|
4
|
+
export {
|
|
5
|
+
ExecutionRecords,
|
|
6
|
+
type ExecutionRecord,
|
|
7
|
+
type ExecutionRecordCreateParams,
|
|
8
|
+
} from './execution-records';
|
|
4
9
|
export {
|
|
5
10
|
Projects,
|
|
6
11
|
type ProjectListResponse,
|
|
7
12
|
type ProjectListParams,
|
|
8
13
|
type ProjectListResponsesPaginatedResponse,
|
|
9
14
|
} from './projects';
|
|
15
|
+
export { Runs, type Run, type RunUpdateResponse, type RunCreateParams, type RunUpdateParams } from './runs';
|
|
16
|
+
export {
|
|
17
|
+
SystemConfigs,
|
|
18
|
+
type SystemConfig,
|
|
19
|
+
type SystemConfigCreateParams,
|
|
20
|
+
type SystemConfigListParams,
|
|
21
|
+
type SystemConfigGetParams,
|
|
22
|
+
type SystemConfigsPaginatedResponse,
|
|
23
|
+
} from './system-configs';
|
|
24
|
+
export {
|
|
25
|
+
Systems,
|
|
26
|
+
type System,
|
|
27
|
+
type SystemDeleteResponse,
|
|
28
|
+
type SystemCreateParams,
|
|
29
|
+
type SystemUpdateParams,
|
|
30
|
+
type SystemListParams,
|
|
31
|
+
type SystemsPaginatedResponse,
|
|
32
|
+
} from './systems';
|
|
10
33
|
export {
|
|
11
34
|
Testcases,
|
|
12
35
|
type Testcase,
|
|
@@ -0,0 +1,118 @@
|
|
|
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 Runs extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new run.
|
|
11
|
+
*/
|
|
12
|
+
create(projectID: string, body: RunCreateParams, options?: RequestOptions): APIPromise<Run> {
|
|
13
|
+
return this._client.post(path`/projects/${projectID}/runs`, { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Update the status of a run.
|
|
18
|
+
*/
|
|
19
|
+
update(runID: string, body: RunUpdateParams, options?: RequestOptions): APIPromise<RunUpdateResponse> {
|
|
20
|
+
return this._client.patch(path`/runs/${runID}`, { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A Run in the Scorecard system.
|
|
26
|
+
*/
|
|
27
|
+
export interface Run {
|
|
28
|
+
/**
|
|
29
|
+
* The ID of the Run
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The IDs of the metrics this Run is using
|
|
35
|
+
*/
|
|
36
|
+
metricIds: Array<string>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The status of the Run
|
|
40
|
+
*/
|
|
41
|
+
status:
|
|
42
|
+
| 'pending'
|
|
43
|
+
| 'awaiting_execution'
|
|
44
|
+
| 'running_execution'
|
|
45
|
+
| 'awaiting_scoring'
|
|
46
|
+
| 'running_scoring'
|
|
47
|
+
| 'awaiting_human_scoring'
|
|
48
|
+
| 'completed';
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The ID of the Testset this Run is testing
|
|
52
|
+
*/
|
|
53
|
+
testsetId: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The ID of the system configuration this Run is using
|
|
57
|
+
*/
|
|
58
|
+
systemConfigId?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface RunUpdateResponse {
|
|
62
|
+
/**
|
|
63
|
+
* The ID of the Run
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The status of the Run
|
|
69
|
+
*/
|
|
70
|
+
status:
|
|
71
|
+
| 'pending'
|
|
72
|
+
| 'awaiting_execution'
|
|
73
|
+
| 'running_execution'
|
|
74
|
+
| 'awaiting_scoring'
|
|
75
|
+
| 'running_scoring'
|
|
76
|
+
| 'awaiting_human_scoring'
|
|
77
|
+
| 'completed';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface RunCreateParams {
|
|
81
|
+
/**
|
|
82
|
+
* The IDs of the metrics this Run is using
|
|
83
|
+
*/
|
|
84
|
+
metricIds: Array<string>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The ID of the Testset this Run is testing
|
|
88
|
+
*/
|
|
89
|
+
testsetId: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The ID of the system configuration this Run is using
|
|
93
|
+
*/
|
|
94
|
+
systemConfigId?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface RunUpdateParams {
|
|
98
|
+
/**
|
|
99
|
+
* The status of the Run
|
|
100
|
+
*/
|
|
101
|
+
status:
|
|
102
|
+
| 'pending'
|
|
103
|
+
| 'awaiting_execution'
|
|
104
|
+
| 'running_execution'
|
|
105
|
+
| 'awaiting_scoring'
|
|
106
|
+
| 'running_scoring'
|
|
107
|
+
| 'awaiting_human_scoring'
|
|
108
|
+
| 'completed';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare namespace Runs {
|
|
112
|
+
export {
|
|
113
|
+
type Run as Run,
|
|
114
|
+
type RunUpdateResponse as RunUpdateResponse,
|
|
115
|
+
type RunCreateParams as RunCreateParams,
|
|
116
|
+
type RunUpdateParams as RunUpdateParams,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
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 { PagePromise, PaginatedResponse, type PaginatedResponseParams } from '../core/pagination';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class SystemConfigs extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new configuration for a system.
|
|
12
|
+
*
|
|
13
|
+
* Each configuration contains specific parameter values that match the system's
|
|
14
|
+
* configSchema - things like model parameters, thresholds, or processing options.
|
|
15
|
+
* Once created, configurations cannot be modified, ensuring stable reference
|
|
16
|
+
* points for evaluations.
|
|
17
|
+
*
|
|
18
|
+
* When creating a configuration:
|
|
19
|
+
*
|
|
20
|
+
* - The 'config' object is validated against the parent system's configSchema
|
|
21
|
+
* - Configurations with validation errors are still stored, with errors included
|
|
22
|
+
* in the response
|
|
23
|
+
* - Validation errors indicate fields that don't match the schema but don't
|
|
24
|
+
* prevent creation
|
|
25
|
+
* - Having validation errors may affect how some evaluation metrics are calculated
|
|
26
|
+
*/
|
|
27
|
+
create(
|
|
28
|
+
systemID: string,
|
|
29
|
+
body: SystemConfigCreateParams,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): APIPromise<SystemConfig> {
|
|
32
|
+
return this._client.post(path`/systems/${systemID}/configs`, { body, ...options });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve a paginated list of configurations for a specific system.
|
|
37
|
+
*
|
|
38
|
+
* System configurations provide concrete parameter values for a System Under Test,
|
|
39
|
+
* defining exactly how the system should be configured during an evaluation run.
|
|
40
|
+
*/
|
|
41
|
+
list(
|
|
42
|
+
systemID: string,
|
|
43
|
+
query: SystemConfigListParams | null | undefined = {},
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): PagePromise<SystemConfigsPaginatedResponse, SystemConfig> {
|
|
46
|
+
return this._client.getAPIList(path`/systems/${systemID}/configs`, PaginatedResponse<SystemConfig>, {
|
|
47
|
+
query,
|
|
48
|
+
...options,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Retrieve a specific system configuration by ID.
|
|
54
|
+
*/
|
|
55
|
+
get(
|
|
56
|
+
systemConfigID: string,
|
|
57
|
+
params: SystemConfigGetParams,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): APIPromise<SystemConfig> {
|
|
60
|
+
const { systemId } = params;
|
|
61
|
+
return this._client.get(path`/systems/${systemId}/configs/${systemConfigID}`, options);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type SystemConfigsPaginatedResponse = PaginatedResponse<SystemConfig>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A SystemConfig defines the specific settings for a System Under Test.
|
|
69
|
+
*
|
|
70
|
+
* Configurations contain parameter values that determine system behavior during
|
|
71
|
+
* evaluation. They are immutable snapshots - once created, they never change.
|
|
72
|
+
*
|
|
73
|
+
* When running evaluations, you reference a specific configId to establish which
|
|
74
|
+
* configuration to test.
|
|
75
|
+
*
|
|
76
|
+
* Configurations will be validated against the system's configSchema, with
|
|
77
|
+
* non-conforming values generating warnings.
|
|
78
|
+
*/
|
|
79
|
+
export interface SystemConfig {
|
|
80
|
+
/**
|
|
81
|
+
* The ID of the system configuration
|
|
82
|
+
*/
|
|
83
|
+
id: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The configuration of the system
|
|
87
|
+
*/
|
|
88
|
+
config: Record<string, unknown>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The name of the system configuration
|
|
92
|
+
*/
|
|
93
|
+
name: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The ID of the system the configuration belongs to
|
|
97
|
+
*/
|
|
98
|
+
systemId: string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Validation errors found in the configuration. If present, the configuration
|
|
102
|
+
* doesn't fully conform to its system's configSchema.
|
|
103
|
+
*/
|
|
104
|
+
validationErrors?: Array<SystemConfig.ValidationError>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export namespace SystemConfig {
|
|
108
|
+
export interface ValidationError {
|
|
109
|
+
/**
|
|
110
|
+
* Human-readable error description
|
|
111
|
+
*/
|
|
112
|
+
message: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* JSON Pointer to the field with the validation error
|
|
116
|
+
*/
|
|
117
|
+
path: string;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface SystemConfigCreateParams {
|
|
122
|
+
/**
|
|
123
|
+
* The configuration of the system
|
|
124
|
+
*/
|
|
125
|
+
config: Record<string, unknown>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The name of the system configuration
|
|
129
|
+
*/
|
|
130
|
+
name: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Validation errors found in the configuration. If present, the configuration
|
|
134
|
+
* doesn't fully conform to its system's configSchema.
|
|
135
|
+
*/
|
|
136
|
+
validationErrors?: Array<SystemConfigCreateParams.ValidationError>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export namespace SystemConfigCreateParams {
|
|
140
|
+
export interface ValidationError {
|
|
141
|
+
/**
|
|
142
|
+
* Human-readable error description
|
|
143
|
+
*/
|
|
144
|
+
message: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* JSON Pointer to the field with the validation error
|
|
148
|
+
*/
|
|
149
|
+
path: string;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface SystemConfigListParams extends PaginatedResponseParams {}
|
|
154
|
+
|
|
155
|
+
export interface SystemConfigGetParams {
|
|
156
|
+
/**
|
|
157
|
+
* The ID of the system the configuration belongs to
|
|
158
|
+
*/
|
|
159
|
+
systemId: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare namespace SystemConfigs {
|
|
163
|
+
export {
|
|
164
|
+
type SystemConfig as SystemConfig,
|
|
165
|
+
type SystemConfigsPaginatedResponse as SystemConfigsPaginatedResponse,
|
|
166
|
+
type SystemConfigCreateParams as SystemConfigCreateParams,
|
|
167
|
+
type SystemConfigListParams as SystemConfigListParams,
|
|
168
|
+
type SystemConfigGetParams as SystemConfigGetParams,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
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 { PagePromise, PaginatedResponse, type PaginatedResponseParams } from '../core/pagination';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Systems extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new system definition that specifies the interface contracts for a
|
|
12
|
+
* component you want to evaluate.
|
|
13
|
+
*
|
|
14
|
+
* A system acts as a template that defines three key contracts through JSON
|
|
15
|
+
* Schemas:
|
|
16
|
+
*
|
|
17
|
+
* 1. Input Schema: What data your system accepts (e.g., user queries, context
|
|
18
|
+
* documents)
|
|
19
|
+
* 2. Output Schema: What data your system produces (e.g., responses, confidence
|
|
20
|
+
* scores)
|
|
21
|
+
* 3. Config Schema: What parameters can be adjusted (e.g., model selection,
|
|
22
|
+
* temperature)
|
|
23
|
+
*
|
|
24
|
+
* This separation lets you evaluate any system as a black box, focusing on its
|
|
25
|
+
* interface rather than implementation details.
|
|
26
|
+
*/
|
|
27
|
+
create(projectID: string, body: SystemCreateParams, options?: RequestOptions): APIPromise<System> {
|
|
28
|
+
return this._client.post(path`/projects/${projectID}/systems`, { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Update an existing system definition. Only the fields provided in the request
|
|
33
|
+
* body will be updated. If a field is provided, the new content will replace the
|
|
34
|
+
* existing content. If a field is not provided, the existing content will remain
|
|
35
|
+
* unchanged.
|
|
36
|
+
*
|
|
37
|
+
* When updating schemas:
|
|
38
|
+
*
|
|
39
|
+
* - The system will accept your changes regardless of compatibility with existing
|
|
40
|
+
* configurations
|
|
41
|
+
* - Schema updates won't invalidate existing evaluations or configurations
|
|
42
|
+
* - For significant redesigns, creating a new system definition provides a cleaner
|
|
43
|
+
* separation
|
|
44
|
+
*/
|
|
45
|
+
update(
|
|
46
|
+
systemID: string,
|
|
47
|
+
body: SystemUpdateParams | null | undefined = {},
|
|
48
|
+
options?: RequestOptions,
|
|
49
|
+
): APIPromise<System> {
|
|
50
|
+
return this._client.patch(path`/systems/${systemID}`, { body, ...options });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Retrieve a paginated list of all systems. Systems are ordered by creation date.
|
|
55
|
+
*/
|
|
56
|
+
list(
|
|
57
|
+
projectID: string,
|
|
58
|
+
query: SystemListParams | null | undefined = {},
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): PagePromise<SystemsPaginatedResponse, System> {
|
|
61
|
+
return this._client.getAPIList(path`/projects/${projectID}/systems`, PaginatedResponse<System>, {
|
|
62
|
+
query,
|
|
63
|
+
...options,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Delete a system definition by ID. This will not delete associated system
|
|
69
|
+
* configurations.
|
|
70
|
+
*/
|
|
71
|
+
delete(systemID: string, options?: RequestOptions): APIPromise<SystemDeleteResponse> {
|
|
72
|
+
return this._client.delete(path`/systems/${systemID}`, options);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Retrieve a specific system by ID.
|
|
77
|
+
*/
|
|
78
|
+
get(systemID: string, options?: RequestOptions): APIPromise<System> {
|
|
79
|
+
return this._client.get(path`/systems/${systemID}`, options);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type SystemsPaginatedResponse = PaginatedResponse<System>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A System Under Test (SUT) defines the interface to a component or service you
|
|
87
|
+
* want to evaluate.
|
|
88
|
+
*
|
|
89
|
+
* It specifies three contracts through schemas:
|
|
90
|
+
*
|
|
91
|
+
* - inputSchema: The structure of data the system accepts
|
|
92
|
+
* - outputSchema: The structure of data the system produces
|
|
93
|
+
* - configSchema: The parameters that modify system behavior
|
|
94
|
+
*
|
|
95
|
+
* This abstraction lets you evaluate any system as a black box, focusing on its
|
|
96
|
+
* interface rather than implementation details. It's particularly useful for
|
|
97
|
+
* systems with variable outputs or complex internal state.
|
|
98
|
+
*
|
|
99
|
+
* Systems are templates - to run evaluations, pair them with a SystemConfig that
|
|
100
|
+
* provides specific parameter values.
|
|
101
|
+
*/
|
|
102
|
+
export interface System {
|
|
103
|
+
/**
|
|
104
|
+
* The ID of the system
|
|
105
|
+
*/
|
|
106
|
+
id: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The schema of the system's configuration
|
|
110
|
+
*/
|
|
111
|
+
configSchema: Record<string, unknown>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The description of the system
|
|
115
|
+
*/
|
|
116
|
+
description: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The schema of the system's inputs
|
|
120
|
+
*/
|
|
121
|
+
inputSchema: Record<string, unknown>;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The name of the system
|
|
125
|
+
*/
|
|
126
|
+
name: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The schema of the system's outputs
|
|
130
|
+
*/
|
|
131
|
+
outputSchema: Record<string, unknown>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface SystemDeleteResponse {
|
|
135
|
+
/**
|
|
136
|
+
* Whether the deletion was successful
|
|
137
|
+
*/
|
|
138
|
+
success: boolean;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface SystemCreateParams {
|
|
142
|
+
/**
|
|
143
|
+
* The schema of the system's configuration
|
|
144
|
+
*/
|
|
145
|
+
configSchema: Record<string, unknown>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The description of the system
|
|
149
|
+
*/
|
|
150
|
+
description: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The schema of the system's inputs
|
|
154
|
+
*/
|
|
155
|
+
inputSchema: Record<string, unknown>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The name of the system
|
|
159
|
+
*/
|
|
160
|
+
name: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The schema of the system's outputs
|
|
164
|
+
*/
|
|
165
|
+
outputSchema: Record<string, unknown>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface SystemUpdateParams {
|
|
169
|
+
/**
|
|
170
|
+
* The schema of the system's configuration
|
|
171
|
+
*/
|
|
172
|
+
configSchema?: Record<string, unknown>;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The description of the system
|
|
176
|
+
*/
|
|
177
|
+
description?: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The schema of the system's inputs
|
|
181
|
+
*/
|
|
182
|
+
inputSchema?: Record<string, unknown>;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The name of the system
|
|
186
|
+
*/
|
|
187
|
+
name?: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The schema of the system's outputs
|
|
191
|
+
*/
|
|
192
|
+
outputSchema?: Record<string, unknown>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface SystemListParams extends PaginatedResponseParams {}
|
|
196
|
+
|
|
197
|
+
export declare namespace Systems {
|
|
198
|
+
export {
|
|
199
|
+
type System as System,
|
|
200
|
+
type SystemDeleteResponse as SystemDeleteResponse,
|
|
201
|
+
type SystemsPaginatedResponse as SystemsPaginatedResponse,
|
|
202
|
+
type SystemCreateParams as SystemCreateParams,
|
|
203
|
+
type SystemUpdateParams as SystemUpdateParams,
|
|
204
|
+
type SystemListParams as SystemListParams,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
@@ -40,14 +40,10 @@ export class Testcases extends APIResource {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Delete multiple testcases
|
|
43
|
+
* Delete multiple testcases by their IDs.
|
|
44
44
|
*/
|
|
45
|
-
delete(
|
|
46
|
-
|
|
47
|
-
body: TestcaseDeleteParams,
|
|
48
|
-
options?: RequestOptions,
|
|
49
|
-
): APIPromise<TestcaseDeleteResponse> {
|
|
50
|
-
return this._client.delete(path`/testsets/${testsetID}/testcases`, { body, ...options });
|
|
45
|
+
delete(body: TestcaseDeleteParams, options?: RequestOptions): APIPromise<TestcaseDeleteResponse> {
|
|
46
|
+
return this._client.post('/testcases/bulk-delete', { body, ...options });
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
/**
|
|
@@ -74,17 +70,17 @@ export interface Testcase {
|
|
|
74
70
|
*/
|
|
75
71
|
id: string;
|
|
76
72
|
|
|
77
|
-
/**
|
|
78
|
-
* The JSON data of the testcase, which is validated against the testset's schema.
|
|
79
|
-
*/
|
|
80
|
-
data: Record<string, unknown>;
|
|
81
|
-
|
|
82
73
|
/**
|
|
83
74
|
* Derived from data based on the testset's fieldMapping. Contains all fields
|
|
84
75
|
* marked as inputs, including those with validation errors.
|
|
85
76
|
*/
|
|
86
77
|
inputs: Record<string, unknown>;
|
|
87
78
|
|
|
79
|
+
/**
|
|
80
|
+
* The JSON data of the testcase, which is validated against the testset's schema.
|
|
81
|
+
*/
|
|
82
|
+
jsonData: Record<string, unknown>;
|
|
83
|
+
|
|
88
84
|
/**
|
|
89
85
|
* Derived from data based on the testset's fieldMapping. Contains all fields
|
|
90
86
|
* marked as labels, including those with validation errors.
|
|
@@ -123,28 +119,9 @@ export interface TestcaseCreateResponse {
|
|
|
123
119
|
|
|
124
120
|
export interface TestcaseDeleteResponse {
|
|
125
121
|
/**
|
|
126
|
-
*
|
|
127
|
-
*/
|
|
128
|
-
deletedCount: number;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* List of errors encountered during deletion, if any
|
|
122
|
+
* Whether the deletion was successful
|
|
132
123
|
*/
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export namespace TestcaseDeleteResponse {
|
|
137
|
-
export interface Error {
|
|
138
|
-
/**
|
|
139
|
-
* ID of the testcase that failed to be deleted
|
|
140
|
-
*/
|
|
141
|
-
id: string;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Error message explaining why the deletion failed
|
|
145
|
-
*/
|
|
146
|
-
message: string;
|
|
147
|
-
}
|
|
124
|
+
success: boolean;
|
|
148
125
|
}
|
|
149
126
|
|
|
150
127
|
export interface TestcaseCreateParams {
|
|
@@ -167,7 +144,7 @@ export namespace TestcaseCreateParams {
|
|
|
167
144
|
/**
|
|
168
145
|
* The JSON data of the testcase, which is validated against the testset's schema.
|
|
169
146
|
*/
|
|
170
|
-
|
|
147
|
+
jsonData: Record<string, unknown>;
|
|
171
148
|
}
|
|
172
149
|
}
|
|
173
150
|
|
|
@@ -175,14 +152,14 @@ export interface TestcaseUpdateParams {
|
|
|
175
152
|
/**
|
|
176
153
|
* The JSON data of the testcase, which is validated against the testset's schema.
|
|
177
154
|
*/
|
|
178
|
-
|
|
155
|
+
jsonData: Record<string, unknown>;
|
|
179
156
|
}
|
|
180
157
|
|
|
181
158
|
export interface TestcaseListParams extends PaginatedResponseParams {}
|
|
182
159
|
|
|
183
160
|
export interface TestcaseDeleteParams {
|
|
184
161
|
/**
|
|
185
|
-
* IDs of testcases to delete
|
|
162
|
+
* IDs of testcases to delete
|
|
186
163
|
*/
|
|
187
164
|
ids: Array<string>;
|
|
188
165
|
}
|