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
@@ -1,225 +1,2 @@
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 Systems extends APIResource {
6
- /**
7
- * Create a new system definition that specifies the interface contracts for a
8
- * component you want to evaluate.
9
- *
10
- * A system acts as a template that defines three key contracts through JSON
11
- * Schemas:
12
- *
13
- * 1. Input Schema: What data your system accepts (e.g., user queries, context
14
- * documents)
15
- * 2. Output Schema: What data your system produces (e.g., responses, confidence
16
- * scores)
17
- * 3. Config Schema: What parameters can be adjusted (e.g., model selection,
18
- * temperature)
19
- *
20
- * This separation lets you evaluate any system as a black box, focusing on its
21
- * interface rather than implementation details.
22
- *
23
- * @example
24
- * ```ts
25
- * const system = await client.systems.create('314', {
26
- * configSchema: {
27
- * type: 'object',
28
- * properties: {
29
- * temperature: { type: 'number' },
30
- * maxTokens: { type: 'integer' },
31
- * model: { type: 'string', enum: ['gpt-4', 'gpt-4-turbo'] },
32
- * },
33
- * required: ['model'],
34
- * },
35
- * description: 'Production chatbot powered by GPT-4',
36
- * inputSchema: {
37
- * type: 'object',
38
- * properties: {
39
- * messages: {
40
- * type: 'array',
41
- * items: {
42
- * type: 'object',
43
- * properties: {
44
- * role: { type: 'string', enum: ['system', 'user', 'assistant'] },
45
- * content: { type: 'string' },
46
- * },
47
- * required: ['role', 'content'],
48
- * },
49
- * },
50
- * },
51
- * required: ['messages'],
52
- * },
53
- * name: 'GPT-4 Chatbot',
54
- * outputSchema: {
55
- * type: 'object',
56
- * properties: { response: { type: 'string' } },
57
- * required: ['response'],
58
- * },
59
- * });
60
- * ```
61
- */
62
- create(projectID: string, body: SystemCreateParams, options?: RequestOptions): APIPromise<System>;
63
- /**
64
- * Update an existing system definition. Only the fields provided in the request
65
- * body will be updated. If a field is provided, the new content will replace the
66
- * existing content. If a field is not provided, the existing content will remain
67
- * unchanged.
68
- *
69
- * When updating schemas:
70
- *
71
- * - The system will accept your changes regardless of compatibility with existing
72
- * configurations
73
- * - Schema updates won't invalidate existing evaluations or configurations
74
- * - For significant redesigns, creating a new system definition provides a cleaner
75
- * separation
76
- *
77
- * @example
78
- * ```ts
79
- * const system = await client.systems.update(
80
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
81
- * {
82
- * description:
83
- * 'Updated production chatbot powered by GPT-4 Turbo',
84
- * name: 'GPT-4 Turbo Chatbot',
85
- * },
86
- * );
87
- * ```
88
- */
89
- update(systemID: string, body?: SystemUpdateParams | null | undefined, options?: RequestOptions): APIPromise<System>;
90
- /**
91
- * Retrieve a paginated list of all systems. Systems are ordered by creation date.
92
- *
93
- * @example
94
- * ```ts
95
- * // Automatically fetches more pages as needed.
96
- * for await (const system of client.systems.list('314')) {
97
- * // ...
98
- * }
99
- * ```
100
- */
101
- list(projectID: string, query?: SystemListParams | null | undefined, options?: RequestOptions): PagePromise<SystemsPaginatedResponse, System>;
102
- /**
103
- * Delete a system definition by ID. This will not delete associated system
104
- * configurations.
105
- *
106
- * @example
107
- * ```ts
108
- * const system = await client.systems.delete(
109
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
110
- * );
111
- * ```
112
- */
113
- delete(systemID: string, options?: RequestOptions): APIPromise<SystemDeleteResponse>;
114
- /**
115
- * Retrieve a specific system by ID.
116
- *
117
- * @example
118
- * ```ts
119
- * const system = await client.systems.get(
120
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
121
- * );
122
- * ```
123
- */
124
- get(systemID: string, options?: RequestOptions): APIPromise<System>;
125
- }
126
- export type SystemsPaginatedResponse = PaginatedResponse<System>;
127
- /**
128
- * A System Under Test (SUT) defines the interface to a component or service you
129
- * want to evaluate.
130
- *
131
- * It specifies three contracts through schemas:
132
- *
133
- * - inputSchema: The structure of data the system accepts.
134
- * - outputSchema: The structure of data the system produces.
135
- * - configSchema: The parameters that modify system behavior.
136
- *
137
- * This abstraction lets you evaluate any system as a black box, focusing on its
138
- * interface rather than implementation details. It's particularly useful for
139
- * systems with variable outputs or complex internal state.
140
- *
141
- * Systems are templates - to run evaluations, pair them with a SystemConfig that
142
- * provides specific parameter values.
143
- */
144
- export interface System {
145
- /**
146
- * The ID of the system.
147
- */
148
- id: string;
149
- /**
150
- * The schema of the system's configuration.
151
- */
152
- configSchema: Record<string, unknown>;
153
- /**
154
- * The description of the system.
155
- */
156
- description: string;
157
- /**
158
- * The schema of the system's inputs.
159
- */
160
- inputSchema: Record<string, unknown>;
161
- /**
162
- * The name of the system.
163
- */
164
- name: string;
165
- /**
166
- * The schema of the system's outputs.
167
- */
168
- outputSchema: Record<string, unknown>;
169
- }
170
- export interface SystemDeleteResponse {
171
- /**
172
- * Whether the deletion was successful.
173
- */
174
- success: boolean;
175
- }
176
- export interface SystemCreateParams {
177
- /**
178
- * The schema of the system's configuration.
179
- */
180
- configSchema: Record<string, unknown>;
181
- /**
182
- * The description of the system.
183
- */
184
- description: string;
185
- /**
186
- * The schema of the system's inputs.
187
- */
188
- inputSchema: Record<string, unknown>;
189
- /**
190
- * The name of the system.
191
- */
192
- name: string;
193
- /**
194
- * The schema of the system's outputs.
195
- */
196
- outputSchema: Record<string, unknown>;
197
- }
198
- export interface SystemUpdateParams {
199
- /**
200
- * The schema of the system's configuration.
201
- */
202
- configSchema?: Record<string, unknown>;
203
- /**
204
- * The description of the system.
205
- */
206
- description?: string;
207
- /**
208
- * The schema of the system's inputs.
209
- */
210
- inputSchema?: Record<string, unknown>;
211
- /**
212
- * The name of the system.
213
- */
214
- name?: string;
215
- /**
216
- * The schema of the system's outputs.
217
- */
218
- outputSchema?: Record<string, unknown>;
219
- }
220
- export interface SystemListParams extends PaginatedResponseParams {
221
- }
222
- export declare namespace Systems {
223
- export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type SystemCreateParams as SystemCreateParams, type SystemUpdateParams as SystemUpdateParams, type SystemListParams as SystemListParams, };
224
- }
1
+ export * from "./systems/index.mjs";
225
2
  //# sourceMappingURL=systems.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"systems.d.mts","sourceRoot":"","sources":["../src/resources/systems.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,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIjG;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAIrB;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAOhD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAIpF;;;;;;;;;OASG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,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MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;CAAG;AAEpE,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
1
+ {"version":3,"file":"systems.d.mts","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":""}
@@ -1,225 +1,2 @@
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 Systems extends APIResource {
6
- /**
7
- * Create a new system definition that specifies the interface contracts for a
8
- * component you want to evaluate.
9
- *
10
- * A system acts as a template that defines three key contracts through JSON
11
- * Schemas:
12
- *
13
- * 1. Input Schema: What data your system accepts (e.g., user queries, context
14
- * documents)
15
- * 2. Output Schema: What data your system produces (e.g., responses, confidence
16
- * scores)
17
- * 3. Config Schema: What parameters can be adjusted (e.g., model selection,
18
- * temperature)
19
- *
20
- * This separation lets you evaluate any system as a black box, focusing on its
21
- * interface rather than implementation details.
22
- *
23
- * @example
24
- * ```ts
25
- * const system = await client.systems.create('314', {
26
- * configSchema: {
27
- * type: 'object',
28
- * properties: {
29
- * temperature: { type: 'number' },
30
- * maxTokens: { type: 'integer' },
31
- * model: { type: 'string', enum: ['gpt-4', 'gpt-4-turbo'] },
32
- * },
33
- * required: ['model'],
34
- * },
35
- * description: 'Production chatbot powered by GPT-4',
36
- * inputSchema: {
37
- * type: 'object',
38
- * properties: {
39
- * messages: {
40
- * type: 'array',
41
- * items: {
42
- * type: 'object',
43
- * properties: {
44
- * role: { type: 'string', enum: ['system', 'user', 'assistant'] },
45
- * content: { type: 'string' },
46
- * },
47
- * required: ['role', 'content'],
48
- * },
49
- * },
50
- * },
51
- * required: ['messages'],
52
- * },
53
- * name: 'GPT-4 Chatbot',
54
- * outputSchema: {
55
- * type: 'object',
56
- * properties: { response: { type: 'string' } },
57
- * required: ['response'],
58
- * },
59
- * });
60
- * ```
61
- */
62
- create(projectID: string, body: SystemCreateParams, options?: RequestOptions): APIPromise<System>;
63
- /**
64
- * Update an existing system definition. Only the fields provided in the request
65
- * body will be updated. If a field is provided, the new content will replace the
66
- * existing content. If a field is not provided, the existing content will remain
67
- * unchanged.
68
- *
69
- * When updating schemas:
70
- *
71
- * - The system will accept your changes regardless of compatibility with existing
72
- * configurations
73
- * - Schema updates won't invalidate existing evaluations or configurations
74
- * - For significant redesigns, creating a new system definition provides a cleaner
75
- * separation
76
- *
77
- * @example
78
- * ```ts
79
- * const system = await client.systems.update(
80
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
81
- * {
82
- * description:
83
- * 'Updated production chatbot powered by GPT-4 Turbo',
84
- * name: 'GPT-4 Turbo Chatbot',
85
- * },
86
- * );
87
- * ```
88
- */
89
- update(systemID: string, body?: SystemUpdateParams | null | undefined, options?: RequestOptions): APIPromise<System>;
90
- /**
91
- * Retrieve a paginated list of all systems. Systems are ordered by creation date.
92
- *
93
- * @example
94
- * ```ts
95
- * // Automatically fetches more pages as needed.
96
- * for await (const system of client.systems.list('314')) {
97
- * // ...
98
- * }
99
- * ```
100
- */
101
- list(projectID: string, query?: SystemListParams | null | undefined, options?: RequestOptions): PagePromise<SystemsPaginatedResponse, System>;
102
- /**
103
- * Delete a system definition by ID. This will not delete associated system
104
- * configurations.
105
- *
106
- * @example
107
- * ```ts
108
- * const system = await client.systems.delete(
109
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
110
- * );
111
- * ```
112
- */
113
- delete(systemID: string, options?: RequestOptions): APIPromise<SystemDeleteResponse>;
114
- /**
115
- * Retrieve a specific system by ID.
116
- *
117
- * @example
118
- * ```ts
119
- * const system = await client.systems.get(
120
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
121
- * );
122
- * ```
123
- */
124
- get(systemID: string, options?: RequestOptions): APIPromise<System>;
125
- }
126
- export type SystemsPaginatedResponse = PaginatedResponse<System>;
127
- /**
128
- * A System Under Test (SUT) defines the interface to a component or service you
129
- * want to evaluate.
130
- *
131
- * It specifies three contracts through schemas:
132
- *
133
- * - inputSchema: The structure of data the system accepts.
134
- * - outputSchema: The structure of data the system produces.
135
- * - configSchema: The parameters that modify system behavior.
136
- *
137
- * This abstraction lets you evaluate any system as a black box, focusing on its
138
- * interface rather than implementation details. It's particularly useful for
139
- * systems with variable outputs or complex internal state.
140
- *
141
- * Systems are templates - to run evaluations, pair them with a SystemConfig that
142
- * provides specific parameter values.
143
- */
144
- export interface System {
145
- /**
146
- * The ID of the system.
147
- */
148
- id: string;
149
- /**
150
- * The schema of the system's configuration.
151
- */
152
- configSchema: Record<string, unknown>;
153
- /**
154
- * The description of the system.
155
- */
156
- description: string;
157
- /**
158
- * The schema of the system's inputs.
159
- */
160
- inputSchema: Record<string, unknown>;
161
- /**
162
- * The name of the system.
163
- */
164
- name: string;
165
- /**
166
- * The schema of the system's outputs.
167
- */
168
- outputSchema: Record<string, unknown>;
169
- }
170
- export interface SystemDeleteResponse {
171
- /**
172
- * Whether the deletion was successful.
173
- */
174
- success: boolean;
175
- }
176
- export interface SystemCreateParams {
177
- /**
178
- * The schema of the system's configuration.
179
- */
180
- configSchema: Record<string, unknown>;
181
- /**
182
- * The description of the system.
183
- */
184
- description: string;
185
- /**
186
- * The schema of the system's inputs.
187
- */
188
- inputSchema: Record<string, unknown>;
189
- /**
190
- * The name of the system.
191
- */
192
- name: string;
193
- /**
194
- * The schema of the system's outputs.
195
- */
196
- outputSchema: Record<string, unknown>;
197
- }
198
- export interface SystemUpdateParams {
199
- /**
200
- * The schema of the system's configuration.
201
- */
202
- configSchema?: Record<string, unknown>;
203
- /**
204
- * The description of the system.
205
- */
206
- description?: string;
207
- /**
208
- * The schema of the system's inputs.
209
- */
210
- inputSchema?: Record<string, unknown>;
211
- /**
212
- * The name of the system.
213
- */
214
- name?: string;
215
- /**
216
- * The schema of the system's outputs.
217
- */
218
- outputSchema?: Record<string, unknown>;
219
- }
220
- export interface SystemListParams extends PaginatedResponseParams {
221
- }
222
- export declare namespace Systems {
223
- export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type SystemCreateParams as SystemCreateParams, type SystemUpdateParams as SystemUpdateParams, type SystemListParams as SystemListParams, };
224
- }
1
+ export * from "./systems/index.js";
225
2
  //# sourceMappingURL=systems.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../src/resources/systems.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,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIjG;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAIrB;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,S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IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;CAAG;AAEpE,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
1
+ {"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":""}
@@ -1,143 +1,6 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Systems = 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 Systems extends resource_1.APIResource {
9
- /**
10
- * Create a new system definition that specifies the interface contracts for a
11
- * component you want to evaluate.
12
- *
13
- * A system acts as a template that defines three key contracts through JSON
14
- * Schemas:
15
- *
16
- * 1. Input Schema: What data your system accepts (e.g., user queries, context
17
- * documents)
18
- * 2. Output Schema: What data your system produces (e.g., responses, confidence
19
- * scores)
20
- * 3. Config Schema: What parameters can be adjusted (e.g., model selection,
21
- * temperature)
22
- *
23
- * This separation lets you evaluate any system as a black box, focusing on its
24
- * interface rather than implementation details.
25
- *
26
- * @example
27
- * ```ts
28
- * const system = await client.systems.create('314', {
29
- * configSchema: {
30
- * type: 'object',
31
- * properties: {
32
- * temperature: { type: 'number' },
33
- * maxTokens: { type: 'integer' },
34
- * model: { type: 'string', enum: ['gpt-4', 'gpt-4-turbo'] },
35
- * },
36
- * required: ['model'],
37
- * },
38
- * description: 'Production chatbot powered by GPT-4',
39
- * inputSchema: {
40
- * type: 'object',
41
- * properties: {
42
- * messages: {
43
- * type: 'array',
44
- * items: {
45
- * type: 'object',
46
- * properties: {
47
- * role: { type: 'string', enum: ['system', 'user', 'assistant'] },
48
- * content: { type: 'string' },
49
- * },
50
- * required: ['role', 'content'],
51
- * },
52
- * },
53
- * },
54
- * required: ['messages'],
55
- * },
56
- * name: 'GPT-4 Chatbot',
57
- * outputSchema: {
58
- * type: 'object',
59
- * properties: { response: { type: 'string' } },
60
- * required: ['response'],
61
- * },
62
- * });
63
- * ```
64
- */
65
- create(projectID, body, options) {
66
- return this._client.post((0, path_1.path) `/projects/${projectID}/systems`, { body, ...options });
67
- }
68
- /**
69
- * Update an existing system definition. Only the fields provided in the request
70
- * body will be updated. If a field is provided, the new content will replace the
71
- * existing content. If a field is not provided, the existing content will remain
72
- * unchanged.
73
- *
74
- * When updating schemas:
75
- *
76
- * - The system will accept your changes regardless of compatibility with existing
77
- * configurations
78
- * - Schema updates won't invalidate existing evaluations or configurations
79
- * - For significant redesigns, creating a new system definition provides a cleaner
80
- * separation
81
- *
82
- * @example
83
- * ```ts
84
- * const system = await client.systems.update(
85
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
86
- * {
87
- * description:
88
- * 'Updated production chatbot powered by GPT-4 Turbo',
89
- * name: 'GPT-4 Turbo Chatbot',
90
- * },
91
- * );
92
- * ```
93
- */
94
- update(systemID, body = {}, options) {
95
- return this._client.patch((0, path_1.path) `/systems/${systemID}`, { body, ...options });
96
- }
97
- /**
98
- * Retrieve a paginated list of all systems. Systems are ordered by creation date.
99
- *
100
- * @example
101
- * ```ts
102
- * // Automatically fetches more pages as needed.
103
- * for await (const system of client.systems.list('314')) {
104
- * // ...
105
- * }
106
- * ```
107
- */
108
- list(projectID, query = {}, options) {
109
- return this._client.getAPIList((0, path_1.path) `/projects/${projectID}/systems`, (pagination_1.PaginatedResponse), {
110
- query,
111
- ...options,
112
- });
113
- }
114
- /**
115
- * Delete a system definition by ID. This will not delete associated system
116
- * configurations.
117
- *
118
- * @example
119
- * ```ts
120
- * const system = await client.systems.delete(
121
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
122
- * );
123
- * ```
124
- */
125
- delete(systemID, options) {
126
- return this._client.delete((0, path_1.path) `/systems/${systemID}`, options);
127
- }
128
- /**
129
- * Retrieve a specific system by ID.
130
- *
131
- * @example
132
- * ```ts
133
- * const system = await client.systems.get(
134
- * '12345678-0a8b-4f66-b6f3-2ddcfa097257',
135
- * );
136
- * ```
137
- */
138
- get(systemID, options) {
139
- return this._client.get((0, path_1.path) `/systems/${systemID}`, options);
140
- }
141
- }
142
- exports.Systems = Systems;
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./systems/index.js"), exports);
143
6
  //# sourceMappingURL=systems.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"systems.js","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAkG;AAElG,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,C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