scorecard-ai 1.2.0 → 2.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.
- package/CHANGELOG.md +33 -0
- package/client.d.mts +4 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/internal/request-options.d.mts +42 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +42 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/types.d.mts +8 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +8 -6
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.js +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.js +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js +26 -5
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +26 -5
- package/internal/utils/path.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/systems/index.d.mts +2 -2
- package/resources/systems/index.d.mts.map +1 -1
- package/resources/systems/index.d.ts +2 -2
- package/resources/systems/index.d.ts.map +1 -1
- package/resources/systems/index.js.map +1 -1
- package/resources/systems/index.mjs +1 -1
- package/resources/systems/index.mjs.map +1 -1
- package/resources/systems/systems.d.mts +63 -141
- package/resources/systems/systems.d.mts.map +1 -1
- package/resources/systems/systems.d.ts +63 -141
- package/resources/systems/systems.d.ts.map +1 -1
- package/resources/systems/systems.js +21 -74
- package/resources/systems/systems.js.map +1 -1
- package/resources/systems/systems.mjs +22 -75
- package/resources/systems/systems.mjs.map +1 -1
- package/resources/systems/versions.d.mts +23 -74
- package/resources/systems/versions.d.mts.map +1 -1
- package/resources/systems/versions.d.ts +23 -74
- package/resources/systems/versions.d.ts.map +1 -1
- package/resources/systems/versions.js +20 -54
- package/resources/systems/versions.js.map +1 -1
- package/resources/systems/versions.mjs +20 -54
- package/resources/systems/versions.mjs.map +1 -1
- package/src/client.ts +4 -2
- package/src/internal/request-options.ts +53 -0
- package/src/internal/types.ts +9 -6
- package/src/internal/uploads.ts +1 -1
- package/src/internal/utils/log.ts +1 -1
- package/src/internal/utils/path.ts +30 -7
- package/src/resources/index.ts +1 -1
- package/src/resources/systems/index.ts +2 -8
- package/src/resources/systems/systems.ts +68 -141
- package/src/resources/systems/versions.ts +25 -95
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,90 +1,23 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import * as VersionsAPI from "./versions.mjs";
|
|
3
|
-
import { SystemVersion,
|
|
3
|
+
import { SystemVersion, VersionUpsertParams, Versions } from "./versions.mjs";
|
|
4
4
|
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
5
|
import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.mjs";
|
|
6
6
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
7
7
|
export declare class Systems extends APIResource {
|
|
8
8
|
versions: VersionsAPI.Versions;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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: string, body: SystemCreateParams, options?: RequestOptions): APIPromise<System>;
|
|
66
|
-
/**
|
|
67
|
-
* Update an existing system definition. Only the fields provided in the request
|
|
68
|
-
* body will be updated. If a field is provided, the new content will replace the
|
|
69
|
-
* existing content. If a field is not provided, the existing content will remain
|
|
70
|
-
* unchanged.
|
|
71
|
-
*
|
|
72
|
-
* When updating schemas:
|
|
73
|
-
*
|
|
74
|
-
* - The system will accept your changes regardless of compatibility with existing
|
|
75
|
-
* configurations
|
|
76
|
-
* - Schema updates won't invalidate existing evaluations or configurations
|
|
77
|
-
* - For significant redesigns, creating a new system definition provides a cleaner
|
|
78
|
-
* separation
|
|
10
|
+
* Update an existing system. Only the fields provided in the request body will be
|
|
11
|
+
* updated. If a field is provided, the new content will replace the existing
|
|
12
|
+
* content. If a field is not provided, the existing content will remain unchanged.
|
|
79
13
|
*
|
|
80
14
|
* @example
|
|
81
15
|
* ```ts
|
|
82
16
|
* const system = await client.systems.update(
|
|
83
17
|
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
84
18
|
* {
|
|
85
|
-
*
|
|
86
|
-
* '
|
|
87
|
-
* name: 'GPT-4 Turbo Chatbot',
|
|
19
|
+
* productionVersionId:
|
|
20
|
+
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf3',
|
|
88
21
|
* },
|
|
89
22
|
* );
|
|
90
23
|
* ```
|
|
@@ -125,21 +58,24 @@ export declare class Systems extends APIResource {
|
|
|
125
58
|
* ```
|
|
126
59
|
*/
|
|
127
60
|
get(systemID: string, options?: RequestOptions): APIPromise<System>;
|
|
61
|
+
/**
|
|
62
|
+
* Create a new system. If one with the same name in the project exists, it updates
|
|
63
|
+
* it instead.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const system = await client.systems.upsert('314', {
|
|
68
|
+
* config: { temperature: 0.1, maxTokens: 1024 },
|
|
69
|
+
* description: 'Production chatbot powered by GPT-4',
|
|
70
|
+
* name: 'GPT-4 Chatbot',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
upsert(projectID: string, body: SystemUpsertParams, options?: RequestOptions): APIPromise<System>;
|
|
128
75
|
}
|
|
129
76
|
export type SystemsPaginatedResponse = PaginatedResponse<System>;
|
|
130
77
|
/**
|
|
131
|
-
* A System Under Test (SUT)
|
|
132
|
-
* want to evaluate.
|
|
133
|
-
*
|
|
134
|
-
* It specifies three contracts through schemas:
|
|
135
|
-
*
|
|
136
|
-
* - inputSchema: The structure of data the system accepts.
|
|
137
|
-
* - outputSchema: The structure of data the system produces.
|
|
138
|
-
* - configSchema: The parameters that modify system behavior.
|
|
139
|
-
*
|
|
140
|
-
* This abstraction lets you evaluate any system as a black box, focusing on its
|
|
141
|
-
* interface rather than implementation details. It's particularly useful for
|
|
142
|
-
* systems with variable outputs or complex internal state.
|
|
78
|
+
* A System Under Test (SUT).
|
|
143
79
|
*
|
|
144
80
|
* Systems are templates - to run evaluations, pair them with a SystemVersion that
|
|
145
81
|
* provides specific parameter values.
|
|
@@ -149,32 +85,43 @@ export interface System {
|
|
|
149
85
|
* The ID of the system.
|
|
150
86
|
*/
|
|
151
87
|
id: string;
|
|
152
|
-
/**
|
|
153
|
-
* The schema of the system's configuration.
|
|
154
|
-
*/
|
|
155
|
-
configSchema: {
|
|
156
|
-
[key: string]: unknown;
|
|
157
|
-
};
|
|
158
88
|
/**
|
|
159
89
|
* The description of the system.
|
|
160
90
|
*/
|
|
161
91
|
description: string;
|
|
162
92
|
/**
|
|
163
|
-
* The
|
|
93
|
+
* The name of the system. Unique within the project.
|
|
164
94
|
*/
|
|
165
|
-
|
|
166
|
-
[key: string]: unknown;
|
|
167
|
-
};
|
|
95
|
+
name: string;
|
|
168
96
|
/**
|
|
169
|
-
* The
|
|
97
|
+
* The production version of the system.
|
|
170
98
|
*/
|
|
171
|
-
|
|
99
|
+
productionVersion: VersionsAPI.SystemVersion;
|
|
172
100
|
/**
|
|
173
|
-
* The
|
|
101
|
+
* The versions of the system.
|
|
174
102
|
*/
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
103
|
+
versions: Array<System.Version>;
|
|
104
|
+
}
|
|
105
|
+
export declare namespace System {
|
|
106
|
+
/**
|
|
107
|
+
* A SystemVersion defines the specific settings for a System Under Test.
|
|
108
|
+
*
|
|
109
|
+
* System versions contain parameter values that determine system behavior during
|
|
110
|
+
* evaluation. They are immutable snapshots - once created, they never change.
|
|
111
|
+
*
|
|
112
|
+
* When running evaluations, you reference a specific systemVersionId to establish
|
|
113
|
+
* which system version to test.
|
|
114
|
+
*/
|
|
115
|
+
interface Version {
|
|
116
|
+
/**
|
|
117
|
+
* The ID of the system version.
|
|
118
|
+
*/
|
|
119
|
+
id: string;
|
|
120
|
+
/**
|
|
121
|
+
* The name of the system version.
|
|
122
|
+
*/
|
|
123
|
+
name: string;
|
|
124
|
+
}
|
|
178
125
|
}
|
|
179
126
|
export interface SystemDeleteResponse {
|
|
180
127
|
/**
|
|
@@ -182,39 +129,27 @@ export interface SystemDeleteResponse {
|
|
|
182
129
|
*/
|
|
183
130
|
success: boolean;
|
|
184
131
|
}
|
|
185
|
-
export interface
|
|
186
|
-
/**
|
|
187
|
-
* The schema of the system's configuration.
|
|
188
|
-
*/
|
|
189
|
-
configSchema: {
|
|
190
|
-
[key: string]: unknown;
|
|
191
|
-
};
|
|
132
|
+
export interface SystemUpdateParams {
|
|
192
133
|
/**
|
|
193
134
|
* The description of the system.
|
|
194
135
|
*/
|
|
195
|
-
description
|
|
196
|
-
/**
|
|
197
|
-
* The schema of the system's inputs.
|
|
198
|
-
*/
|
|
199
|
-
inputSchema: {
|
|
200
|
-
[key: string]: unknown;
|
|
201
|
-
};
|
|
136
|
+
description?: string;
|
|
202
137
|
/**
|
|
203
|
-
* The name of the system.
|
|
138
|
+
* The name of the system. Unique within the project.
|
|
204
139
|
*/
|
|
205
|
-
name
|
|
140
|
+
name?: string;
|
|
206
141
|
/**
|
|
207
|
-
* The
|
|
142
|
+
* The ID of the production version of the system.
|
|
208
143
|
*/
|
|
209
|
-
|
|
210
|
-
[key: string]: unknown;
|
|
211
|
-
};
|
|
144
|
+
productionVersionId?: string;
|
|
212
145
|
}
|
|
213
|
-
export interface
|
|
146
|
+
export interface SystemListParams extends PaginatedResponseParams {
|
|
147
|
+
}
|
|
148
|
+
export interface SystemUpsertParams {
|
|
214
149
|
/**
|
|
215
|
-
* The
|
|
150
|
+
* The configuration of the system.
|
|
216
151
|
*/
|
|
217
|
-
|
|
152
|
+
config: {
|
|
218
153
|
[key: string]: unknown;
|
|
219
154
|
};
|
|
220
155
|
/**
|
|
@@ -222,26 +157,13 @@ export interface SystemUpdateParams {
|
|
|
222
157
|
*/
|
|
223
158
|
description?: string;
|
|
224
159
|
/**
|
|
225
|
-
* The
|
|
226
|
-
|
|
227
|
-
inputSchema?: {
|
|
228
|
-
[key: string]: unknown;
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* The name of the system.
|
|
160
|
+
* The name of the system. Should be unique within the project. Default is "Default
|
|
161
|
+
* system"
|
|
232
162
|
*/
|
|
233
163
|
name?: string;
|
|
234
|
-
/**
|
|
235
|
-
* The schema of the system's outputs.
|
|
236
|
-
*/
|
|
237
|
-
outputSchema?: {
|
|
238
|
-
[key: string]: unknown;
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
export interface SystemListParams extends PaginatedResponseParams {
|
|
242
164
|
}
|
|
243
165
|
export declare namespace Systems {
|
|
244
|
-
export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type
|
|
245
|
-
export { Versions as Versions, type SystemVersion as SystemVersion, type
|
|
166
|
+
export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type SystemUpdateParams as SystemUpdateParams, type SystemListParams as SystemListParams, type SystemUpsertParams as SystemUpsertParams, };
|
|
167
|
+
export { Versions as Versions, type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams, };
|
|
246
168
|
}
|
|
247
169
|
//# sourceMappingURL=systems.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systems.d.mts","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,
|
|
1
|
+
{"version":3,"file":"systems.d.mts","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,aAAa,EAAE,mBAAmB,EAAE,QAAQ,EAAE;OAChD,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE;OAChE,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;;OAeG;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,CAAC,MAAM,CAAC;IAInE;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MA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AAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -1,90 +1,23 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import * as VersionsAPI from "./versions.js";
|
|
3
|
-
import { SystemVersion,
|
|
3
|
+
import { SystemVersion, VersionUpsertParams, Versions } from "./versions.js";
|
|
4
4
|
import { APIPromise } from "../../core/api-promise.js";
|
|
5
5
|
import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.js";
|
|
6
6
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
7
|
export declare class Systems extends APIResource {
|
|
8
8
|
versions: VersionsAPI.Versions;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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: string, body: SystemCreateParams, options?: RequestOptions): APIPromise<System>;
|
|
66
|
-
/**
|
|
67
|
-
* Update an existing system definition. Only the fields provided in the request
|
|
68
|
-
* body will be updated. If a field is provided, the new content will replace the
|
|
69
|
-
* existing content. If a field is not provided, the existing content will remain
|
|
70
|
-
* unchanged.
|
|
71
|
-
*
|
|
72
|
-
* When updating schemas:
|
|
73
|
-
*
|
|
74
|
-
* - The system will accept your changes regardless of compatibility with existing
|
|
75
|
-
* configurations
|
|
76
|
-
* - Schema updates won't invalidate existing evaluations or configurations
|
|
77
|
-
* - For significant redesigns, creating a new system definition provides a cleaner
|
|
78
|
-
* separation
|
|
10
|
+
* Update an existing system. Only the fields provided in the request body will be
|
|
11
|
+
* updated. If a field is provided, the new content will replace the existing
|
|
12
|
+
* content. If a field is not provided, the existing content will remain unchanged.
|
|
79
13
|
*
|
|
80
14
|
* @example
|
|
81
15
|
* ```ts
|
|
82
16
|
* const system = await client.systems.update(
|
|
83
17
|
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
84
18
|
* {
|
|
85
|
-
*
|
|
86
|
-
* '
|
|
87
|
-
* name: 'GPT-4 Turbo Chatbot',
|
|
19
|
+
* productionVersionId:
|
|
20
|
+
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf3',
|
|
88
21
|
* },
|
|
89
22
|
* );
|
|
90
23
|
* ```
|
|
@@ -125,21 +58,24 @@ export declare class Systems extends APIResource {
|
|
|
125
58
|
* ```
|
|
126
59
|
*/
|
|
127
60
|
get(systemID: string, options?: RequestOptions): APIPromise<System>;
|
|
61
|
+
/**
|
|
62
|
+
* Create a new system. If one with the same name in the project exists, it updates
|
|
63
|
+
* it instead.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const system = await client.systems.upsert('314', {
|
|
68
|
+
* config: { temperature: 0.1, maxTokens: 1024 },
|
|
69
|
+
* description: 'Production chatbot powered by GPT-4',
|
|
70
|
+
* name: 'GPT-4 Chatbot',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
upsert(projectID: string, body: SystemUpsertParams, options?: RequestOptions): APIPromise<System>;
|
|
128
75
|
}
|
|
129
76
|
export type SystemsPaginatedResponse = PaginatedResponse<System>;
|
|
130
77
|
/**
|
|
131
|
-
* A System Under Test (SUT)
|
|
132
|
-
* want to evaluate.
|
|
133
|
-
*
|
|
134
|
-
* It specifies three contracts through schemas:
|
|
135
|
-
*
|
|
136
|
-
* - inputSchema: The structure of data the system accepts.
|
|
137
|
-
* - outputSchema: The structure of data the system produces.
|
|
138
|
-
* - configSchema: The parameters that modify system behavior.
|
|
139
|
-
*
|
|
140
|
-
* This abstraction lets you evaluate any system as a black box, focusing on its
|
|
141
|
-
* interface rather than implementation details. It's particularly useful for
|
|
142
|
-
* systems with variable outputs or complex internal state.
|
|
78
|
+
* A System Under Test (SUT).
|
|
143
79
|
*
|
|
144
80
|
* Systems are templates - to run evaluations, pair them with a SystemVersion that
|
|
145
81
|
* provides specific parameter values.
|
|
@@ -149,32 +85,43 @@ export interface System {
|
|
|
149
85
|
* The ID of the system.
|
|
150
86
|
*/
|
|
151
87
|
id: string;
|
|
152
|
-
/**
|
|
153
|
-
* The schema of the system's configuration.
|
|
154
|
-
*/
|
|
155
|
-
configSchema: {
|
|
156
|
-
[key: string]: unknown;
|
|
157
|
-
};
|
|
158
88
|
/**
|
|
159
89
|
* The description of the system.
|
|
160
90
|
*/
|
|
161
91
|
description: string;
|
|
162
92
|
/**
|
|
163
|
-
* The
|
|
93
|
+
* The name of the system. Unique within the project.
|
|
164
94
|
*/
|
|
165
|
-
|
|
166
|
-
[key: string]: unknown;
|
|
167
|
-
};
|
|
95
|
+
name: string;
|
|
168
96
|
/**
|
|
169
|
-
* The
|
|
97
|
+
* The production version of the system.
|
|
170
98
|
*/
|
|
171
|
-
|
|
99
|
+
productionVersion: VersionsAPI.SystemVersion;
|
|
172
100
|
/**
|
|
173
|
-
* The
|
|
101
|
+
* The versions of the system.
|
|
174
102
|
*/
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
103
|
+
versions: Array<System.Version>;
|
|
104
|
+
}
|
|
105
|
+
export declare namespace System {
|
|
106
|
+
/**
|
|
107
|
+
* A SystemVersion defines the specific settings for a System Under Test.
|
|
108
|
+
*
|
|
109
|
+
* System versions contain parameter values that determine system behavior during
|
|
110
|
+
* evaluation. They are immutable snapshots - once created, they never change.
|
|
111
|
+
*
|
|
112
|
+
* When running evaluations, you reference a specific systemVersionId to establish
|
|
113
|
+
* which system version to test.
|
|
114
|
+
*/
|
|
115
|
+
interface Version {
|
|
116
|
+
/**
|
|
117
|
+
* The ID of the system version.
|
|
118
|
+
*/
|
|
119
|
+
id: string;
|
|
120
|
+
/**
|
|
121
|
+
* The name of the system version.
|
|
122
|
+
*/
|
|
123
|
+
name: string;
|
|
124
|
+
}
|
|
178
125
|
}
|
|
179
126
|
export interface SystemDeleteResponse {
|
|
180
127
|
/**
|
|
@@ -182,39 +129,27 @@ export interface SystemDeleteResponse {
|
|
|
182
129
|
*/
|
|
183
130
|
success: boolean;
|
|
184
131
|
}
|
|
185
|
-
export interface
|
|
186
|
-
/**
|
|
187
|
-
* The schema of the system's configuration.
|
|
188
|
-
*/
|
|
189
|
-
configSchema: {
|
|
190
|
-
[key: string]: unknown;
|
|
191
|
-
};
|
|
132
|
+
export interface SystemUpdateParams {
|
|
192
133
|
/**
|
|
193
134
|
* The description of the system.
|
|
194
135
|
*/
|
|
195
|
-
description
|
|
196
|
-
/**
|
|
197
|
-
* The schema of the system's inputs.
|
|
198
|
-
*/
|
|
199
|
-
inputSchema: {
|
|
200
|
-
[key: string]: unknown;
|
|
201
|
-
};
|
|
136
|
+
description?: string;
|
|
202
137
|
/**
|
|
203
|
-
* The name of the system.
|
|
138
|
+
* The name of the system. Unique within the project.
|
|
204
139
|
*/
|
|
205
|
-
name
|
|
140
|
+
name?: string;
|
|
206
141
|
/**
|
|
207
|
-
* The
|
|
142
|
+
* The ID of the production version of the system.
|
|
208
143
|
*/
|
|
209
|
-
|
|
210
|
-
[key: string]: unknown;
|
|
211
|
-
};
|
|
144
|
+
productionVersionId?: string;
|
|
212
145
|
}
|
|
213
|
-
export interface
|
|
146
|
+
export interface SystemListParams extends PaginatedResponseParams {
|
|
147
|
+
}
|
|
148
|
+
export interface SystemUpsertParams {
|
|
214
149
|
/**
|
|
215
|
-
* The
|
|
150
|
+
* The configuration of the system.
|
|
216
151
|
*/
|
|
217
|
-
|
|
152
|
+
config: {
|
|
218
153
|
[key: string]: unknown;
|
|
219
154
|
};
|
|
220
155
|
/**
|
|
@@ -222,26 +157,13 @@ export interface SystemUpdateParams {
|
|
|
222
157
|
*/
|
|
223
158
|
description?: string;
|
|
224
159
|
/**
|
|
225
|
-
* The
|
|
226
|
-
|
|
227
|
-
inputSchema?: {
|
|
228
|
-
[key: string]: unknown;
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* The name of the system.
|
|
160
|
+
* The name of the system. Should be unique within the project. Default is "Default
|
|
161
|
+
* system"
|
|
232
162
|
*/
|
|
233
163
|
name?: string;
|
|
234
|
-
/**
|
|
235
|
-
* The schema of the system's outputs.
|
|
236
|
-
*/
|
|
237
|
-
outputSchema?: {
|
|
238
|
-
[key: string]: unknown;
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
export interface SystemListParams extends PaginatedResponseParams {
|
|
242
164
|
}
|
|
243
165
|
export declare namespace Systems {
|
|
244
|
-
export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type
|
|
245
|
-
export { Versions as Versions, type SystemVersion as SystemVersion, type
|
|
166
|
+
export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type SystemUpdateParams as SystemUpdateParams, type SystemListParams as SystemListParams, type SystemUpsertParams as SystemUpsertParams, };
|
|
167
|
+
export { Versions as Versions, type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams, };
|
|
246
168
|
}
|
|
247
169
|
//# sourceMappingURL=systems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,
|
|
1
|
+
{"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,aAAa,EAAE,mBAAmB,EAAE,QAAQ,EAAE;OAChD,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE;OAChE,EAAE,cAAc,EAA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