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
@@ -1,72 +1,42 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
2
  import { APIPromise } from "../../core/api-promise.mjs";
3
- import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.mjs";
4
3
  import { RequestOptions } from "../../internal/request-options.mjs";
5
4
  export declare class Versions extends APIResource {
6
5
  /**
7
- * Create a new version for a system.
8
- *
9
- * Each version contains specific parameter values that match the system's
10
- * `configSchema` - things like model parameters, thresholds, or processing
11
- * options. Once created, versions cannot be modified, ensuring stable reference
12
- * points for evaluations.
13
- *
14
- * When creating a system version:
15
- *
16
- * - The `config` object is validated against the parent system's `configSchema`.
17
- * - System versions with validation errors are still stored, with errors included
18
- * in the response.
19
- * - Validation errors indicate fields that don't match the schema but don't
20
- * prevent creation.
21
- * - Having validation errors may affect how some evaluation metrics are
22
- * calculated.
6
+ * Retrieve a specific system version by ID.
23
7
  *
24
8
  * @example
25
9
  * ```ts
26
- * const systemVersion = await client.systems.versions.create(
27
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
28
- * {
29
- * config: {
30
- * temperature: 0.1,
31
- * maxTokens: 1024,
32
- * model: 'gpt-4-turbo',
33
- * },
34
- * name: 'Production (Low Temperature)',
35
- * },
10
+ * const systemVersion = await client.systems.versions.get(
11
+ * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
36
12
  * );
37
13
  * ```
38
14
  */
39
- create(systemID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SystemVersion>;
15
+ get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion>;
40
16
  /**
41
- * Retrieve a paginated list of system versions for a specific system.
17
+ * Create a new system version if it does not already exist. Does **not** set the
18
+ * created version to be the system's production version.
42
19
  *
43
- * System versions provide concrete parameter values for a System Under Test,
44
- * defining exactly how the system should be configured during an evaluation run.
20
+ * If there is already a system version with the same config, its name will be
21
+ * updated.
45
22
  *
46
23
  * @example
47
24
  * ```ts
48
- * // Automatically fetches more pages as needed.
49
- * for await (const systemVersion of client.systems.versions.list(
25
+ * const systemVersion = await client.systems.versions.upsert(
50
26
  * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
51
- * )) {
52
- * // ...
53
- * }
54
- * ```
55
- */
56
- list(systemID: string, query?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<SystemVersionsPaginatedResponse, SystemVersion>;
57
- /**
58
- * Retrieve a specific system version by ID.
59
- *
60
- * @example
61
- * ```ts
62
- * const systemVersion = await client.systems.versions.get(
63
- * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
27
+ * {
28
+ * config: {
29
+ * temperature: 0.5,
30
+ * maxTokens: 1024,
31
+ * model: 'gemini-2.0-flash',
32
+ * },
33
+ * name: 'Test model: Gemini',
34
+ * },
64
35
  * );
65
36
  * ```
66
37
  */
67
- get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion>;
38
+ upsert(systemID: string, body: VersionUpsertParams, options?: RequestOptions): APIPromise<SystemVersion>;
68
39
  }
69
- export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
70
40
  /**
71
41
  * A SystemVersion defines the specific settings for a System Under Test.
72
42
  *
@@ -75,9 +45,6 @@ export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
75
45
  *
76
46
  * When running evaluations, you reference a specific systemVersionId to establish
77
47
  * which system version to test.
78
- *
79
- * System versions will be validated against the system's configSchema, with
80
- * non-conforming values generating warnings.
81
48
  */
82
49
  export interface SystemVersion {
83
50
  /**
@@ -96,37 +63,19 @@ export interface SystemVersion {
96
63
  * The ID of the system the system version belongs to.
97
64
  */
98
65
  systemId: string;
99
- /**
100
- * Validation errors found in the system version. If present, the system version
101
- * doesn't fully conform to its system's configSchema.
102
- */
103
- validationErrors?: Array<SystemVersion.ValidationError>;
104
66
  }
105
- export declare namespace SystemVersion {
106
- interface ValidationError {
107
- /**
108
- * Human-readable error description.
109
- */
110
- message: string;
111
- /**
112
- * JSON Pointer to the field with the validation error.
113
- */
114
- path: string;
115
- }
116
- }
117
- export interface VersionCreateParams {
67
+ export interface VersionUpsertParams {
118
68
  /**
119
69
  * The configuration of the system version.
120
70
  */
121
71
  config: Record<string, unknown>;
122
72
  /**
123
- * The name of the system version.
73
+ * The name of the system version. If creating a new system version and the name
74
+ * isn't provided, it will be autogenerated.
124
75
  */
125
- name: string;
126
- }
127
- export interface VersionListParams extends PaginatedResponseParams {
76
+ name?: string;
128
77
  }
129
78
  export declare namespace Versions {
130
- export { type SystemVersion as SystemVersion, type SystemVersionsPaginatedResponse as SystemVersionsPaginatedResponse, type VersionCreateParams as VersionCreateParams, type VersionListParams as VersionListParams, };
79
+ export { type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams };
131
80
  }
132
81
  //# sourceMappingURL=versions.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE;OAChE,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIxG;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cA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AAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIjF;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAGzG;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACjG"}
@@ -1,72 +1,42 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
2
  import { APIPromise } from "../../core/api-promise.js";
3
- import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.js";
4
3
  import { RequestOptions } from "../../internal/request-options.js";
5
4
  export declare class Versions extends APIResource {
6
5
  /**
7
- * Create a new version for a system.
8
- *
9
- * Each version contains specific parameter values that match the system's
10
- * `configSchema` - things like model parameters, thresholds, or processing
11
- * options. Once created, versions cannot be modified, ensuring stable reference
12
- * points for evaluations.
13
- *
14
- * When creating a system version:
15
- *
16
- * - The `config` object is validated against the parent system's `configSchema`.
17
- * - System versions with validation errors are still stored, with errors included
18
- * in the response.
19
- * - Validation errors indicate fields that don't match the schema but don't
20
- * prevent creation.
21
- * - Having validation errors may affect how some evaluation metrics are
22
- * calculated.
6
+ * Retrieve a specific system version by ID.
23
7
  *
24
8
  * @example
25
9
  * ```ts
26
- * const systemVersion = await client.systems.versions.create(
27
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
28
- * {
29
- * config: {
30
- * temperature: 0.1,
31
- * maxTokens: 1024,
32
- * model: 'gpt-4-turbo',
33
- * },
34
- * name: 'Production (Low Temperature)',
35
- * },
10
+ * const systemVersion = await client.systems.versions.get(
11
+ * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
36
12
  * );
37
13
  * ```
38
14
  */
39
- create(systemID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SystemVersion>;
15
+ get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion>;
40
16
  /**
41
- * Retrieve a paginated list of system versions for a specific system.
17
+ * Create a new system version if it does not already exist. Does **not** set the
18
+ * created version to be the system's production version.
42
19
  *
43
- * System versions provide concrete parameter values for a System Under Test,
44
- * defining exactly how the system should be configured during an evaluation run.
20
+ * If there is already a system version with the same config, its name will be
21
+ * updated.
45
22
  *
46
23
  * @example
47
24
  * ```ts
48
- * // Automatically fetches more pages as needed.
49
- * for await (const systemVersion of client.systems.versions.list(
25
+ * const systemVersion = await client.systems.versions.upsert(
50
26
  * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
51
- * )) {
52
- * // ...
53
- * }
54
- * ```
55
- */
56
- list(systemID: string, query?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<SystemVersionsPaginatedResponse, SystemVersion>;
57
- /**
58
- * Retrieve a specific system version by ID.
59
- *
60
- * @example
61
- * ```ts
62
- * const systemVersion = await client.systems.versions.get(
63
- * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
27
+ * {
28
+ * config: {
29
+ * temperature: 0.5,
30
+ * maxTokens: 1024,
31
+ * model: 'gemini-2.0-flash',
32
+ * },
33
+ * name: 'Test model: Gemini',
34
+ * },
64
35
  * );
65
36
  * ```
66
37
  */
67
- get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion>;
38
+ upsert(systemID: string, body: VersionUpsertParams, options?: RequestOptions): APIPromise<SystemVersion>;
68
39
  }
69
- export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
70
40
  /**
71
41
  * A SystemVersion defines the specific settings for a System Under Test.
72
42
  *
@@ -75,9 +45,6 @@ export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
75
45
  *
76
46
  * When running evaluations, you reference a specific systemVersionId to establish
77
47
  * which system version to test.
78
- *
79
- * System versions will be validated against the system's configSchema, with
80
- * non-conforming values generating warnings.
81
48
  */
82
49
  export interface SystemVersion {
83
50
  /**
@@ -96,37 +63,19 @@ export interface SystemVersion {
96
63
  * The ID of the system the system version belongs to.
97
64
  */
98
65
  systemId: string;
99
- /**
100
- * Validation errors found in the system version. If present, the system version
101
- * doesn't fully conform to its system's configSchema.
102
- */
103
- validationErrors?: Array<SystemVersion.ValidationError>;
104
66
  }
105
- export declare namespace SystemVersion {
106
- interface ValidationError {
107
- /**
108
- * Human-readable error description.
109
- */
110
- message: string;
111
- /**
112
- * JSON Pointer to the field with the validation error.
113
- */
114
- path: string;
115
- }
116
- }
117
- export interface VersionCreateParams {
67
+ export interface VersionUpsertParams {
118
68
  /**
119
69
  * The configuration of the system version.
120
70
  */
121
71
  config: Record<string, unknown>;
122
72
  /**
123
- * The name of the system version.
73
+ * The name of the system version. If creating a new system version and the name
74
+ * isn't provided, it will be autogenerated.
124
75
  */
125
- name: string;
126
- }
127
- export interface VersionListParams extends PaginatedResponseParams {
76
+ name?: string;
128
77
  }
129
78
  export declare namespace Versions {
130
- export { type SystemVersion as SystemVersion, type SystemVersionsPaginatedResponse as SystemVersionsPaginatedResponse, type VersionCreateParams as VersionCreateParams, type VersionListParams as VersionListParams, };
79
+ export { type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams };
131
80
  }
132
81
  //# sourceMappingURL=versions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE;OAChE,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIxG;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,+BAA+B,EAAE,aAAa,CAAC;IAO9D;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAGlF;AAED,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,KA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AAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACjG"}
@@ -3,79 +3,45 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Versions = void 0;
5
5
  const resource_1 = require("../../core/resource.js");
6
- const pagination_1 = require("../../core/pagination.js");
7
6
  const path_1 = require("../../internal/utils/path.js");
8
7
  class Versions extends resource_1.APIResource {
9
8
  /**
10
- * Create a new version for a system.
11
- *
12
- * Each version contains specific parameter values that match the system's
13
- * `configSchema` - things like model parameters, thresholds, or processing
14
- * options. Once created, versions cannot be modified, ensuring stable reference
15
- * points for evaluations.
16
- *
17
- * When creating a system version:
18
- *
19
- * - The `config` object is validated against the parent system's `configSchema`.
20
- * - System versions with validation errors are still stored, with errors included
21
- * in the response.
22
- * - Validation errors indicate fields that don't match the schema but don't
23
- * prevent creation.
24
- * - Having validation errors may affect how some evaluation metrics are
25
- * calculated.
9
+ * Retrieve a specific system version by ID.
26
10
  *
27
11
  * @example
28
12
  * ```ts
29
- * const systemVersion = await client.systems.versions.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
- * },
13
+ * const systemVersion = await client.systems.versions.get(
14
+ * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
39
15
  * );
40
16
  * ```
41
17
  */
42
- create(systemID, body, options) {
43
- return this._client.post((0, path_1.path) `/systems/${systemID}/configs`, { body, ...options });
18
+ get(systemVersionID, options) {
19
+ return this._client.get((0, path_1.path) `/systems/versions/${systemVersionID}`, options);
44
20
  }
45
21
  /**
46
- * Retrieve a paginated list of system versions for a specific system.
22
+ * Create a new system version if it does not already exist. Does **not** set the
23
+ * created version to be the system's production version.
47
24
  *
48
- * System versions provide concrete parameter values for a System Under Test,
49
- * defining exactly how the system should be configured during an evaluation run.
25
+ * If there is already a system version with the same config, its name will be
26
+ * updated.
50
27
  *
51
28
  * @example
52
29
  * ```ts
53
- * // Automatically fetches more pages as needed.
54
- * for await (const systemVersion of client.systems.versions.list(
30
+ * const systemVersion = await client.systems.versions.upsert(
55
31
  * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
56
- * )) {
57
- * // ...
58
- * }
59
- * ```
60
- */
61
- list(systemID, query = {}, options) {
62
- return this._client.getAPIList((0, path_1.path) `/systems/${systemID}/configs`, (pagination_1.PaginatedResponse), {
63
- query,
64
- ...options,
65
- });
66
- }
67
- /**
68
- * Retrieve a specific system version by ID.
69
- *
70
- * @example
71
- * ```ts
72
- * const systemVersion = await client.systems.versions.get(
73
- * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
32
+ * {
33
+ * config: {
34
+ * temperature: 0.5,
35
+ * maxTokens: 1024,
36
+ * model: 'gemini-2.0-flash',
37
+ * },
38
+ * name: 'Test model: Gemini',
39
+ * },
74
40
  * );
75
41
  * ```
76
42
  */
77
- get(systemVersionID, options) {
78
- return this._client.get((0, path_1.path) `/systems/configs/${systemVersionID}`, options);
43
+ upsert(systemID, body, options) {
44
+ return this._client.post((0, path_1.path) `/systems/${systemID}/versions`, { body, ...options });
79
45
  }
80
46
  }
81
47
  exports.Versions = Versions;
@@ -1 +1 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,yDAAqG;AA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IAAA,WAAI,EAAA,YAAY,QAAQ,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;CACF;AAxCD,4BAwCC"}
@@ -1,78 +1,44 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../../core/resource.mjs";
3
- import { PaginatedResponse } from "../../core/pagination.mjs";
4
3
  import { path } from "../../internal/utils/path.mjs";
5
4
  export class Versions extends APIResource {
6
5
  /**
7
- * Create a new version for a system.
8
- *
9
- * Each version contains specific parameter values that match the system's
10
- * `configSchema` - things like model parameters, thresholds, or processing
11
- * options. Once created, versions cannot be modified, ensuring stable reference
12
- * points for evaluations.
13
- *
14
- * When creating a system version:
15
- *
16
- * - The `config` object is validated against the parent system's `configSchema`.
17
- * - System versions with validation errors are still stored, with errors included
18
- * in the response.
19
- * - Validation errors indicate fields that don't match the schema but don't
20
- * prevent creation.
21
- * - Having validation errors may affect how some evaluation metrics are
22
- * calculated.
6
+ * Retrieve a specific system version by ID.
23
7
  *
24
8
  * @example
25
9
  * ```ts
26
- * const systemVersion = await client.systems.versions.create(
27
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
28
- * {
29
- * config: {
30
- * temperature: 0.1,
31
- * maxTokens: 1024,
32
- * model: 'gpt-4-turbo',
33
- * },
34
- * name: 'Production (Low Temperature)',
35
- * },
10
+ * const systemVersion = await client.systems.versions.get(
11
+ * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
36
12
  * );
37
13
  * ```
38
14
  */
39
- create(systemID, body, options) {
40
- return this._client.post(path `/systems/${systemID}/configs`, { body, ...options });
15
+ get(systemVersionID, options) {
16
+ return this._client.get(path `/systems/versions/${systemVersionID}`, options);
41
17
  }
42
18
  /**
43
- * Retrieve a paginated list of system versions for a specific system.
19
+ * Create a new system version if it does not already exist. Does **not** set the
20
+ * created version to be the system's production version.
44
21
  *
45
- * System versions provide concrete parameter values for a System Under Test,
46
- * defining exactly how the system should be configured during an evaluation run.
22
+ * If there is already a system version with the same config, its name will be
23
+ * updated.
47
24
  *
48
25
  * @example
49
26
  * ```ts
50
- * // Automatically fetches more pages as needed.
51
- * for await (const systemVersion of client.systems.versions.list(
27
+ * const systemVersion = await client.systems.versions.upsert(
52
28
  * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
53
- * )) {
54
- * // ...
55
- * }
56
- * ```
57
- */
58
- list(systemID, query = {}, options) {
59
- return this._client.getAPIList(path `/systems/${systemID}/configs`, (PaginatedResponse), {
60
- query,
61
- ...options,
62
- });
63
- }
64
- /**
65
- * Retrieve a specific system version by ID.
66
- *
67
- * @example
68
- * ```ts
69
- * const systemVersion = await client.systems.versions.get(
70
- * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
29
+ * {
30
+ * config: {
31
+ * temperature: 0.5,
32
+ * maxTokens: 1024,
33
+ * model: 'gemini-2.0-flash',
34
+ * },
35
+ * name: 'Test model: Gemini',
36
+ * },
71
37
  * );
72
38
  * ```
73
39
  */
74
- get(systemVersionID, options) {
75
- return this._client.get(path `/systems/configs/${systemVersionID}`, options);
40
+ upsert(systemID, body, options) {
41
+ return this._client.post(path `/systems/${systemID}/versions`, { body, ...options });
76
42
  }
77
43
  }
78
44
  //# sourceMappingURL=versions.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"versions.mjs","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAe,iBAAiB,EAAgC;OAEhE,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAyB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,YAAY,QAAQ,UAAU,EAAE,EAAE,IAA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