scorecard-ai 1.1.0 → 2.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.
- package/CHANGELOG.md +50 -0
- package/README.md +4 -5
- package/client.d.mts +13 -13
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -13
- package/client.d.ts.map +1 -1
- package/client.js +27 -25
- package/client.js.map +1 -1
- package/client.mjs +16 -14
- package/client.mjs.map +1 -1
- package/core/resource.d.mts +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +4 -4
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +4 -4
- package/internal/headers.mjs.map +1 -1
- package/internal/request-options.d.mts +1 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +1 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/uploads.js +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.js +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.d.mts +2 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +2 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +4 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +2 -0
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +1 -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/systems/index.d.mts +2 -2
- package/resources/systems/index.d.mts.map +1 -1
- package/resources/systems/index.d.ts +2 -2
- package/resources/systems/index.d.ts.map +1 -1
- package/resources/systems/index.js.map +1 -1
- package/resources/systems/index.mjs +1 -1
- package/resources/systems/index.mjs.map +1 -1
- package/resources/systems/systems.d.mts +63 -125
- package/resources/systems/systems.d.mts.map +1 -1
- package/resources/systems/systems.d.ts +63 -125
- package/resources/systems/systems.d.ts.map +1 -1
- package/resources/systems/systems.js +21 -74
- package/resources/systems/systems.js.map +1 -1
- package/resources/systems/systems.mjs +22 -75
- package/resources/systems/systems.mjs.map +1 -1
- package/resources/systems/versions.d.mts +23 -74
- package/resources/systems/versions.d.mts.map +1 -1
- package/resources/systems/versions.d.ts +23 -74
- package/resources/systems/versions.d.ts.map +1 -1
- package/resources/systems/versions.js +20 -54
- package/resources/systems/versions.js.map +1 -1
- package/resources/systems/versions.mjs +20 -54
- package/resources/systems/versions.mjs.map +1 -1
- package/src/client.ts +39 -27
- package/src/core/resource.ts +1 -1
- package/src/internal/headers.ts +5 -5
- package/src/internal/request-options.ts +1 -0
- package/src/internal/uploads.ts +1 -1
- package/src/internal/utils/log.ts +1 -1
- package/src/internal/utils/path.ts +1 -1
- package/src/internal/utils/values.ts +3 -0
- package/src/resources/index.ts +1 -1
- package/src/resources/systems/index.ts +2 -8
- package/src/resources/systems/systems.ts +68 -141
- package/src/resources/systems/versions.ts +25 -95
- 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
|
@@ -2,92 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
|
-
import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from '../../core/pagination';
|
|
6
5
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
6
|
import { path } from '../../internal/utils/path';
|
|
8
7
|
|
|
9
8
|
export class Versions extends APIResource {
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Each version contains specific parameter values that match the system's
|
|
14
|
-
* `configSchema` - things like model parameters, thresholds, or processing
|
|
15
|
-
* options. Once created, versions cannot be modified, ensuring stable reference
|
|
16
|
-
* points for evaluations.
|
|
17
|
-
*
|
|
18
|
-
* When creating a system version:
|
|
19
|
-
*
|
|
20
|
-
* - The `config` object is validated against the parent system's `configSchema`.
|
|
21
|
-
* - System versions 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
|
|
26
|
-
* calculated.
|
|
10
|
+
* Retrieve a specific system version by ID.
|
|
27
11
|
*
|
|
28
12
|
* @example
|
|
29
13
|
* ```ts
|
|
30
|
-
* const systemVersion = await client.systems.versions.
|
|
31
|
-
* '
|
|
32
|
-
* {
|
|
33
|
-
* config: {
|
|
34
|
-
* temperature: 0.1,
|
|
35
|
-
* maxTokens: 1024,
|
|
36
|
-
* model: 'gpt-4-turbo',
|
|
37
|
-
* },
|
|
38
|
-
* name: 'Production (Low Temperature)',
|
|
39
|
-
* },
|
|
14
|
+
* const systemVersion = await client.systems.versions.get(
|
|
15
|
+
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
40
16
|
* );
|
|
41
17
|
* ```
|
|
42
18
|
*/
|
|
43
|
-
|
|
44
|
-
return this._client.
|
|
19
|
+
get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion> {
|
|
20
|
+
return this._client.get(path`/systems/versions/${systemVersionID}`, options);
|
|
45
21
|
}
|
|
46
22
|
|
|
47
23
|
/**
|
|
48
|
-
*
|
|
24
|
+
* Create a new system version if it does not already exist. Does **not** set the
|
|
25
|
+
* created version to be the system's production version.
|
|
49
26
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
27
|
+
* If there is already a system version with the same config, its name will be
|
|
28
|
+
* updated.
|
|
52
29
|
*
|
|
53
30
|
* @example
|
|
54
31
|
* ```ts
|
|
55
|
-
*
|
|
56
|
-
* for await (const systemVersion of client.systems.versions.list(
|
|
32
|
+
* const systemVersion = await client.systems.versions.upsert(
|
|
57
33
|
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
options?: RequestOptions,
|
|
67
|
-
): PagePromise<SystemVersionsPaginatedResponse, SystemVersion> {
|
|
68
|
-
return this._client.getAPIList(path`/systems/${systemID}/configs`, PaginatedResponse<SystemVersion>, {
|
|
69
|
-
query,
|
|
70
|
-
...options,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Retrieve a specific system version by ID.
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```ts
|
|
79
|
-
* const systemVersion = await client.systems.versions.get(
|
|
80
|
-
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
34
|
+
* {
|
|
35
|
+
* config: {
|
|
36
|
+
* temperature: 0.5,
|
|
37
|
+
* maxTokens: 1024,
|
|
38
|
+
* model: 'gemini-2.0-flash',
|
|
39
|
+
* },
|
|
40
|
+
* name: 'Test model: Gemini',
|
|
41
|
+
* },
|
|
81
42
|
* );
|
|
82
43
|
* ```
|
|
83
44
|
*/
|
|
84
|
-
|
|
85
|
-
return this._client.
|
|
45
|
+
upsert(systemID: string, body: VersionUpsertParams, options?: RequestOptions): APIPromise<SystemVersion> {
|
|
46
|
+
return this._client.post(path`/systems/${systemID}/versions`, { body, ...options });
|
|
86
47
|
}
|
|
87
48
|
}
|
|
88
49
|
|
|
89
|
-
export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
|
|
90
|
-
|
|
91
50
|
/**
|
|
92
51
|
* A SystemVersion defines the specific settings for a System Under Test.
|
|
93
52
|
*
|
|
@@ -96,9 +55,6 @@ export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
|
|
|
96
55
|
*
|
|
97
56
|
* When running evaluations, you reference a specific systemVersionId to establish
|
|
98
57
|
* which system version to test.
|
|
99
|
-
*
|
|
100
|
-
* System versions will be validated against the system's configSchema, with
|
|
101
|
-
* non-conforming values generating warnings.
|
|
102
58
|
*/
|
|
103
59
|
export interface SystemVersion {
|
|
104
60
|
/**
|
|
@@ -120,47 +76,21 @@ export interface SystemVersion {
|
|
|
120
76
|
* The ID of the system the system version belongs to.
|
|
121
77
|
*/
|
|
122
78
|
systemId: string;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Validation errors found in the system version. If present, the system version
|
|
126
|
-
* doesn't fully conform to its system's configSchema.
|
|
127
|
-
*/
|
|
128
|
-
validationErrors?: Array<SystemVersion.ValidationError>;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export namespace SystemVersion {
|
|
132
|
-
export interface ValidationError {
|
|
133
|
-
/**
|
|
134
|
-
* Human-readable error description.
|
|
135
|
-
*/
|
|
136
|
-
message: string;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* JSON Pointer to the field with the validation error.
|
|
140
|
-
*/
|
|
141
|
-
path: string;
|
|
142
|
-
}
|
|
143
79
|
}
|
|
144
80
|
|
|
145
|
-
export interface
|
|
81
|
+
export interface VersionUpsertParams {
|
|
146
82
|
/**
|
|
147
83
|
* The configuration of the system version.
|
|
148
84
|
*/
|
|
149
85
|
config: Record<string, unknown>;
|
|
150
86
|
|
|
151
87
|
/**
|
|
152
|
-
* The name of the system version.
|
|
88
|
+
* The name of the system version. If creating a new system version and the name
|
|
89
|
+
* isn't provided, it will be autogenerated.
|
|
153
90
|
*/
|
|
154
|
-
name
|
|
91
|
+
name?: string;
|
|
155
92
|
}
|
|
156
93
|
|
|
157
|
-
export interface VersionListParams extends PaginatedResponseParams {}
|
|
158
|
-
|
|
159
94
|
export declare namespace Versions {
|
|
160
|
-
export {
|
|
161
|
-
type SystemVersion as SystemVersion,
|
|
162
|
-
type SystemVersionsPaginatedResponse as SystemVersionsPaginatedResponse,
|
|
163
|
-
type VersionCreateParams as VersionCreateParams,
|
|
164
|
-
type VersionListParams as VersionListParams,
|
|
165
|
-
};
|
|
95
|
+
export { type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams };
|
|
166
96
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '
|
|
1
|
+
export const VERSION = '2.0.0-alpha.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "2.0.0-alpha.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "2.0.0-alpha.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
|
package/version.js
CHANGED
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '
|
|
1
|
+
export const VERSION = '2.0.0-alpha.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
|