scorecard-ai 1.0.0-alpha.9 → 1.1.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 +37 -0
- package/README.md +48 -19
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js +7 -5
- package/client.js.map +1 -1
- package/client.mjs +7 -5
- package/client.mjs.map +1 -1
- package/internal/tslib.js +6 -6
- package/lib/runAndEvaluate.d.mts +20 -8
- package/lib/runAndEvaluate.d.mts.map +1 -1
- package/lib/runAndEvaluate.d.ts +20 -8
- package/lib/runAndEvaluate.d.ts.map +1 -1
- package/lib/runAndEvaluate.js +31 -21
- package/lib/runAndEvaluate.js.map +1 -1
- package/lib/runAndEvaluate.mjs +31 -21
- package/lib/runAndEvaluate.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/metrics.d.mts +611 -0
- package/resources/metrics.d.mts.map +1 -0
- package/resources/metrics.d.ts +611 -0
- package/resources/metrics.d.ts.map +1 -0
- package/resources/metrics.js +52 -0
- package/resources/metrics.js.map +1 -0
- package/resources/metrics.mjs +48 -0
- package/resources/metrics.mjs.map +1 -0
- package/resources/runs.d.mts +5 -5
- package/resources/runs.d.mts.map +1 -1
- package/resources/runs.d.ts +5 -5
- package/resources/runs.d.ts.map +1 -1
- package/resources/runs.js +1 -1
- package/resources/runs.mjs +1 -1
- package/resources/systems/index.d.mts +3 -0
- package/resources/systems/index.d.mts.map +1 -0
- package/resources/systems/index.d.ts +3 -0
- package/resources/systems/index.d.ts.map +1 -0
- package/resources/systems/index.js +9 -0
- package/resources/systems/index.js.map +1 -0
- package/resources/systems/index.mjs +4 -0
- package/resources/systems/index.mjs.map +1 -0
- package/resources/systems/systems.d.mts +229 -0
- package/resources/systems/systems.d.mts.map +1 -0
- package/resources/systems/systems.d.ts +229 -0
- package/resources/systems/systems.d.ts.map +1 -0
- package/resources/systems/systems.js +151 -0
- package/resources/systems/systems.js.map +1 -0
- package/resources/systems/systems.mjs +146 -0
- package/resources/systems/systems.mjs.map +1 -0
- package/resources/systems/versions.d.mts +132 -0
- package/resources/systems/versions.d.mts.map +1 -0
- package/resources/systems/versions.d.ts +132 -0
- package/resources/systems/versions.d.ts.map +1 -0
- package/resources/{system-configs.js → systems/versions.js} +26 -25
- package/resources/systems/versions.js.map +1 -0
- package/resources/{system-configs.mjs → systems/versions.mjs} +24 -23
- package/resources/systems/versions.mjs.map +1 -0
- package/resources/systems.d.mts +1 -224
- package/resources/systems.d.mts.map +1 -1
- package/resources/systems.d.ts +1 -224
- package/resources/systems.d.ts.map +1 -1
- package/resources/systems.js +2 -139
- package/resources/systems.js.map +1 -1
- package/resources/systems.mjs +1 -137
- package/resources/systems.mjs.map +1 -1
- package/resources/testsets.d.mts +1 -1
- package/resources/testsets.d.ts +1 -1
- package/resources/testsets.js +1 -1
- package/resources/testsets.mjs +1 -1
- package/src/client.ts +22 -27
- package/src/lib/runAndEvaluate.ts +52 -27
- package/src/resources/index.ts +2 -8
- package/src/resources/metrics.ts +768 -0
- package/src/resources/runs.ts +5 -5
- package/src/resources/systems/index.ts +18 -0
- package/src/resources/systems/systems.ts +299 -0
- package/src/resources/systems/versions.ts +166 -0
- package/src/resources/systems.ts +1 -277
- package/src/resources/testsets.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/system-configs.d.mts +0 -148
- package/resources/system-configs.d.mts.map +0 -1
- package/resources/system-configs.d.ts +0 -148
- package/resources/system-configs.d.ts.map +0 -1
- package/resources/system-configs.js.map +0 -1
- package/resources/system-configs.mjs.map +0 -1
- package/src/resources/system-configs.ts +0 -189
|
@@ -1,189 +0,0 @@
|
|
|
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
|
-
* @example
|
|
28
|
-
* ```ts
|
|
29
|
-
* const systemConfig = await client.systemConfigs.create(
|
|
30
|
-
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
31
|
-
* {
|
|
32
|
-
* config: {
|
|
33
|
-
* temperature: 0.1,
|
|
34
|
-
* maxTokens: 1024,
|
|
35
|
-
* model: 'gpt-4-turbo',
|
|
36
|
-
* },
|
|
37
|
-
* name: 'Production (Low Temperature)',
|
|
38
|
-
* },
|
|
39
|
-
* );
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
create(
|
|
43
|
-
systemID: string,
|
|
44
|
-
body: SystemConfigCreateParams,
|
|
45
|
-
options?: RequestOptions,
|
|
46
|
-
): APIPromise<SystemConfig> {
|
|
47
|
-
return this._client.post(path`/systems/${systemID}/configs`, { body, ...options });
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Retrieve a paginated list of configurations for a specific system.
|
|
52
|
-
*
|
|
53
|
-
* System configurations provide concrete parameter values for a System Under Test,
|
|
54
|
-
* defining exactly how the system should be configured during an evaluation run.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```ts
|
|
58
|
-
* // Automatically fetches more pages as needed.
|
|
59
|
-
* for await (const systemConfig of client.systemConfigs.list(
|
|
60
|
-
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
61
|
-
* )) {
|
|
62
|
-
* // ...
|
|
63
|
-
* }
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
list(
|
|
67
|
-
systemID: string,
|
|
68
|
-
query: SystemConfigListParams | null | undefined = {},
|
|
69
|
-
options?: RequestOptions,
|
|
70
|
-
): PagePromise<SystemConfigsPaginatedResponse, SystemConfig> {
|
|
71
|
-
return this._client.getAPIList(path`/systems/${systemID}/configs`, PaginatedResponse<SystemConfig>, {
|
|
72
|
-
query,
|
|
73
|
-
...options,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Retrieve a specific system configuration by ID.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```ts
|
|
82
|
-
* const systemConfig = await client.systemConfigs.get(
|
|
83
|
-
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
84
|
-
* );
|
|
85
|
-
* ```
|
|
86
|
-
*/
|
|
87
|
-
get(systemConfigID: string, options?: RequestOptions): APIPromise<SystemConfig> {
|
|
88
|
-
return this._client.get(path`/systems/configs/${systemConfigID}`, options);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export type SystemConfigsPaginatedResponse = PaginatedResponse<SystemConfig>;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* A SystemConfig defines the specific settings for a System Under Test.
|
|
96
|
-
*
|
|
97
|
-
* Configurations contain parameter values that determine system behavior during
|
|
98
|
-
* evaluation. They are immutable snapshots - once created, they never change.
|
|
99
|
-
*
|
|
100
|
-
* When running evaluations, you reference a specific configId to establish which
|
|
101
|
-
* configuration to test.
|
|
102
|
-
*
|
|
103
|
-
* Configurations will be validated against the system's configSchema, with
|
|
104
|
-
* non-conforming values generating warnings.
|
|
105
|
-
*/
|
|
106
|
-
export interface SystemConfig {
|
|
107
|
-
/**
|
|
108
|
-
* The ID of the system configuration.
|
|
109
|
-
*/
|
|
110
|
-
id: string;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* The configuration of the system.
|
|
114
|
-
*/
|
|
115
|
-
config: Record<string, unknown>;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* The name of the system configuration.
|
|
119
|
-
*/
|
|
120
|
-
name: string;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* The ID of the system the configuration belongs to.
|
|
124
|
-
*/
|
|
125
|
-
systemId: string;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Validation errors found in the configuration. If present, the configuration
|
|
129
|
-
* doesn't fully conform to its system's configSchema.
|
|
130
|
-
*/
|
|
131
|
-
validationErrors?: Array<SystemConfig.ValidationError>;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export namespace SystemConfig {
|
|
135
|
-
export interface ValidationError {
|
|
136
|
-
/**
|
|
137
|
-
* Human-readable error description.
|
|
138
|
-
*/
|
|
139
|
-
message: string;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* JSON Pointer to the field with the validation error.
|
|
143
|
-
*/
|
|
144
|
-
path: string;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface SystemConfigCreateParams {
|
|
149
|
-
/**
|
|
150
|
-
* The configuration of the system.
|
|
151
|
-
*/
|
|
152
|
-
config: Record<string, unknown>;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* The name of the system configuration.
|
|
156
|
-
*/
|
|
157
|
-
name: string;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Validation errors found in the configuration. If present, the configuration
|
|
161
|
-
* doesn't fully conform to its system's configSchema.
|
|
162
|
-
*/
|
|
163
|
-
validationErrors?: Array<SystemConfigCreateParams.ValidationError>;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export namespace SystemConfigCreateParams {
|
|
167
|
-
export interface ValidationError {
|
|
168
|
-
/**
|
|
169
|
-
* Human-readable error description.
|
|
170
|
-
*/
|
|
171
|
-
message: string;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* JSON Pointer to the field with the validation error.
|
|
175
|
-
*/
|
|
176
|
-
path: string;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export interface SystemConfigListParams extends PaginatedResponseParams {}
|
|
181
|
-
|
|
182
|
-
export declare namespace SystemConfigs {
|
|
183
|
-
export {
|
|
184
|
-
type SystemConfig as SystemConfig,
|
|
185
|
-
type SystemConfigsPaginatedResponse as SystemConfigsPaginatedResponse,
|
|
186
|
-
type SystemConfigCreateParams as SystemConfigCreateParams,
|
|
187
|
-
type SystemConfigListParams as SystemConfigListParams,
|
|
188
|
-
};
|
|
189
|
-
}
|