scorecard-ai 1.0.0-alpha.8 → 1.0.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.
Files changed (143) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +25 -37
  3. package/client.d.mts +5 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +19 -4
  8. package/client.js.map +1 -1
  9. package/client.mjs +19 -4
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +1 -1
  12. package/core/pagination.d.mts.map +1 -1
  13. package/core/pagination.d.ts +1 -1
  14. package/core/pagination.d.ts.map +1 -1
  15. package/index.d.mts +1 -0
  16. package/index.d.mts.map +1 -1
  17. package/index.d.ts +1 -0
  18. package/index.d.ts.map +1 -1
  19. package/index.js +3 -1
  20. package/index.js.map +1 -1
  21. package/index.mjs +1 -0
  22. package/index.mjs.map +1 -1
  23. package/internal/detect-platform.js +3 -3
  24. package/internal/detect-platform.js.map +1 -1
  25. package/internal/detect-platform.mjs +3 -3
  26. package/internal/detect-platform.mjs.map +1 -1
  27. package/internal/shim-types.d.mts +11 -22
  28. package/internal/shim-types.d.mts.map +1 -0
  29. package/internal/shim-types.d.ts +11 -22
  30. package/internal/shim-types.d.ts.map +1 -0
  31. package/internal/shim-types.js +4 -0
  32. package/internal/shim-types.js.map +1 -0
  33. package/internal/shim-types.mjs +3 -0
  34. package/internal/shim-types.mjs.map +1 -0
  35. package/internal/shims.d.mts +2 -2
  36. package/internal/shims.d.mts.map +1 -1
  37. package/internal/shims.d.ts +2 -2
  38. package/internal/shims.d.ts.map +1 -1
  39. package/internal/tslib.js +6 -6
  40. package/internal/uploads.js.map +1 -1
  41. package/internal/uploads.mjs.map +1 -1
  42. package/lib/runAndEvaluate.d.mts +62 -10
  43. package/lib/runAndEvaluate.d.mts.map +1 -1
  44. package/lib/runAndEvaluate.d.ts +62 -10
  45. package/lib/runAndEvaluate.d.ts.map +1 -1
  46. package/lib/runAndEvaluate.js +72 -19
  47. package/lib/runAndEvaluate.js.map +1 -1
  48. package/lib/runAndEvaluate.mjs +72 -19
  49. package/lib/runAndEvaluate.mjs.map +1 -1
  50. package/package.json +1 -4
  51. package/resources/index.d.mts +2 -2
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +2 -2
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +4 -4
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +2 -2
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/metrics.d.mts +421 -0
  60. package/resources/metrics.d.mts.map +1 -0
  61. package/resources/metrics.d.ts +421 -0
  62. package/resources/metrics.d.ts.map +1 -0
  63. package/resources/metrics.js +33 -0
  64. package/resources/metrics.js.map +1 -0
  65. package/resources/metrics.mjs +29 -0
  66. package/resources/metrics.mjs.map +1 -0
  67. package/resources/runs.d.mts +8 -8
  68. package/resources/runs.d.mts.map +1 -1
  69. package/resources/runs.d.ts +8 -8
  70. package/resources/runs.d.ts.map +1 -1
  71. package/resources/runs.js +1 -1
  72. package/resources/runs.mjs +1 -1
  73. package/resources/systems/index.d.mts +3 -0
  74. package/resources/systems/index.d.mts.map +1 -0
  75. package/resources/systems/index.d.ts +3 -0
  76. package/resources/systems/index.d.ts.map +1 -0
  77. package/resources/systems/index.js +9 -0
  78. package/resources/systems/index.js.map +1 -0
  79. package/resources/systems/index.mjs +4 -0
  80. package/resources/systems/index.mjs.map +1 -0
  81. package/resources/systems/systems.d.mts +229 -0
  82. package/resources/systems/systems.d.mts.map +1 -0
  83. package/resources/systems/systems.d.ts +229 -0
  84. package/resources/systems/systems.d.ts.map +1 -0
  85. package/resources/systems/systems.js +151 -0
  86. package/resources/systems/systems.js.map +1 -0
  87. package/resources/systems/systems.mjs +146 -0
  88. package/resources/systems/systems.mjs.map +1 -0
  89. package/resources/systems/versions.d.mts +132 -0
  90. package/resources/systems/versions.d.mts.map +1 -0
  91. package/resources/systems/versions.d.ts +132 -0
  92. package/resources/systems/versions.d.ts.map +1 -0
  93. package/resources/systems/versions.js +82 -0
  94. package/resources/systems/versions.js.map +1 -0
  95. package/resources/systems/versions.mjs +78 -0
  96. package/resources/systems/versions.mjs.map +1 -0
  97. package/resources/systems.d.mts +1 -224
  98. package/resources/systems.d.mts.map +1 -1
  99. package/resources/systems.d.ts +1 -224
  100. package/resources/systems.d.ts.map +1 -1
  101. package/resources/systems.js +2 -139
  102. package/resources/systems.js.map +1 -1
  103. package/resources/systems.mjs +1 -137
  104. package/resources/systems.mjs.map +1 -1
  105. package/resources/testsets.d.mts +1 -1
  106. package/resources/testsets.d.ts +1 -1
  107. package/resources/testsets.js +1 -1
  108. package/resources/testsets.mjs +1 -1
  109. package/src/client.ts +28 -28
  110. package/src/core/pagination.ts +1 -1
  111. package/src/index.ts +2 -0
  112. package/src/internal/detect-platform.ts +3 -3
  113. package/src/internal/shim-types.ts +26 -0
  114. package/src/internal/shims.ts +2 -2
  115. package/src/internal/uploads.ts +1 -1
  116. package/src/lib/runAndEvaluate.ts +159 -31
  117. package/src/resources/index.ts +2 -9
  118. package/src/resources/metrics.ts +525 -0
  119. package/src/resources/runs.ts +8 -8
  120. package/src/resources/systems/index.ts +18 -0
  121. package/src/resources/systems/systems.ts +299 -0
  122. package/src/resources/systems/versions.ts +166 -0
  123. package/src/resources/systems.ts +1 -277
  124. package/src/resources/testsets.ts +1 -1
  125. package/src/version.ts +1 -1
  126. package/version.d.mts +1 -1
  127. package/version.d.mts.map +1 -1
  128. package/version.d.ts +1 -1
  129. package/version.d.ts.map +1 -1
  130. package/version.js +1 -1
  131. package/version.js.map +1 -1
  132. package/version.mjs +1 -1
  133. package/version.mjs.map +1 -1
  134. package/resources/system-configs.d.mts +0 -155
  135. package/resources/system-configs.d.mts.map +0 -1
  136. package/resources/system-configs.d.ts +0 -155
  137. package/resources/system-configs.d.ts.map +0 -1
  138. package/resources/system-configs.js +0 -83
  139. package/resources/system-configs.js.map +0 -1
  140. package/resources/system-configs.mjs +0 -79
  141. package/resources/system-configs.mjs.map +0 -1
  142. package/src/internal/shim-types.d.ts +0 -28
  143. package/src/resources/system-configs.ts +0 -203
@@ -0,0 +1,146 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as VersionsAPI from "./versions.mjs";
4
+ import { Versions, } from "./versions.mjs";
5
+ import { PaginatedResponse } from "../../core/pagination.mjs";
6
+ import { path } from "../../internal/utils/path.mjs";
7
+ export class Systems extends APIResource {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.versions = new VersionsAPI.Versions(this._client);
11
+ }
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
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const system = await client.systems.update(
88
+ * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
89
+ * {
90
+ * description:
91
+ * 'Updated production chatbot powered by GPT-4 Turbo',
92
+ * name: 'GPT-4 Turbo Chatbot',
93
+ * },
94
+ * );
95
+ * ```
96
+ */
97
+ update(systemID, body = {}, options) {
98
+ return this._client.patch(path `/systems/${systemID}`, { body, ...options });
99
+ }
100
+ /**
101
+ * Retrieve a paginated list of all systems. Systems are ordered by creation date.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * // Automatically fetches more pages as needed.
106
+ * for await (const system of client.systems.list('314')) {
107
+ * // ...
108
+ * }
109
+ * ```
110
+ */
111
+ list(projectID, query = {}, options) {
112
+ return this._client.getAPIList(path `/projects/${projectID}/systems`, (PaginatedResponse), {
113
+ query,
114
+ ...options,
115
+ });
116
+ }
117
+ /**
118
+ * Delete a system definition by ID. This will not delete associated system
119
+ * versions.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * const system = await client.systems.delete(
124
+ * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
125
+ * );
126
+ * ```
127
+ */
128
+ delete(systemID, options) {
129
+ return this._client.delete(path `/systems/${systemID}`, options);
130
+ }
131
+ /**
132
+ * Retrieve a specific system by ID.
133
+ *
134
+ * @example
135
+ * ```ts
136
+ * const system = await client.systems.get(
137
+ * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
138
+ * );
139
+ * ```
140
+ */
141
+ get(systemID, options) {
142
+ return this._client.get(path `/systems/${systemID}`, options);
143
+ }
144
+ }
145
+ Systems.Versions = Versions;
146
+ //# sourceMappingURL=systems.mjs.map
@@ -0,0 +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,OAAO,CAAC,CAAC;IAkJ1E,CAAC;IAhJC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAwB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,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,IAAI,CAAA,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,IAAI,CAAA,aAAa,SAAS,UAAU,EAAE,CAAA,iBAAyB,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,IAAI,CAAA,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,IAAI,CAAA,YAAY,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;CACF;AAoHD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,132 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Versions extends APIResource {
6
+ /**
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.
23
+ *
24
+ * @example
25
+ * ```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
+ * },
36
+ * );
37
+ * ```
38
+ */
39
+ create(systemID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SystemVersion>;
40
+ /**
41
+ * Retrieve a paginated list of system versions for a specific system.
42
+ *
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.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * // Automatically fetches more pages as needed.
49
+ * for await (const systemVersion of client.systems.versions.list(
50
+ * '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',
64
+ * );
65
+ * ```
66
+ */
67
+ get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion>;
68
+ }
69
+ export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
70
+ /**
71
+ * A SystemVersion defines the specific settings for a System Under Test.
72
+ *
73
+ * System versions contain parameter values that determine system behavior during
74
+ * evaluation. They are immutable snapshots - once created, they never change.
75
+ *
76
+ * When running evaluations, you reference a specific systemVersionId to establish
77
+ * 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
+ */
82
+ export interface SystemVersion {
83
+ /**
84
+ * The ID of the system version.
85
+ */
86
+ id: string;
87
+ /**
88
+ * The configuration of the system version.
89
+ */
90
+ config: Record<string, unknown>;
91
+ /**
92
+ * The name of the system version.
93
+ */
94
+ name: string;
95
+ /**
96
+ * The ID of the system the system version belongs to.
97
+ */
98
+ 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
+ }
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 {
118
+ /**
119
+ * The configuration of the system version.
120
+ */
121
+ config: Record<string, unknown>;
122
+ /**
123
+ * The name of the system version.
124
+ */
125
+ name: string;
126
+ }
127
+ export interface VersionListParams extends PaginatedResponseParams {
128
+ }
129
+ export declare namespace Versions {
130
+ export { type SystemVersion as SystemVersion, type SystemVersionsPaginatedResponse as SystemVersionsPaginatedResponse, type VersionCreateParams as VersionCreateParams, type VersionListParams as VersionListParams, };
131
+ }
132
+ //# sourceMappingURL=versions.d.mts.map
@@ -0,0 +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,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,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;CACzD;AAED,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,eAAe;QAC9B;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;CAAG;AAErE,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
@@ -0,0 +1,132 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ export declare class Versions extends APIResource {
6
+ /**
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.
23
+ *
24
+ * @example
25
+ * ```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
+ * },
36
+ * );
37
+ * ```
38
+ */
39
+ create(systemID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SystemVersion>;
40
+ /**
41
+ * Retrieve a paginated list of system versions for a specific system.
42
+ *
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.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * // Automatically fetches more pages as needed.
49
+ * for await (const systemVersion of client.systems.versions.list(
50
+ * '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',
64
+ * );
65
+ * ```
66
+ */
67
+ get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion>;
68
+ }
69
+ export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
70
+ /**
71
+ * A SystemVersion defines the specific settings for a System Under Test.
72
+ *
73
+ * System versions contain parameter values that determine system behavior during
74
+ * evaluation. They are immutable snapshots - once created, they never change.
75
+ *
76
+ * When running evaluations, you reference a specific systemVersionId to establish
77
+ * 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
+ */
82
+ export interface SystemVersion {
83
+ /**
84
+ * The ID of the system version.
85
+ */
86
+ id: string;
87
+ /**
88
+ * The configuration of the system version.
89
+ */
90
+ config: Record<string, unknown>;
91
+ /**
92
+ * The name of the system version.
93
+ */
94
+ name: string;
95
+ /**
96
+ * The ID of the system the system version belongs to.
97
+ */
98
+ 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
+ }
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 {
118
+ /**
119
+ * The configuration of the system version.
120
+ */
121
+ config: Record<string, unknown>;
122
+ /**
123
+ * The name of the system version.
124
+ */
125
+ name: string;
126
+ }
127
+ export interface VersionListParams extends PaginatedResponseParams {
128
+ }
129
+ export declare namespace Versions {
130
+ export { type SystemVersion as SystemVersion, type SystemVersionsPaginatedResponse as SystemVersionsPaginatedResponse, type VersionCreateParams as VersionCreateParams, type VersionListParams as VersionListParams, };
131
+ }
132
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +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,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;CACzD;AAED,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,eAAe;QAC9B;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;CAAG;AAErE,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Versions = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const pagination_1 = require("../../core/pagination.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ class Versions extends resource_1.APIResource {
9
+ /**
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.
26
+ *
27
+ * @example
28
+ * ```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
+ * },
39
+ * );
40
+ * ```
41
+ */
42
+ create(systemID, body, options) {
43
+ return this._client.post((0, path_1.path) `/systems/${systemID}/configs`, { body, ...options });
44
+ }
45
+ /**
46
+ * Retrieve a paginated list of system versions for a specific system.
47
+ *
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.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * // Automatically fetches more pages as needed.
54
+ * for await (const systemVersion of client.systems.versions.list(
55
+ * '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',
74
+ * );
75
+ * ```
76
+ */
77
+ get(systemVersionID, options) {
78
+ return this._client.get((0, path_1.path) `/systems/configs/${systemVersionID}`, options);
79
+ }
80
+ }
81
+ exports.Versions = Versions;
82
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,yDAAqG;AAErG,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAyB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CACF,QAAgB,EAChB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,UAAU,EAAE,CAAA,8BAAgC,CAAA,EAAE;YACnG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAuB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,eAAe,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF;AA9ED,4BA8EC"}
@@ -0,0 +1,78 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { PaginatedResponse } from "../../core/pagination.mjs";
4
+ import { path } from "../../internal/utils/path.mjs";
5
+ export class Versions extends APIResource {
6
+ /**
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.
23
+ *
24
+ * @example
25
+ * ```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
+ * },
36
+ * );
37
+ * ```
38
+ */
39
+ create(systemID, body, options) {
40
+ return this._client.post(path `/systems/${systemID}/configs`, { body, ...options });
41
+ }
42
+ /**
43
+ * Retrieve a paginated list of system versions for a specific system.
44
+ *
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.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * // Automatically fetches more pages as needed.
51
+ * for await (const systemVersion of client.systems.versions.list(
52
+ * '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',
71
+ * );
72
+ * ```
73
+ */
74
+ get(systemVersionID, options) {
75
+ return this._client.get(path `/systems/configs/${systemVersionID}`, options);
76
+ }
77
+ }
78
+ //# sourceMappingURL=versions.mjs.map
@@ -0,0 +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,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CACF,QAAgB,EAChB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,YAAY,QAAQ,UAAU,EAAE,CAAA,iBAAgC,CAAA,EAAE;YACnG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAuB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,eAAe,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF"}