scorecard-ai 1.2.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 (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/package.json +1 -1
  7. package/resources/index.d.mts +1 -1
  8. package/resources/index.d.mts.map +1 -1
  9. package/resources/index.d.ts +1 -1
  10. package/resources/index.d.ts.map +1 -1
  11. package/resources/records.d.mts +7 -18
  12. package/resources/records.d.mts.map +1 -1
  13. package/resources/records.d.ts +7 -18
  14. package/resources/records.d.ts.map +1 -1
  15. package/resources/records.js.map +1 -1
  16. package/resources/records.mjs.map +1 -1
  17. package/resources/scores.d.mts +2 -6
  18. package/resources/scores.d.mts.map +1 -1
  19. package/resources/scores.d.ts +2 -6
  20. package/resources/scores.d.ts.map +1 -1
  21. package/resources/shared.d.mts +1 -3
  22. package/resources/shared.d.mts.map +1 -1
  23. package/resources/shared.d.ts +1 -3
  24. package/resources/shared.d.ts.map +1 -1
  25. package/resources/systems/index.d.mts +2 -2
  26. package/resources/systems/index.d.mts.map +1 -1
  27. package/resources/systems/index.d.ts +2 -2
  28. package/resources/systems/index.d.ts.map +1 -1
  29. package/resources/systems/index.js.map +1 -1
  30. package/resources/systems/index.mjs +1 -1
  31. package/resources/systems/index.mjs.map +1 -1
  32. package/resources/systems/systems.d.mts +63 -143
  33. package/resources/systems/systems.d.mts.map +1 -1
  34. package/resources/systems/systems.d.ts +63 -143
  35. package/resources/systems/systems.d.ts.map +1 -1
  36. package/resources/systems/systems.js +21 -74
  37. package/resources/systems/systems.js.map +1 -1
  38. package/resources/systems/systems.mjs +22 -75
  39. package/resources/systems/systems.mjs.map +1 -1
  40. package/resources/systems/versions.d.mts +25 -80
  41. package/resources/systems/versions.d.mts.map +1 -1
  42. package/resources/systems/versions.d.ts +25 -80
  43. package/resources/systems/versions.d.ts.map +1 -1
  44. package/resources/systems/versions.js +20 -54
  45. package/resources/systems/versions.js.map +1 -1
  46. package/resources/systems/versions.mjs +20 -54
  47. package/resources/systems/versions.mjs.map +1 -1
  48. package/resources/testcases.d.mts +5 -15
  49. package/resources/testcases.d.mts.map +1 -1
  50. package/resources/testcases.d.ts +5 -15
  51. package/resources/testcases.d.ts.map +1 -1
  52. package/resources/testsets.d.mts +3 -9
  53. package/resources/testsets.d.mts.map +1 -1
  54. package/resources/testsets.d.ts +3 -9
  55. package/resources/testsets.d.ts.map +1 -1
  56. package/src/client.ts +2 -2
  57. package/src/resources/index.ts +1 -1
  58. package/src/resources/records.ts +7 -6
  59. package/src/resources/scores.ts +2 -2
  60. package/src/resources/shared.ts +1 -1
  61. package/src/resources/systems/index.ts +2 -8
  62. package/src/resources/systems/systems.ts +68 -141
  63. package/src/resources/systems/versions.ts +27 -97
  64. package/src/resources/testcases.ts +5 -5
  65. package/src/resources/testsets.ts +3 -3
  66. package/src/version.ts +1 -1
  67. package/version.d.mts +1 -1
  68. package/version.d.mts.map +1 -1
  69. package/version.d.ts +1 -1
  70. package/version.d.ts.map +1 -1
  71. package/version.js +1 -1
  72. package/version.js.map +1 -1
  73. package/version.mjs +1 -1
  74. package/version.mjs.map +1 -1
@@ -14,86 +14,17 @@ class Systems extends resource_1.APIResource {
14
14
  this.versions = new VersionsAPI.Versions(this._client);
15
15
  }
16
16
  /**
17
- * Create a new system definition that specifies the interface contracts for a
18
- * component you want to evaluate.
19
- *
20
- * A system acts as a template that defines three key contracts through JSON
21
- * Schemas:
22
- *
23
- * 1. Input Schema: What data your system accepts (e.g., user queries, context
24
- * documents)
25
- * 2. Output Schema: What data your system produces (e.g., responses, confidence
26
- * scores)
27
- * 3. Config Schema: What parameters can be adjusted (e.g., model selection,
28
- * temperature)
29
- *
30
- * This separation lets you evaluate any system as a black box, focusing on its
31
- * interface rather than implementation details.
32
- *
33
- * @example
34
- * ```ts
35
- * const system = await client.systems.create('314', {
36
- * configSchema: {
37
- * type: 'object',
38
- * properties: {
39
- * temperature: { type: 'number' },
40
- * maxTokens: { type: 'integer' },
41
- * model: { type: 'string', enum: ['gpt-4', 'gpt-4-turbo'] },
42
- * },
43
- * required: ['model'],
44
- * },
45
- * description: 'Production chatbot powered by GPT-4',
46
- * inputSchema: {
47
- * type: 'object',
48
- * properties: {
49
- * messages: {
50
- * type: 'array',
51
- * items: {
52
- * type: 'object',
53
- * properties: {
54
- * role: { type: 'string', enum: ['system', 'user', 'assistant'] },
55
- * content: { type: 'string' },
56
- * },
57
- * required: ['role', 'content'],
58
- * },
59
- * },
60
- * },
61
- * required: ['messages'],
62
- * },
63
- * name: 'GPT-4 Chatbot',
64
- * outputSchema: {
65
- * type: 'object',
66
- * properties: { response: { type: 'string' } },
67
- * required: ['response'],
68
- * },
69
- * });
70
- * ```
71
- */
72
- create(projectID, body, options) {
73
- return this._client.post((0, path_1.path) `/projects/${projectID}/systems`, { body, ...options });
74
- }
75
- /**
76
- * Update an existing system definition. Only the fields provided in the request
77
- * body will be updated. If a field is provided, the new content will replace the
78
- * existing content. If a field is not provided, the existing content will remain
79
- * unchanged.
80
- *
81
- * When updating schemas:
82
- *
83
- * - The system will accept your changes regardless of compatibility with existing
84
- * configurations
85
- * - Schema updates won't invalidate existing evaluations or configurations
86
- * - For significant redesigns, creating a new system definition provides a cleaner
87
- * separation
17
+ * Update an existing system. Only the fields provided in the request body will be
18
+ * updated. If a field is provided, the new content will replace the existing
19
+ * content. If a field is not provided, the existing content will remain unchanged.
88
20
  *
89
21
  * @example
90
22
  * ```ts
91
23
  * const system = await client.systems.update(
92
24
  * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
93
25
  * {
94
- * description:
95
- * 'Updated production chatbot powered by GPT-4 Turbo',
96
- * name: 'GPT-4 Turbo Chatbot',
26
+ * productionVersionId:
27
+ * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf3',
97
28
  * },
98
29
  * );
99
30
  * ```
@@ -145,6 +76,22 @@ class Systems extends resource_1.APIResource {
145
76
  get(systemID, options) {
146
77
  return this._client.get((0, path_1.path) `/systems/${systemID}`, options);
147
78
  }
79
+ /**
80
+ * Create a new system. If one with the same name in the project exists, it updates
81
+ * it instead.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const system = await client.systems.upsert('314', {
86
+ * config: { temperature: 0.1, maxTokens: 1024 },
87
+ * description: 'Production chatbot powered by GPT-4',
88
+ * name: 'GPT-4 Chatbot',
89
+ * });
90
+ * ```
91
+ */
92
+ upsert(projectID, body, options) {
93
+ return this._client.post((0, path_1.path) `/projects/${projectID}/systems`, { body, ...options });
94
+ }
148
95
  }
149
96
  exports.Systems = Systems;
150
97
  Systems.Versions = versions_1.Versions;
@@ -1 +1 @@
1
- {"version":3,"file":"systems.js","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,mEAA0C;AAC1C,4CAMoB;AAEpB,yDAAqG;AAErG,uDAAiD;AAEjD,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkJ1E,CAAC;IAhJC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAwB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CACJ,QAAgB,EAChB,OAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,E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,YAAY,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAAiB,EACjB,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,UAAU,EAAE,CAAA,8BAAyB,CAAA,EAAE;YAC9F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;OASG;IACH,GAAG,CAAC,QAAgB,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAwB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;CACF;AA9FD,0BA8FC;AAwGD,OAAO,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../../core/resource.mjs";
3
3
  import * as VersionsAPI from "./versions.mjs";
4
- import { Versions, } from "./versions.mjs";
4
+ import { Versions } from "./versions.mjs";
5
5
  import { PaginatedResponse } from "../../core/pagination.mjs";
6
6
  import { path } from "../../internal/utils/path.mjs";
7
7
  export class Systems extends APIResource {
@@ -10,86 +10,17 @@ export class Systems extends APIResource {
10
10
  this.versions = new VersionsAPI.Versions(this._client);
11
11
  }
12
12
  /**
13
- * Create a new system definition that specifies the interface contracts for a
14
- * component you want to evaluate.
15
- *
16
- * A system acts as a template that defines three key contracts through JSON
17
- * Schemas:
18
- *
19
- * 1. Input Schema: What data your system accepts (e.g., user queries, context
20
- * documents)
21
- * 2. Output Schema: What data your system produces (e.g., responses, confidence
22
- * scores)
23
- * 3. Config Schema: What parameters can be adjusted (e.g., model selection,
24
- * temperature)
25
- *
26
- * This separation lets you evaluate any system as a black box, focusing on its
27
- * interface rather than implementation details.
28
- *
29
- * @example
30
- * ```ts
31
- * const system = await client.systems.create('314', {
32
- * configSchema: {
33
- * type: 'object',
34
- * properties: {
35
- * temperature: { type: 'number' },
36
- * maxTokens: { type: 'integer' },
37
- * model: { type: 'string', enum: ['gpt-4', 'gpt-4-turbo'] },
38
- * },
39
- * required: ['model'],
40
- * },
41
- * description: 'Production chatbot powered by GPT-4',
42
- * inputSchema: {
43
- * type: 'object',
44
- * properties: {
45
- * messages: {
46
- * type: 'array',
47
- * items: {
48
- * type: 'object',
49
- * properties: {
50
- * role: { type: 'string', enum: ['system', 'user', 'assistant'] },
51
- * content: { type: 'string' },
52
- * },
53
- * required: ['role', 'content'],
54
- * },
55
- * },
56
- * },
57
- * required: ['messages'],
58
- * },
59
- * name: 'GPT-4 Chatbot',
60
- * outputSchema: {
61
- * type: 'object',
62
- * properties: { response: { type: 'string' } },
63
- * required: ['response'],
64
- * },
65
- * });
66
- * ```
67
- */
68
- create(projectID, body, options) {
69
- return this._client.post(path `/projects/${projectID}/systems`, { body, ...options });
70
- }
71
- /**
72
- * Update an existing system definition. Only the fields provided in the request
73
- * body will be updated. If a field is provided, the new content will replace the
74
- * existing content. If a field is not provided, the existing content will remain
75
- * unchanged.
76
- *
77
- * When updating schemas:
78
- *
79
- * - The system will accept your changes regardless of compatibility with existing
80
- * configurations
81
- * - Schema updates won't invalidate existing evaluations or configurations
82
- * - For significant redesigns, creating a new system definition provides a cleaner
83
- * separation
13
+ * Update an existing system. Only the fields provided in the request body will be
14
+ * updated. If a field is provided, the new content will replace the existing
15
+ * content. If a field is not provided, the existing content will remain unchanged.
84
16
  *
85
17
  * @example
86
18
  * ```ts
87
19
  * const system = await client.systems.update(
88
20
  * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
89
21
  * {
90
- * description:
91
- * 'Updated production chatbot powered by GPT-4 Turbo',
92
- * name: 'GPT-4 Turbo Chatbot',
22
+ * productionVersionId:
23
+ * '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf3',
93
24
  * },
94
25
  * );
95
26
  * ```
@@ -141,6 +72,22 @@ export class Systems extends APIResource {
141
72
  get(systemID, options) {
142
73
  return this._client.get(path `/systems/${systemID}`, options);
143
74
  }
75
+ /**
76
+ * Create a new system. If one with the same name in the project exists, it updates
77
+ * it instead.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const system = await client.systems.upsert('314', {
82
+ * config: { temperature: 0.1, maxTokens: 1024 },
83
+ * description: 'Production chatbot powered by GPT-4',
84
+ * name: 'GPT-4 Chatbot',
85
+ * });
86
+ * ```
87
+ */
88
+ upsert(projectID, body, options) {
89
+ return this._client.post(path `/projects/${projectID}/systems`, { body, ...options });
90
+ }
144
91
  }
145
92
  Systems.Versions = Versions;
146
93
  //# sourceMappingURL=systems.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"systems.mjs","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAKL,QAAQ,GACT;OAEM,EAAe,iBAAiB,EAAgC;OAEhE,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC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AC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;CACF;AAwGD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -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
  /**
@@ -87,9 +54,7 @@ export interface SystemVersion {
87
54
  /**
88
55
  * The configuration of the system version.
89
56
  */
90
- config: {
91
- [key: string]: unknown;
92
- };
57
+ config: Record<string, unknown>;
93
58
  /**
94
59
  * The name of the system version.
95
60
  */
@@ -98,39 +63,19 @@ export interface SystemVersion {
98
63
  * The ID of the system the system version belongs to.
99
64
  */
100
65
  systemId: string;
101
- /**
102
- * Validation errors found in the system version. If present, the system version
103
- * doesn't fully conform to its system's configSchema.
104
- */
105
- validationErrors?: Array<SystemVersion.ValidationError>;
106
66
  }
107
- export declare namespace SystemVersion {
108
- interface ValidationError {
109
- /**
110
- * Human-readable error description.
111
- */
112
- message: string;
113
- /**
114
- * JSON Pointer to the field with the validation error.
115
- */
116
- path: string;
117
- }
118
- }
119
- export interface VersionCreateParams {
67
+ export interface VersionUpsertParams {
120
68
  /**
121
69
  * The configuration of the system version.
122
70
  */
123
- config: {
124
- [key: string]: unknown;
125
- };
71
+ config: Record<string, unknown>;
126
72
  /**
127
- * 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.
128
75
  */
129
- name: string;
130
- }
131
- export interface VersionListParams extends PaginatedResponseParams {
76
+ name?: string;
132
77
  }
133
78
  export declare namespace Versions {
134
- 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 };
135
80
  }
136
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,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EACnC,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
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,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
  /**
@@ -87,9 +54,7 @@ export interface SystemVersion {
87
54
  /**
88
55
  * The configuration of the system version.
89
56
  */
90
- config: {
91
- [key: string]: unknown;
92
- };
57
+ config: Record<string, unknown>;
93
58
  /**
94
59
  * The name of the system version.
95
60
  */
@@ -98,39 +63,19 @@ export interface SystemVersion {
98
63
  * The ID of the system the system version belongs to.
99
64
  */
100
65
  systemId: string;
101
- /**
102
- * Validation errors found in the system version. If present, the system version
103
- * doesn't fully conform to its system's configSchema.
104
- */
105
- validationErrors?: Array<SystemVersion.ValidationError>;
106
66
  }
107
- export declare namespace SystemVersion {
108
- interface ValidationError {
109
- /**
110
- * Human-readable error description.
111
- */
112
- message: string;
113
- /**
114
- * JSON Pointer to the field with the validation error.
115
- */
116
- path: string;
117
- }
118
- }
119
- export interface VersionCreateParams {
67
+ export interface VersionUpsertParams {
120
68
  /**
121
69
  * The configuration of the system version.
122
70
  */
123
- config: {
124
- [key: string]: unknown;
125
- };
71
+ config: Record<string, unknown>;
126
72
  /**
127
- * 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.
128
75
  */
129
- name: string;
130
- }
131
- export interface VersionListParams extends PaginatedResponseParams {
76
+ name?: string;
132
77
  }
133
78
  export declare namespace Versions {
134
- 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 };
135
80
  }
136
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,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