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,72 +1,42 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
-
import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.mjs";
|
|
4
3
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
4
|
export declare class Versions extends APIResource {
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Each version contains specific parameter values that match the system's
|
|
10
|
-
* `configSchema` - things like model parameters, thresholds, or processing
|
|
11
|
-
* options. Once created, versions cannot be modified, ensuring stable reference
|
|
12
|
-
* points for evaluations.
|
|
13
|
-
*
|
|
14
|
-
* When creating a system version:
|
|
15
|
-
*
|
|
16
|
-
* - The `config` object is validated against the parent system's `configSchema`.
|
|
17
|
-
* - System versions with validation errors are still stored, with errors included
|
|
18
|
-
* in the response.
|
|
19
|
-
* - Validation errors indicate fields that don't match the schema but don't
|
|
20
|
-
* prevent creation.
|
|
21
|
-
* - Having validation errors may affect how some evaluation metrics are
|
|
22
|
-
* calculated.
|
|
6
|
+
* Retrieve a specific system version by ID.
|
|
23
7
|
*
|
|
24
8
|
* @example
|
|
25
9
|
* ```ts
|
|
26
|
-
* const systemVersion = await client.systems.versions.
|
|
27
|
-
* '
|
|
28
|
-
* {
|
|
29
|
-
* config: {
|
|
30
|
-
* temperature: 0.1,
|
|
31
|
-
* maxTokens: 1024,
|
|
32
|
-
* model: 'gpt-4-turbo',
|
|
33
|
-
* },
|
|
34
|
-
* name: 'Production (Low Temperature)',
|
|
35
|
-
* },
|
|
10
|
+
* const systemVersion = await client.systems.versions.get(
|
|
11
|
+
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
36
12
|
* );
|
|
37
13
|
* ```
|
|
38
14
|
*/
|
|
39
|
-
|
|
15
|
+
get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion>;
|
|
40
16
|
/**
|
|
41
|
-
*
|
|
17
|
+
* Create a new system version if it does not already exist. Does **not** set the
|
|
18
|
+
* created version to be the system's production version.
|
|
42
19
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
20
|
+
* If there is already a system version with the same config, its name will be
|
|
21
|
+
* updated.
|
|
45
22
|
*
|
|
46
23
|
* @example
|
|
47
24
|
* ```ts
|
|
48
|
-
*
|
|
49
|
-
* for await (const systemVersion of client.systems.versions.list(
|
|
25
|
+
* const systemVersion = await client.systems.versions.upsert(
|
|
50
26
|
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* const systemVersion = await client.systems.versions.get(
|
|
63
|
-
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
27
|
+
* {
|
|
28
|
+
* config: {
|
|
29
|
+
* temperature: 0.5,
|
|
30
|
+
* maxTokens: 1024,
|
|
31
|
+
* model: 'gemini-2.0-flash',
|
|
32
|
+
* },
|
|
33
|
+
* name: 'Test model: Gemini',
|
|
34
|
+
* },
|
|
64
35
|
* );
|
|
65
36
|
* ```
|
|
66
37
|
*/
|
|
67
|
-
|
|
38
|
+
upsert(systemID: string, body: VersionUpsertParams, options?: RequestOptions): APIPromise<SystemVersion>;
|
|
68
39
|
}
|
|
69
|
-
export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
|
|
70
40
|
/**
|
|
71
41
|
* A SystemVersion defines the specific settings for a System Under Test.
|
|
72
42
|
*
|
|
@@ -75,9 +45,6 @@ export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
|
|
|
75
45
|
*
|
|
76
46
|
* When running evaluations, you reference a specific systemVersionId to establish
|
|
77
47
|
* which system version to test.
|
|
78
|
-
*
|
|
79
|
-
* System versions will be validated against the system's configSchema, with
|
|
80
|
-
* non-conforming values generating warnings.
|
|
81
48
|
*/
|
|
82
49
|
export interface SystemVersion {
|
|
83
50
|
/**
|
|
@@ -96,37 +63,19 @@ export interface SystemVersion {
|
|
|
96
63
|
* The ID of the system the system version belongs to.
|
|
97
64
|
*/
|
|
98
65
|
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
66
|
}
|
|
105
|
-
export
|
|
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 {
|
|
67
|
+
export interface VersionUpsertParams {
|
|
118
68
|
/**
|
|
119
69
|
* The configuration of the system version.
|
|
120
70
|
*/
|
|
121
71
|
config: Record<string, unknown>;
|
|
122
72
|
/**
|
|
123
|
-
* The name of the system version.
|
|
73
|
+
* The name of the system version. If creating a new system version and the name
|
|
74
|
+
* isn't provided, it will be autogenerated.
|
|
124
75
|
*/
|
|
125
|
-
name
|
|
126
|
-
}
|
|
127
|
-
export interface VersionListParams extends PaginatedResponseParams {
|
|
76
|
+
name?: string;
|
|
128
77
|
}
|
|
129
78
|
export declare namespace Versions {
|
|
130
|
-
export { type SystemVersion as SystemVersion, type
|
|
79
|
+
export { type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams };
|
|
131
80
|
}
|
|
132
81
|
//# sourceMappingURL=versions.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,
|
|
1
|
+
{"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIjF;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAGzG;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACjG"}
|
|
@@ -1,72 +1,42 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
-
import { PagePromise, PaginatedResponse, type PaginatedResponseParams } from "../../core/pagination.js";
|
|
4
3
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
4
|
export declare class Versions extends APIResource {
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Each version contains specific parameter values that match the system's
|
|
10
|
-
* `configSchema` - things like model parameters, thresholds, or processing
|
|
11
|
-
* options. Once created, versions cannot be modified, ensuring stable reference
|
|
12
|
-
* points for evaluations.
|
|
13
|
-
*
|
|
14
|
-
* When creating a system version:
|
|
15
|
-
*
|
|
16
|
-
* - The `config` object is validated against the parent system's `configSchema`.
|
|
17
|
-
* - System versions with validation errors are still stored, with errors included
|
|
18
|
-
* in the response.
|
|
19
|
-
* - Validation errors indicate fields that don't match the schema but don't
|
|
20
|
-
* prevent creation.
|
|
21
|
-
* - Having validation errors may affect how some evaluation metrics are
|
|
22
|
-
* calculated.
|
|
6
|
+
* Retrieve a specific system version by ID.
|
|
23
7
|
*
|
|
24
8
|
* @example
|
|
25
9
|
* ```ts
|
|
26
|
-
* const systemVersion = await client.systems.versions.
|
|
27
|
-
* '
|
|
28
|
-
* {
|
|
29
|
-
* config: {
|
|
30
|
-
* temperature: 0.1,
|
|
31
|
-
* maxTokens: 1024,
|
|
32
|
-
* model: 'gpt-4-turbo',
|
|
33
|
-
* },
|
|
34
|
-
* name: 'Production (Low Temperature)',
|
|
35
|
-
* },
|
|
10
|
+
* const systemVersion = await client.systems.versions.get(
|
|
11
|
+
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
36
12
|
* );
|
|
37
13
|
* ```
|
|
38
14
|
*/
|
|
39
|
-
|
|
15
|
+
get(systemVersionID: string, options?: RequestOptions): APIPromise<SystemVersion>;
|
|
40
16
|
/**
|
|
41
|
-
*
|
|
17
|
+
* Create a new system version if it does not already exist. Does **not** set the
|
|
18
|
+
* created version to be the system's production version.
|
|
42
19
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
20
|
+
* If there is already a system version with the same config, its name will be
|
|
21
|
+
* updated.
|
|
45
22
|
*
|
|
46
23
|
* @example
|
|
47
24
|
* ```ts
|
|
48
|
-
*
|
|
49
|
-
* for await (const systemVersion of client.systems.versions.list(
|
|
25
|
+
* const systemVersion = await client.systems.versions.upsert(
|
|
50
26
|
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* const systemVersion = await client.systems.versions.get(
|
|
63
|
-
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
27
|
+
* {
|
|
28
|
+
* config: {
|
|
29
|
+
* temperature: 0.5,
|
|
30
|
+
* maxTokens: 1024,
|
|
31
|
+
* model: 'gemini-2.0-flash',
|
|
32
|
+
* },
|
|
33
|
+
* name: 'Test model: Gemini',
|
|
34
|
+
* },
|
|
64
35
|
* );
|
|
65
36
|
* ```
|
|
66
37
|
*/
|
|
67
|
-
|
|
38
|
+
upsert(systemID: string, body: VersionUpsertParams, options?: RequestOptions): APIPromise<SystemVersion>;
|
|
68
39
|
}
|
|
69
|
-
export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
|
|
70
40
|
/**
|
|
71
41
|
* A SystemVersion defines the specific settings for a System Under Test.
|
|
72
42
|
*
|
|
@@ -75,9 +45,6 @@ export type SystemVersionsPaginatedResponse = PaginatedResponse<SystemVersion>;
|
|
|
75
45
|
*
|
|
76
46
|
* When running evaluations, you reference a specific systemVersionId to establish
|
|
77
47
|
* which system version to test.
|
|
78
|
-
*
|
|
79
|
-
* System versions will be validated against the system's configSchema, with
|
|
80
|
-
* non-conforming values generating warnings.
|
|
81
48
|
*/
|
|
82
49
|
export interface SystemVersion {
|
|
83
50
|
/**
|
|
@@ -96,37 +63,19 @@ export interface SystemVersion {
|
|
|
96
63
|
* The ID of the system the system version belongs to.
|
|
97
64
|
*/
|
|
98
65
|
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
66
|
}
|
|
105
|
-
export
|
|
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 {
|
|
67
|
+
export interface VersionUpsertParams {
|
|
118
68
|
/**
|
|
119
69
|
* The configuration of the system version.
|
|
120
70
|
*/
|
|
121
71
|
config: Record<string, unknown>;
|
|
122
72
|
/**
|
|
123
|
-
* The name of the system version.
|
|
73
|
+
* The name of the system version. If creating a new system version and the name
|
|
74
|
+
* isn't provided, it will be autogenerated.
|
|
124
75
|
*/
|
|
125
|
-
name
|
|
126
|
-
}
|
|
127
|
-
export interface VersionListParams extends PaginatedResponseParams {
|
|
76
|
+
name?: string;
|
|
128
77
|
}
|
|
129
78
|
export declare namespace Versions {
|
|
130
|
-
export { type SystemVersion as SystemVersion, type
|
|
79
|
+
export { type SystemVersion as SystemVersion, type VersionUpsertParams as VersionUpsertParams };
|
|
131
80
|
}
|
|
132
81
|
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,
|
|
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,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIjF;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAGzG;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEhC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACjG"}
|
|
@@ -3,79 +3,45 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Versions = void 0;
|
|
5
5
|
const resource_1 = require("../../core/resource.js");
|
|
6
|
-
const pagination_1 = require("../../core/pagination.js");
|
|
7
6
|
const path_1 = require("../../internal/utils/path.js");
|
|
8
7
|
class Versions extends resource_1.APIResource {
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
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.
|
|
9
|
+
* Retrieve a specific system version by ID.
|
|
26
10
|
*
|
|
27
11
|
* @example
|
|
28
12
|
* ```ts
|
|
29
|
-
* const systemVersion = await client.systems.versions.
|
|
30
|
-
* '
|
|
31
|
-
* {
|
|
32
|
-
* config: {
|
|
33
|
-
* temperature: 0.1,
|
|
34
|
-
* maxTokens: 1024,
|
|
35
|
-
* model: 'gpt-4-turbo',
|
|
36
|
-
* },
|
|
37
|
-
* name: 'Production (Low Temperature)',
|
|
38
|
-
* },
|
|
13
|
+
* const systemVersion = await client.systems.versions.get(
|
|
14
|
+
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
39
15
|
* );
|
|
40
16
|
* ```
|
|
41
17
|
*/
|
|
42
|
-
|
|
43
|
-
return this._client.
|
|
18
|
+
get(systemVersionID, options) {
|
|
19
|
+
return this._client.get((0, path_1.path) `/systems/versions/${systemVersionID}`, options);
|
|
44
20
|
}
|
|
45
21
|
/**
|
|
46
|
-
*
|
|
22
|
+
* Create a new system version if it does not already exist. Does **not** set the
|
|
23
|
+
* created version to be the system's production version.
|
|
47
24
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
25
|
+
* If there is already a system version with the same config, its name will be
|
|
26
|
+
* updated.
|
|
50
27
|
*
|
|
51
28
|
* @example
|
|
52
29
|
* ```ts
|
|
53
|
-
*
|
|
54
|
-
* for await (const systemVersion of client.systems.versions.list(
|
|
30
|
+
* const systemVersion = await client.systems.versions.upsert(
|
|
55
31
|
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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',
|
|
32
|
+
* {
|
|
33
|
+
* config: {
|
|
34
|
+
* temperature: 0.5,
|
|
35
|
+
* maxTokens: 1024,
|
|
36
|
+
* model: 'gemini-2.0-flash',
|
|
37
|
+
* },
|
|
38
|
+
* name: 'Test model: Gemini',
|
|
39
|
+
* },
|
|
74
40
|
* );
|
|
75
41
|
* ```
|
|
76
42
|
*/
|
|
77
|
-
|
|
78
|
-
return this._client.
|
|
43
|
+
upsert(systemID, body, options) {
|
|
44
|
+
return this._client.post((0, path_1.path) `/systems/${systemID}/versions`, { body, ...options });
|
|
79
45
|
}
|
|
80
46
|
}
|
|
81
47
|
exports.Versions = Versions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAuB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,eAAe,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAyB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;CACF;AAxCD,4BAwCC"}
|
|
@@ -1,78 +1,44 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
-
import { PaginatedResponse } from "../../core/pagination.mjs";
|
|
4
3
|
import { path } from "../../internal/utils/path.mjs";
|
|
5
4
|
export class Versions extends APIResource {
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Each version contains specific parameter values that match the system's
|
|
10
|
-
* `configSchema` - things like model parameters, thresholds, or processing
|
|
11
|
-
* options. Once created, versions cannot be modified, ensuring stable reference
|
|
12
|
-
* points for evaluations.
|
|
13
|
-
*
|
|
14
|
-
* When creating a system version:
|
|
15
|
-
*
|
|
16
|
-
* - The `config` object is validated against the parent system's `configSchema`.
|
|
17
|
-
* - System versions with validation errors are still stored, with errors included
|
|
18
|
-
* in the response.
|
|
19
|
-
* - Validation errors indicate fields that don't match the schema but don't
|
|
20
|
-
* prevent creation.
|
|
21
|
-
* - Having validation errors may affect how some evaluation metrics are
|
|
22
|
-
* calculated.
|
|
6
|
+
* Retrieve a specific system version by ID.
|
|
23
7
|
*
|
|
24
8
|
* @example
|
|
25
9
|
* ```ts
|
|
26
|
-
* const systemVersion = await client.systems.versions.
|
|
27
|
-
* '
|
|
28
|
-
* {
|
|
29
|
-
* config: {
|
|
30
|
-
* temperature: 0.1,
|
|
31
|
-
* maxTokens: 1024,
|
|
32
|
-
* model: 'gpt-4-turbo',
|
|
33
|
-
* },
|
|
34
|
-
* name: 'Production (Low Temperature)',
|
|
35
|
-
* },
|
|
10
|
+
* const systemVersion = await client.systems.versions.get(
|
|
11
|
+
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
36
12
|
* );
|
|
37
13
|
* ```
|
|
38
14
|
*/
|
|
39
|
-
|
|
40
|
-
return this._client.
|
|
15
|
+
get(systemVersionID, options) {
|
|
16
|
+
return this._client.get(path `/systems/versions/${systemVersionID}`, options);
|
|
41
17
|
}
|
|
42
18
|
/**
|
|
43
|
-
*
|
|
19
|
+
* Create a new system version if it does not already exist. Does **not** set the
|
|
20
|
+
* created version to be the system's production version.
|
|
44
21
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
22
|
+
* If there is already a system version with the same config, its name will be
|
|
23
|
+
* updated.
|
|
47
24
|
*
|
|
48
25
|
* @example
|
|
49
26
|
* ```ts
|
|
50
|
-
*
|
|
51
|
-
* for await (const systemVersion of client.systems.versions.list(
|
|
27
|
+
* const systemVersion = await client.systems.versions.upsert(
|
|
52
28
|
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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',
|
|
29
|
+
* {
|
|
30
|
+
* config: {
|
|
31
|
+
* temperature: 0.5,
|
|
32
|
+
* maxTokens: 1024,
|
|
33
|
+
* model: 'gemini-2.0-flash',
|
|
34
|
+
* },
|
|
35
|
+
* name: 'Test model: Gemini',
|
|
36
|
+
* },
|
|
71
37
|
* );
|
|
72
38
|
* ```
|
|
73
39
|
*/
|
|
74
|
-
|
|
75
|
-
return this._client.
|
|
40
|
+
upsert(systemID, body, options) {
|
|
41
|
+
return this._client.post(path `/systems/${systemID}/versions`, { body, ...options });
|
|
76
42
|
}
|
|
77
43
|
}
|
|
78
44
|
//# sourceMappingURL=versions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.mjs","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"versions.mjs","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAuB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,eAAe,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAyB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,YAAY,QAAQ,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;CACF"}
|