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.
Files changed (98) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +4 -5
  3. package/client.d.mts +13 -13
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +13 -13
  6. package/client.d.ts.map +1 -1
  7. package/client.js +27 -25
  8. package/client.js.map +1 -1
  9. package/client.mjs +16 -14
  10. package/client.mjs.map +1 -1
  11. package/core/resource.d.mts +1 -1
  12. package/core/resource.d.mts.map +1 -1
  13. package/core/resource.d.ts +1 -1
  14. package/core/resource.d.ts.map +1 -1
  15. package/core/resource.js.map +1 -1
  16. package/core/resource.mjs.map +1 -1
  17. package/internal/headers.d.mts.map +1 -1
  18. package/internal/headers.d.ts.map +1 -1
  19. package/internal/headers.js +4 -4
  20. package/internal/headers.js.map +1 -1
  21. package/internal/headers.mjs +4 -4
  22. package/internal/headers.mjs.map +1 -1
  23. package/internal/request-options.d.mts +1 -0
  24. package/internal/request-options.d.mts.map +1 -1
  25. package/internal/request-options.d.ts +1 -0
  26. package/internal/request-options.d.ts.map +1 -1
  27. package/internal/request-options.js.map +1 -1
  28. package/internal/request-options.mjs.map +1 -1
  29. package/internal/uploads.js +1 -1
  30. package/internal/uploads.js.map +1 -1
  31. package/internal/uploads.mjs +1 -1
  32. package/internal/uploads.mjs.map +1 -1
  33. package/internal/utils/log.js +1 -1
  34. package/internal/utils/log.js.map +1 -1
  35. package/internal/utils/log.mjs +1 -1
  36. package/internal/utils/log.mjs.map +1 -1
  37. package/internal/utils/path.d.mts.map +1 -1
  38. package/internal/utils/path.d.ts.map +1 -1
  39. package/internal/utils/path.js.map +1 -1
  40. package/internal/utils/path.mjs +1 -1
  41. package/internal/utils/path.mjs.map +1 -1
  42. package/internal/utils/values.d.mts +2 -0
  43. package/internal/utils/values.d.mts.map +1 -1
  44. package/internal/utils/values.d.ts +2 -0
  45. package/internal/utils/values.d.ts.map +1 -1
  46. package/internal/utils/values.js +4 -1
  47. package/internal/utils/values.js.map +1 -1
  48. package/internal/utils/values.mjs +2 -0
  49. package/internal/utils/values.mjs.map +1 -1
  50. package/package.json +1 -1
  51. package/resources/index.d.mts +1 -1
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +1 -1
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/systems/index.d.mts +2 -2
  56. package/resources/systems/index.d.mts.map +1 -1
  57. package/resources/systems/index.d.ts +2 -2
  58. package/resources/systems/index.d.ts.map +1 -1
  59. package/resources/systems/index.js.map +1 -1
  60. package/resources/systems/index.mjs +1 -1
  61. package/resources/systems/index.mjs.map +1 -1
  62. package/resources/systems/systems.d.mts +63 -125
  63. package/resources/systems/systems.d.mts.map +1 -1
  64. package/resources/systems/systems.d.ts +63 -125
  65. package/resources/systems/systems.d.ts.map +1 -1
  66. package/resources/systems/systems.js +21 -74
  67. package/resources/systems/systems.js.map +1 -1
  68. package/resources/systems/systems.mjs +22 -75
  69. package/resources/systems/systems.mjs.map +1 -1
  70. package/resources/systems/versions.d.mts +23 -74
  71. package/resources/systems/versions.d.mts.map +1 -1
  72. package/resources/systems/versions.d.ts +23 -74
  73. package/resources/systems/versions.d.ts.map +1 -1
  74. package/resources/systems/versions.js +20 -54
  75. package/resources/systems/versions.js.map +1 -1
  76. package/resources/systems/versions.mjs +20 -54
  77. package/resources/systems/versions.mjs.map +1 -1
  78. package/src/client.ts +39 -27
  79. package/src/core/resource.ts +1 -1
  80. package/src/internal/headers.ts +5 -5
  81. package/src/internal/request-options.ts +1 -0
  82. package/src/internal/uploads.ts +1 -1
  83. package/src/internal/utils/log.ts +1 -1
  84. package/src/internal/utils/path.ts +1 -1
  85. package/src/internal/utils/values.ts +3 -0
  86. package/src/resources/index.ts +1 -1
  87. package/src/resources/systems/index.ts +2 -8
  88. package/src/resources/systems/systems.ts +68 -141
  89. package/src/resources/systems/versions.ts +25 -95
  90. package/src/version.ts +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.mts.map +1 -1
  93. package/version.d.ts +1 -1
  94. package/version.d.ts.map +1 -1
  95. package/version.js +1 -1
  96. package/version.js.map +1 -1
  97. package/version.mjs +1 -1
  98. 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
- * Create a new version for a system.
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.create(
31
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
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
- create(systemID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SystemVersion> {
44
- return this._client.post(path`/systems/${systemID}/configs`, { body, ...options });
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
- * Retrieve a paginated list of system versions for a specific system.
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
- * System versions provide concrete parameter values for a System Under Test,
51
- * defining exactly how the system should be configured during an evaluation run.
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
- * // Automatically fetches more pages as needed.
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
- list(
64
- systemID: string,
65
- query: VersionListParams | null | undefined = {},
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
- get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion> {
85
- return this._client.get(path`/systems/configs/${systemVersionID}`, options);
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 VersionCreateParams {
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: string;
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.1.0'; // x-release-please-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.1.0";
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,UAAU,CAAC"}
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.1.0";
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,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
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.1.0'; // x-release-please-version
4
+ exports.VERSION = '2.0.0-alpha.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
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.1.0'; // x-release-please-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,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}