scorecard-ai 1.1.0 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/README.md +4 -5
- package/client.d.mts +13 -13
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -13
- package/client.d.ts.map +1 -1
- package/client.js +27 -25
- package/client.js.map +1 -1
- package/client.mjs +16 -14
- package/client.mjs.map +1 -1
- package/core/resource.d.mts +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +4 -4
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +4 -4
- package/internal/headers.mjs.map +1 -1
- package/internal/request-options.d.mts +1 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +1 -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/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.map +1 -1
- package/internal/utils/path.mjs +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.d.mts +2 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +2 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +4 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +2 -0
- package/internal/utils/values.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 -125
- package/resources/systems/systems.d.mts.map +1 -1
- package/resources/systems/systems.d.ts +63 -125
- 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 +39 -27
- package/src/core/resource.ts +1 -1
- package/src/internal/headers.ts +5 -5
- package/src/internal/request-options.ts +1 -0
- package/src/internal/uploads.ts +1 -1
- package/src/internal/utils/log.ts +1 -1
- package/src/internal/utils/path.ts +1 -1
- package/src/internal/utils/values.ts +3 -0
- 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.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -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,26 +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: Record<string, unknown>;
|
|
156
88
|
/**
|
|
157
89
|
* The description of the system.
|
|
158
90
|
*/
|
|
159
91
|
description: string;
|
|
160
92
|
/**
|
|
161
|
-
* The
|
|
93
|
+
* The name of the system. Unique within the project.
|
|
162
94
|
*/
|
|
163
|
-
|
|
95
|
+
name: string;
|
|
164
96
|
/**
|
|
165
|
-
* The
|
|
97
|
+
* The production version of the system.
|
|
166
98
|
*/
|
|
167
|
-
|
|
99
|
+
productionVersion: VersionsAPI.SystemVersion;
|
|
168
100
|
/**
|
|
169
|
-
* The
|
|
101
|
+
* The versions of the system.
|
|
170
102
|
*/
|
|
171
|
-
|
|
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
|
+
}
|
|
172
125
|
}
|
|
173
126
|
export interface SystemDeleteResponse {
|
|
174
127
|
/**
|
|
@@ -176,54 +129,39 @@ export interface SystemDeleteResponse {
|
|
|
176
129
|
*/
|
|
177
130
|
success: boolean;
|
|
178
131
|
}
|
|
179
|
-
export interface
|
|
180
|
-
/**
|
|
181
|
-
* The schema of the system's configuration.
|
|
182
|
-
*/
|
|
183
|
-
configSchema: Record<string, unknown>;
|
|
132
|
+
export interface SystemUpdateParams {
|
|
184
133
|
/**
|
|
185
134
|
* The description of the system.
|
|
186
135
|
*/
|
|
187
|
-
description
|
|
188
|
-
/**
|
|
189
|
-
* The schema of the system's inputs.
|
|
190
|
-
*/
|
|
191
|
-
inputSchema: Record<string, unknown>;
|
|
136
|
+
description?: string;
|
|
192
137
|
/**
|
|
193
|
-
* The name of the system.
|
|
138
|
+
* The name of the system. Unique within the project.
|
|
194
139
|
*/
|
|
195
|
-
name
|
|
140
|
+
name?: string;
|
|
196
141
|
/**
|
|
197
|
-
* The
|
|
142
|
+
* The ID of the production version of the system.
|
|
198
143
|
*/
|
|
199
|
-
|
|
144
|
+
productionVersionId?: string;
|
|
200
145
|
}
|
|
201
|
-
export interface
|
|
146
|
+
export interface SystemListParams extends PaginatedResponseParams {
|
|
147
|
+
}
|
|
148
|
+
export interface SystemUpsertParams {
|
|
202
149
|
/**
|
|
203
|
-
* The
|
|
150
|
+
* The configuration of the system.
|
|
204
151
|
*/
|
|
205
|
-
|
|
152
|
+
config: Record<string, unknown>;
|
|
206
153
|
/**
|
|
207
154
|
* The description of the system.
|
|
208
155
|
*/
|
|
209
156
|
description?: string;
|
|
210
157
|
/**
|
|
211
|
-
* The
|
|
212
|
-
|
|
213
|
-
inputSchema?: Record<string, unknown>;
|
|
214
|
-
/**
|
|
215
|
-
* The name of the system.
|
|
158
|
+
* The name of the system. Should be unique within the project. Default is "Default
|
|
159
|
+
* system"
|
|
216
160
|
*/
|
|
217
161
|
name?: string;
|
|
218
|
-
/**
|
|
219
|
-
* The schema of the system's outputs.
|
|
220
|
-
*/
|
|
221
|
-
outputSchema?: Record<string, unknown>;
|
|
222
|
-
}
|
|
223
|
-
export interface SystemListParams extends PaginatedResponseParams {
|
|
224
162
|
}
|
|
225
163
|
export declare namespace Systems {
|
|
226
|
-
export { type System as System, type SystemDeleteResponse as SystemDeleteResponse, type SystemsPaginatedResponse as SystemsPaginatedResponse, type
|
|
227
|
-
export { Versions as Versions, type SystemVersion as SystemVersion, type
|
|
164
|
+
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, };
|
|
165
|
+
export { Versions as Versions, type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams, };
|
|
228
166
|
}
|
|
229
167
|
//# 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,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,GA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;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAID,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,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"}
|
|
@@ -14,86 +14,17 @@ class Systems extends resource_1.APIResource {
|
|
|
14
14
|
this.versions = new VersionsAPI.Versions(this._client);
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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
|
-
*
|
|
95
|
-
* '
|
|
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,
|
|
1
|
+
{"version":3,"file":"systems.js","sourceRoot":"","sources":["../../src/resources/systems/systems.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,mEAA0C;AAC1C,4CAA0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,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
|
|
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
|
-
*
|
|
14
|
-
*
|
|
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
|
-
*
|
|
91
|
-
* '
|
|
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,
|
|
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,EAAsC,QAAQ,EAAE;OAEhD,EAAe,iBAAiB,EAAg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