scorecard-ai 1.0.0-alpha.0 → 1.0.0-alpha.1

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 (83) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +13 -1
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +13 -1
  6. package/client.d.ts.map +1 -1
  7. package/client.js +15 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +15 -3
  10. package/client.mjs.map +1 -1
  11. package/internal/utils/base64.d.mts.map +1 -1
  12. package/internal/utils/base64.d.ts.map +1 -1
  13. package/internal/utils/base64.js +8 -4
  14. package/internal/utils/base64.js.map +1 -1
  15. package/internal/utils/base64.mjs +8 -4
  16. package/internal/utils/base64.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/execution-records.d.mts +62 -0
  19. package/resources/execution-records.d.mts.map +1 -0
  20. package/resources/execution-records.d.ts +62 -0
  21. package/resources/execution-records.d.ts.map +1 -0
  22. package/resources/execution-records.js +16 -0
  23. package/resources/execution-records.js.map +1 -0
  24. package/resources/execution-records.mjs +12 -0
  25. package/resources/execution-records.mjs.map +1 -0
  26. package/resources/index.d.mts +4 -0
  27. package/resources/index.d.mts.map +1 -1
  28. package/resources/index.d.ts +4 -0
  29. package/resources/index.d.ts.map +1 -1
  30. package/resources/index.js +9 -1
  31. package/resources/index.js.map +1 -1
  32. package/resources/index.mjs +4 -0
  33. package/resources/index.mjs.map +1 -1
  34. package/resources/runs.d.mts +48 -0
  35. package/resources/runs.d.mts.map +1 -0
  36. package/resources/runs.d.ts +48 -0
  37. package/resources/runs.d.ts.map +1 -0
  38. package/resources/runs.js +16 -0
  39. package/resources/runs.js.map +1 -0
  40. package/resources/runs.mjs +12 -0
  41. package/resources/runs.mjs.map +1 -0
  42. package/resources/system-configs.d.mts +122 -0
  43. package/resources/system-configs.d.mts.map +1 -0
  44. package/resources/system-configs.d.ts +122 -0
  45. package/resources/system-configs.d.ts.map +1 -0
  46. package/resources/system-configs.js +50 -0
  47. package/resources/system-configs.js.map +1 -0
  48. package/resources/system-configs.mjs +46 -0
  49. package/resources/system-configs.mjs.map +1 -0
  50. package/resources/systems.d.mts +152 -0
  51. package/resources/systems.d.mts.map +1 -0
  52. package/resources/systems.d.ts +152 -0
  53. package/resources/systems.d.ts.map +1 -0
  54. package/resources/systems.js +70 -0
  55. package/resources/systems.js.map +1 -0
  56. package/resources/systems.mjs +66 -0
  57. package/resources/systems.mjs.map +1 -0
  58. package/resources/testcases.d.mts +11 -27
  59. package/resources/testcases.d.mts.map +1 -1
  60. package/resources/testcases.d.ts +11 -27
  61. package/resources/testcases.d.ts.map +1 -1
  62. package/resources/testcases.js +3 -3
  63. package/resources/testcases.js.map +1 -1
  64. package/resources/testcases.mjs +3 -3
  65. package/resources/testcases.mjs.map +1 -1
  66. package/resources/testsets.d.mts +12 -9
  67. package/resources/testsets.d.mts.map +1 -1
  68. package/resources/testsets.d.ts +12 -9
  69. package/resources/testsets.d.ts.map +1 -1
  70. package/src/client.ts +61 -3
  71. package/src/internal/utils/base64.ts +8 -6
  72. package/src/resources/execution-records.ts +85 -0
  73. package/src/resources/index.ts +23 -0
  74. package/src/resources/runs.ts +61 -0
  75. package/src/resources/system-configs.ts +170 -0
  76. package/src/resources/systems.ts +206 -0
  77. package/src/resources/testcases.ts +13 -36
  78. package/src/resources/testsets.ts +13 -10
  79. package/src/version.ts +1 -1
  80. package/version.d.mts +1 -1
  81. package/version.d.ts +1 -1
  82. package/version.js +1 -1
  83. package/version.mjs +1 -1
@@ -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 from the specified testset.
43
+ * Delete multiple testcases by their IDs.
44
44
  */
45
- delete(
46
- testsetID: string,
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
- * Number of testcases successfully deleted
127
- */
128
- deletedCount: number;
129
-
130
- /**
131
- * List of errors encountered during deletion, if any
122
+ * Whether the deletion was successful
132
123
  */
133
- errors: Array<TestcaseDeleteResponse.Error>;
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
- data: Record<string, unknown>;
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
- data: Record<string, unknown>;
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 (max 100)
162
+ * IDs of testcases to delete
186
163
  */
187
164
  ids: Array<string>;
188
165
  }
@@ -110,12 +110,15 @@ export interface Testset {
110
110
  */
111
111
  fieldMapping: Testset.FieldMapping;
112
112
 
113
+ /**
114
+ * The JSON schema for each testcase in the testset
115
+ */
116
+ jsonSchema: Record<string, unknown>;
117
+
113
118
  /**
114
119
  * The name of the testset
115
120
  */
116
121
  name: string;
117
-
118
- schema: Record<string, unknown>;
119
122
  }
120
123
 
121
124
  export namespace Testset {
@@ -161,14 +164,14 @@ export interface TestsetCreateParams {
161
164
  fieldMapping: TestsetCreateParams.FieldMapping;
162
165
 
163
166
  /**
164
- * The name of the testset
167
+ * The JSON schema for each testcase in the testset
165
168
  */
166
- name: string;
169
+ jsonSchema: Record<string, unknown>;
167
170
 
168
171
  /**
169
- * The JSON schema for each testcase in the testset
172
+ * The name of the testset
170
173
  */
171
- schema: Record<string, unknown>;
174
+ name: string;
172
175
  }
173
176
 
174
177
  export namespace TestsetCreateParams {
@@ -207,14 +210,14 @@ export interface TestsetUpdateParams {
207
210
  fieldMapping?: TestsetUpdateParams.FieldMapping;
208
211
 
209
212
  /**
210
- * The name of the testset
213
+ * The JSON schema for each testcase in the testset
211
214
  */
212
- name?: string;
215
+ jsonSchema?: Record<string, unknown>;
213
216
 
214
217
  /**
215
- * The JSON schema for each testcase in the testset
218
+ * The name of the testset
216
219
  */
217
- schema?: Record<string, unknown>;
220
+ name?: string;
218
221
  }
219
222
 
220
223
  export namespace TestsetUpdateParams {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.0.0-alpha.0'; // x-release-please-version
1
+ export const VERSION = '1.0.0-alpha.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.0-alpha.0";
1
+ export declare const VERSION = "1.0.0-alpha.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.0-alpha.0";
1
+ export declare const VERSION = "1.0.0-alpha.1";
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 = '1.0.0-alpha.0'; // x-release-please-version
4
+ exports.VERSION = '1.0.0-alpha.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.0.0-alpha.0'; // x-release-please-version
1
+ export const VERSION = '1.0.0-alpha.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map