scorecard-ai 1.0.0-alpha.6 → 1.0.0-alpha.7
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/README.md +15 -5
- package/client.d.mts +9 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -2
- package/client.d.ts.map +1 -1
- package/client.js +20 -0
- package/client.js.map +1 -1
- package/client.mjs +20 -0
- package/client.mjs.map +1 -1
- package/internal/headers.js +1 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/to-file.d.mts +0 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts +0 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.js +3 -2
- package/internal/to-file.js.map +1 -1
- package/internal/to-file.mjs +3 -2
- package/internal/to-file.mjs.map +1 -1
- package/internal/uploads.d.mts +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js +14 -4
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +12 -3
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/uuid.d.mts +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +1 -2
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +1 -2
- package/internal/utils/uuid.mjs.map +1 -1
- package/package.json +1 -5
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/projects.d.mts +39 -4
- package/resources/projects.d.mts.map +1 -1
- package/resources/projects.d.ts +39 -4
- package/resources/projects.d.ts.map +1 -1
- package/resources/projects.js +23 -4
- package/resources/projects.js.map +1 -1
- package/resources/projects.mjs +23 -4
- package/resources/projects.mjs.map +1 -1
- package/resources/records.d.mts +10 -0
- package/resources/records.d.mts.map +1 -1
- package/resources/records.d.ts +10 -0
- package/resources/records.d.ts.map +1 -1
- package/resources/records.js +10 -0
- package/resources/records.js.map +1 -1
- package/resources/records.mjs +10 -0
- package/resources/records.mjs.map +1 -1
- package/resources/runs.d.mts +16 -0
- package/resources/runs.d.mts.map +1 -1
- package/resources/runs.d.ts +16 -0
- package/resources/runs.d.ts.map +1 -1
- package/resources/runs.js +16 -0
- package/resources/runs.js.map +1 -1
- package/resources/runs.mjs +16 -0
- package/resources/runs.mjs.map +1 -1
- package/resources/scores.d.mts +83 -0
- package/resources/scores.d.mts.map +1 -0
- package/resources/scores.d.ts +83 -0
- package/resources/scores.d.ts.map +1 -0
- package/resources/scores.js +35 -0
- package/resources/scores.js.map +1 -0
- package/resources/scores.mjs +31 -0
- package/resources/scores.mjs.map +1 -0
- package/resources/system-configs.d.mts +33 -0
- package/resources/system-configs.d.mts.map +1 -1
- package/resources/system-configs.d.ts +33 -0
- package/resources/system-configs.d.ts.map +1 -1
- package/resources/system-configs.js +33 -0
- package/resources/system-configs.js.map +1 -1
- package/resources/system-configs.mjs +33 -0
- package/resources/system-configs.mjs.map +1 -1
- package/resources/systems.d.mts +73 -0
- package/resources/systems.d.mts.map +1 -1
- package/resources/systems.d.ts +73 -0
- package/resources/systems.d.ts.map +1 -1
- package/resources/systems.js +73 -0
- package/resources/systems.js.map +1 -1
- package/resources/systems.mjs +73 -0
- package/resources/systems.mjs.map +1 -1
- package/resources/testcases.d.mts +62 -0
- package/resources/testcases.d.mts.map +1 -1
- package/resources/testcases.d.ts +62 -0
- package/resources/testcases.d.ts.map +1 -1
- package/resources/testcases.js +62 -0
- package/resources/testcases.js.map +1 -1
- package/resources/testcases.mjs +62 -0
- package/resources/testcases.mjs.map +1 -1
- package/resources/testsets.d.mts +48 -0
- package/resources/testsets.d.mts.map +1 -1
- package/resources/testsets.d.ts +48 -0
- package/resources/testsets.d.ts.map +1 -1
- package/resources/testsets.js +48 -0
- package/resources/testsets.js.map +1 -1
- package/resources/testsets.mjs +48 -0
- package/resources/testsets.mjs.map +1 -1
- package/src/client.ts +29 -4
- package/src/internal/headers.ts +1 -1
- package/src/internal/to-file.ts +4 -2
- package/src/internal/uploads.ts +16 -4
- package/src/internal/utils/uuid.ts +1 -3
- package/src/resources/index.ts +4 -2
- package/src/resources/projects.ts +48 -9
- package/src/resources/records.ts +10 -0
- package/src/resources/runs.ts +16 -0
- package/src/resources/scores.ts +98 -0
- package/src/resources/system-configs.ts +33 -0
- package/src/resources/systems.ts +73 -0
- package/src/resources/testcases.ts +62 -0
- package/src/resources/testsets.ts +48 -0
- 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
- package/internal/shims/crypto.d.mts +0 -13
- package/internal/shims/crypto.d.mts.map +0 -1
- package/internal/shims/crypto.d.ts +0 -13
- package/internal/shims/crypto.d.ts.map +0 -1
- package/internal/shims/crypto.js +0 -13
- package/internal/shims/crypto.js.map +0 -1
- package/internal/shims/crypto.mjs +0 -9
- package/internal/shims/crypto.mjs.map +0 -1
- package/internal/shims/file.d.mts +0 -22
- package/internal/shims/file.d.mts.map +0 -1
- package/internal/shims/file.d.ts +0 -22
- package/internal/shims/file.d.ts.map +0 -1
- package/internal/shims/file.js +0 -16
- package/internal/shims/file.js.map +0 -1
- package/internal/shims/file.mjs +0 -12
- package/internal/shims/file.mjs.map +0 -1
- package/internal/shims/getBuiltinModule.d.mts +0 -11
- package/internal/shims/getBuiltinModule.d.mts.map +0 -1
- package/internal/shims/getBuiltinModule.d.ts +0 -11
- package/internal/shims/getBuiltinModule.d.ts.map +0 -1
- package/internal/shims/getBuiltinModule.js +0 -71
- package/internal/shims/getBuiltinModule.js.map +0 -1
- package/internal/shims/getBuiltinModule.mjs +0 -67
- package/internal/shims/getBuiltinModule.mjs.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.js +0 -5
- package/internal/shims/nullGetBuiltinModule.js.map +0 -1
- package/internal/shims/nullGetBuiltinModule.mjs +0 -2
- package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
- package/src/internal/shims/crypto.ts +0 -18
- package/src/internal/shims/file.ts +0 -32
- package/src/internal/shims/getBuiltinModule.ts +0 -66
- package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
package/resources/projects.js
CHANGED
|
@@ -5,15 +5,34 @@ exports.Projects = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
const pagination_1 = require("../core/pagination.js");
|
|
7
7
|
class Projects extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new Project.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const project = await client.projects.create({
|
|
14
|
+
* description: 'This is a test project',
|
|
15
|
+
* name: 'My Project',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
create(body, options) {
|
|
20
|
+
return this._client.post('/projects', { body, ...options });
|
|
21
|
+
}
|
|
8
22
|
/**
|
|
9
23
|
* Retrieve a paginated list of all Projects. Projects are ordered by creation
|
|
10
24
|
* date, with oldest Projects first.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* // Automatically fetches more pages as needed.
|
|
29
|
+
* for await (const project of client.projects.list()) {
|
|
30
|
+
* // ...
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
11
33
|
*/
|
|
12
34
|
list(query = {}, options) {
|
|
13
|
-
return this._client.getAPIList('/projects', (pagination_1.PaginatedResponse), {
|
|
14
|
-
query,
|
|
15
|
-
...options,
|
|
16
|
-
});
|
|
35
|
+
return this._client.getAPIList('/projects', (pagination_1.PaginatedResponse), { query, ...options });
|
|
17
36
|
}
|
|
18
37
|
}
|
|
19
38
|
exports.Projects = Projects;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAkG;AAGlG,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,8BAA0B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;CACF;AAlCD,4BAkCC"}
|
package/resources/projects.mjs
CHANGED
|
@@ -2,15 +2,34 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { PaginatedResponse } from "../core/pagination.mjs";
|
|
4
4
|
export class Projects extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a new Project.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const project = await client.projects.create({
|
|
11
|
+
* description: 'This is a test project',
|
|
12
|
+
* name: 'My Project',
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
create(body, options) {
|
|
17
|
+
return this._client.post('/projects', { body, ...options });
|
|
18
|
+
}
|
|
5
19
|
/**
|
|
6
20
|
* Retrieve a paginated list of all Projects. Projects are ordered by creation
|
|
7
21
|
* date, with oldest Projects first.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* // Automatically fetches more pages as needed.
|
|
26
|
+
* for await (const project of client.projects.list()) {
|
|
27
|
+
* // ...
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
8
30
|
*/
|
|
9
31
|
list(query = {}, options) {
|
|
10
|
-
return this._client.getAPIList('/projects', (PaginatedResponse), {
|
|
11
|
-
query,
|
|
12
|
-
...options,
|
|
13
|
-
});
|
|
32
|
+
return this._client.getAPIList('/projects', (PaginatedResponse), { query, ...options });
|
|
14
33
|
}
|
|
15
34
|
}
|
|
16
35
|
//# sourceMappingURL=projects.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.mjs","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"projects.mjs","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAe,iBAAiB,EAAgC;AAGvE,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,iBAA0B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;CACF"}
|
package/resources/records.d.mts
CHANGED
|
@@ -5,6 +5,16 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
5
5
|
export declare class Records extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* Create a new Record in a Run.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const record = await client.records.create('135', {
|
|
12
|
+
* inputs: { question: 'What is the capital of France?' },
|
|
13
|
+
* labels: { idealAnswer: 'Paris is the capital of France' },
|
|
14
|
+
* outputs: { response: 'The capital of France is Paris.' },
|
|
15
|
+
* testcaseId: '248',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
8
18
|
*/
|
|
9
19
|
create(runID: string, body: RecordCreateParams, options?: RequestOptions): APIPromise<Record>;
|
|
10
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.mts","sourceRoot":"","sources":["../src/resources/records.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,MAAM,IAAI,aAAa,EAAE;OAChC,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"records.d.mts","sourceRoot":"","sources":["../src/resources/records.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,MAAM,IAAI,aAAa,EAAE;OAChC,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAG9F;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAExC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAExC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EAAE,KAAK,MAAM,IAAI,MAAM,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;CACjF"}
|
package/resources/records.d.ts
CHANGED
|
@@ -5,6 +5,16 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
5
5
|
export declare class Records extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* Create a new Record in a Run.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const record = await client.records.create('135', {
|
|
12
|
+
* inputs: { question: 'What is the capital of France?' },
|
|
13
|
+
* labels: { idealAnswer: 'Paris is the capital of France' },
|
|
14
|
+
* outputs: { response: 'The capital of France is Paris.' },
|
|
15
|
+
* testcaseId: '248',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
8
18
|
*/
|
|
9
19
|
create(runID: string, body: RecordCreateParams, options?: RequestOptions): APIPromise<Record>;
|
|
10
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../src/resources/records.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,MAAM,IAAI,aAAa,EAAE;OAChC,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../src/resources/records.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,MAAM,IAAI,aAAa,EAAE;OAChC,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAG9F;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAExC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAExC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EAAE,KAAK,MAAM,IAAI,MAAM,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;CACjF"}
|
package/resources/records.js
CHANGED
|
@@ -7,6 +7,16 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
7
7
|
class Records extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Create a new Record in a Run.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const record = await client.records.create('135', {
|
|
14
|
+
* inputs: { question: 'What is the capital of France?' },
|
|
15
|
+
* labels: { idealAnswer: 'Paris is the capital of France' },
|
|
16
|
+
* outputs: { response: 'The capital of France is Paris.' },
|
|
17
|
+
* testcaseId: '248',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
10
20
|
*/
|
|
11
21
|
create(runID, body, options) {
|
|
12
22
|
return this._client.post((0, path_1.path) `/runs/${runID}/records`, { body, ...options });
|
package/resources/records.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.js","sourceRoot":"","sources":["../src/resources/records.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC
|
|
1
|
+
{"version":3,"file":"records.js","sourceRoot":"","sources":["../src/resources/records.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,KAAa,EAAE,IAAwB,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,SAAS,KAAK,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAjBD,0BAiBC"}
|
package/resources/records.mjs
CHANGED
|
@@ -4,6 +4,16 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
4
4
|
export class Records extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new Record in a Run.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const record = await client.records.create('135', {
|
|
11
|
+
* inputs: { question: 'What is the capital of France?' },
|
|
12
|
+
* labels: { idealAnswer: 'Paris is the capital of France' },
|
|
13
|
+
* outputs: { response: 'The capital of France is Paris.' },
|
|
14
|
+
* testcaseId: '248',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
7
17
|
*/
|
|
8
18
|
create(runID, body, options) {
|
|
9
19
|
return this._client.post(path `/runs/${runID}/records`, { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.mjs","sourceRoot":"","sources":["../src/resources/records.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"records.mjs","sourceRoot":"","sources":["../src/resources/records.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,KAAa,EAAE,IAAwB,EAAE,OAAwB;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,SAAS,KAAK,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
|
package/resources/runs.d.mts
CHANGED
|
@@ -4,10 +4,26 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
4
4
|
export declare class Runs extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new Run.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const run = await client.runs.create('314', {
|
|
11
|
+
* metricIds: ['789', '101'],
|
|
12
|
+
* testsetId: '246',
|
|
13
|
+
* systemConfigId: '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
7
16
|
*/
|
|
8
17
|
create(projectID: string, body: RunCreateParams, options?: RequestOptions): APIPromise<Run>;
|
|
9
18
|
/**
|
|
10
19
|
* Update the status of a Run.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const run = await client.runs.update('135', {
|
|
24
|
+
* status: 'awaiting_scoring',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
11
27
|
*/
|
|
12
28
|
update(runID: string, body: RunUpdateParams, options?: RequestOptions): APIPromise<RunUpdateResponse>;
|
|
13
29
|
}
|
package/resources/runs.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.mts","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC
|
|
1
|
+
{"version":3,"file":"runs.d.mts","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC;IAI3F;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAGtG;AAED;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzB;;OAEG;IACH,MAAM,EACF,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,GACxB,WAAW,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EACF,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,GACxB,WAAW,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EACF,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,GACxB,WAAW,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,GAAG,IAAI,GAAG,EACf,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
package/resources/runs.d.ts
CHANGED
|
@@ -4,10 +4,26 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
4
4
|
export declare class Runs extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new Run.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const run = await client.runs.create('314', {
|
|
11
|
+
* metricIds: ['789', '101'],
|
|
12
|
+
* testsetId: '246',
|
|
13
|
+
* systemConfigId: '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
7
16
|
*/
|
|
8
17
|
create(projectID: string, body: RunCreateParams, options?: RequestOptions): APIPromise<Run>;
|
|
9
18
|
/**
|
|
10
19
|
* Update the status of a Run.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const run = await client.runs.update('135', {
|
|
24
|
+
* status: 'awaiting_scoring',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
11
27
|
*/
|
|
12
28
|
update(runID: string, body: RunUpdateParams, options?: RequestOptions): APIPromise<RunUpdateResponse>;
|
|
13
29
|
}
|
package/resources/runs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC;IAI3F;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;CAGtG;AAED;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzB;;OAEG;IACH,MAAM,EACF,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,GACxB,WAAW,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EACF,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,GACxB,WAAW,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EACF,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,GACxB,WAAW,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,GAAG,IAAI,GAAG,EACf,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
package/resources/runs.js
CHANGED
|
@@ -7,12 +7,28 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
7
7
|
class Runs extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Create a new Run.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const run = await client.runs.create('314', {
|
|
14
|
+
* metricIds: ['789', '101'],
|
|
15
|
+
* testsetId: '246',
|
|
16
|
+
* systemConfigId: '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
10
19
|
*/
|
|
11
20
|
create(projectID, body, options) {
|
|
12
21
|
return this._client.post((0, path_1.path) `/projects/${projectID}/runs`, { body, ...options });
|
|
13
22
|
}
|
|
14
23
|
/**
|
|
15
24
|
* Update the status of a Run.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const run = await client.runs.update('135', {
|
|
29
|
+
* status: 'awaiting_scoring',
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
16
32
|
*/
|
|
17
33
|
update(runID, body, options) {
|
|
18
34
|
return this._client.patch((0, path_1.path) `/runs/${runID}`, { body, ...options });
|
package/resources/runs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,IAAK,SAAQ,sBAAW;IACnC
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAqB,EAAE,OAAwB;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAa,EAAE,IAAqB,EAAE,OAAwB;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,SAAS,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF;AA9BD,oBA8BC"}
|
package/resources/runs.mjs
CHANGED
|
@@ -4,12 +4,28 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
4
4
|
export class Runs extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new Run.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const run = await client.runs.create('314', {
|
|
11
|
+
* metricIds: ['789', '101'],
|
|
12
|
+
* testsetId: '246',
|
|
13
|
+
* systemConfigId: '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
7
16
|
*/
|
|
8
17
|
create(projectID, body, options) {
|
|
9
18
|
return this._client.post(path `/projects/${projectID}/runs`, { body, ...options });
|
|
10
19
|
}
|
|
11
20
|
/**
|
|
12
21
|
* Update the status of a Run.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const run = await client.runs.update('135', {
|
|
26
|
+
* status: 'awaiting_scoring',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
13
29
|
*/
|
|
14
30
|
update(runID, body, options) {
|
|
15
31
|
return this._client.patch(path `/runs/${runID}`, { body, ...options });
|
package/resources/runs.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.mjs","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC
|
|
1
|
+
{"version":3,"file":"runs.mjs","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAqB,EAAE,OAAwB;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAa,EAAE,IAAqB,EAAE,OAAwB;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,SAAS,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
export declare class Scores extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create or update a Score for a given Record and MetricConfig. If a Score with
|
|
7
|
+
* the specified Record ID and MetricConfig ID already exists, it will be updated.
|
|
8
|
+
* Otherwise, a new Score will be created. The score provided should conform to the
|
|
9
|
+
* schema defined by the MetricConfig; otherwise, validation errors will be
|
|
10
|
+
* reported.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const score = await client.scores.upsert(
|
|
15
|
+
* 'a1b2c3d4-e5f6-7890-1234-567890abcdef',
|
|
16
|
+
* {
|
|
17
|
+
* recordId: '777',
|
|
18
|
+
* score: {
|
|
19
|
+
* value: true,
|
|
20
|
+
* reasoning: 'The response is correct',
|
|
21
|
+
* },
|
|
22
|
+
* },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
upsert(metricConfigID: string, params: ScoreUpsertParams, options?: RequestOptions): APIPromise<Score>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A Score represents the evaluation of a Record against a specific MetricConfig.
|
|
30
|
+
* The actual `score` is stored as flexible JSON. While any JSON is accepted, it is
|
|
31
|
+
* expected to conform to the output schema defined by the MetricConfig. Any
|
|
32
|
+
* discrepancies will be noted in the `validationErrors` field, but the Score will
|
|
33
|
+
* still be stored.
|
|
34
|
+
*/
|
|
35
|
+
export interface Score {
|
|
36
|
+
/**
|
|
37
|
+
* The ID of the MetricConfig this Score is for.
|
|
38
|
+
*/
|
|
39
|
+
metricConfigId: string;
|
|
40
|
+
/**
|
|
41
|
+
* The ID of the Record this Score is for.
|
|
42
|
+
*/
|
|
43
|
+
recordId: string;
|
|
44
|
+
/**
|
|
45
|
+
* The score of the Record, as arbitrary JSON. This data should ideally conform to
|
|
46
|
+
* the output schema defined by the associated MetricConfig. If it doesn't,
|
|
47
|
+
* validation errors will be captured in the `validationErrors` field.
|
|
48
|
+
*/
|
|
49
|
+
score: Record<string, unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* Validation errors found in the Score data. If present, the Score doesn't fully
|
|
52
|
+
* conform to its MetricConfig's schema.
|
|
53
|
+
*/
|
|
54
|
+
validationErrors?: Array<Score.ValidationError>;
|
|
55
|
+
}
|
|
56
|
+
export declare namespace Score {
|
|
57
|
+
interface ValidationError {
|
|
58
|
+
/**
|
|
59
|
+
* Human-readable error description.
|
|
60
|
+
*/
|
|
61
|
+
message: string;
|
|
62
|
+
/**
|
|
63
|
+
* JSON Pointer to the field with the validation error.
|
|
64
|
+
*/
|
|
65
|
+
path: string;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export interface ScoreUpsertParams {
|
|
69
|
+
/**
|
|
70
|
+
* Path param: The ID of the Record.
|
|
71
|
+
*/
|
|
72
|
+
recordId: string;
|
|
73
|
+
/**
|
|
74
|
+
* Body param: The score of the Record, as arbitrary JSON. This data should ideally
|
|
75
|
+
* conform to the output schema defined by the associated MetricConfig. If it
|
|
76
|
+
* doesn't, validation errors will be captured in the `validationErrors` field.
|
|
77
|
+
*/
|
|
78
|
+
score: Record<string, unknown>;
|
|
79
|
+
}
|
|
80
|
+
export declare namespace Scores {
|
|
81
|
+
export { type Score as Score, type ScoreUpsertParams as ScoreUpsertParams };
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=scores.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scores.d.mts","sourceRoot":"","sources":["../src/resources/scores.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;CAIvG;AAED;;;;;;GAMG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;CACjD;AAED,yBAAiB,KAAK,CAAC;IACrB,UAAiB,eAAe;QAC9B;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,KAAK,IAAI,KAAK,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CAC7E"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class Scores extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create or update a Score for a given Record and MetricConfig. If a Score with
|
|
7
|
+
* the specified Record ID and MetricConfig ID already exists, it will be updated.
|
|
8
|
+
* Otherwise, a new Score will be created. The score provided should conform to the
|
|
9
|
+
* schema defined by the MetricConfig; otherwise, validation errors will be
|
|
10
|
+
* reported.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const score = await client.scores.upsert(
|
|
15
|
+
* 'a1b2c3d4-e5f6-7890-1234-567890abcdef',
|
|
16
|
+
* {
|
|
17
|
+
* recordId: '777',
|
|
18
|
+
* score: {
|
|
19
|
+
* value: true,
|
|
20
|
+
* reasoning: 'The response is correct',
|
|
21
|
+
* },
|
|
22
|
+
* },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
upsert(metricConfigID: string, params: ScoreUpsertParams, options?: RequestOptions): APIPromise<Score>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A Score represents the evaluation of a Record against a specific MetricConfig.
|
|
30
|
+
* The actual `score` is stored as flexible JSON. While any JSON is accepted, it is
|
|
31
|
+
* expected to conform to the output schema defined by the MetricConfig. Any
|
|
32
|
+
* discrepancies will be noted in the `validationErrors` field, but the Score will
|
|
33
|
+
* still be stored.
|
|
34
|
+
*/
|
|
35
|
+
export interface Score {
|
|
36
|
+
/**
|
|
37
|
+
* The ID of the MetricConfig this Score is for.
|
|
38
|
+
*/
|
|
39
|
+
metricConfigId: string;
|
|
40
|
+
/**
|
|
41
|
+
* The ID of the Record this Score is for.
|
|
42
|
+
*/
|
|
43
|
+
recordId: string;
|
|
44
|
+
/**
|
|
45
|
+
* The score of the Record, as arbitrary JSON. This data should ideally conform to
|
|
46
|
+
* the output schema defined by the associated MetricConfig. If it doesn't,
|
|
47
|
+
* validation errors will be captured in the `validationErrors` field.
|
|
48
|
+
*/
|
|
49
|
+
score: Record<string, unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* Validation errors found in the Score data. If present, the Score doesn't fully
|
|
52
|
+
* conform to its MetricConfig's schema.
|
|
53
|
+
*/
|
|
54
|
+
validationErrors?: Array<Score.ValidationError>;
|
|
55
|
+
}
|
|
56
|
+
export declare namespace Score {
|
|
57
|
+
interface ValidationError {
|
|
58
|
+
/**
|
|
59
|
+
* Human-readable error description.
|
|
60
|
+
*/
|
|
61
|
+
message: string;
|
|
62
|
+
/**
|
|
63
|
+
* JSON Pointer to the field with the validation error.
|
|
64
|
+
*/
|
|
65
|
+
path: string;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export interface ScoreUpsertParams {
|
|
69
|
+
/**
|
|
70
|
+
* Path param: The ID of the Record.
|
|
71
|
+
*/
|
|
72
|
+
recordId: string;
|
|
73
|
+
/**
|
|
74
|
+
* Body param: The score of the Record, as arbitrary JSON. This data should ideally
|
|
75
|
+
* conform to the output schema defined by the associated MetricConfig. If it
|
|
76
|
+
* doesn't, validation errors will be captured in the `validationErrors` field.
|
|
77
|
+
*/
|
|
78
|
+
score: Record<string, unknown>;
|
|
79
|
+
}
|
|
80
|
+
export declare namespace Scores {
|
|
81
|
+
export { type Score as Score, type ScoreUpsertParams as ScoreUpsertParams };
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=scores.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scores.d.ts","sourceRoot":"","sources":["../src/resources/scores.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;CAIvG;AAED;;;;;;GAMG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;CACjD;AAED,yBAAiB,KAAK,CAAC;IACrB,UAAiB,eAAe;QAC9B;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,KAAK,IAAI,KAAK,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CAC7E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Scores = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const path_1 = require("../internal/utils/path.js");
|
|
7
|
+
class Scores extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create or update a Score for a given Record and MetricConfig. If a Score with
|
|
10
|
+
* the specified Record ID and MetricConfig ID already exists, it will be updated.
|
|
11
|
+
* Otherwise, a new Score will be created. The score provided should conform to the
|
|
12
|
+
* schema defined by the MetricConfig; otherwise, validation errors will be
|
|
13
|
+
* reported.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const score = await client.scores.upsert(
|
|
18
|
+
* 'a1b2c3d4-e5f6-7890-1234-567890abcdef',
|
|
19
|
+
* {
|
|
20
|
+
* recordId: '777',
|
|
21
|
+
* score: {
|
|
22
|
+
* value: true,
|
|
23
|
+
* reasoning: 'The response is correct',
|
|
24
|
+
* },
|
|
25
|
+
* },
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
upsert(metricConfigID, params, options) {
|
|
30
|
+
const { recordId, ...body } = params;
|
|
31
|
+
return this._client.put((0, path_1.path) `/records/${recordId}/scores/${metricConfigID}`, { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.Scores = Scores;
|
|
35
|
+
//# sourceMappingURL=scores.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scores.js","sourceRoot":"","sources":["../src/resources/scores.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAsB,EAAE,MAAyB,EAAE,OAAwB;QAChF,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,YAAY,QAAQ,WAAW,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;CACF;AA1BD,wBA0BC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { path } from "../internal/utils/path.mjs";
|
|
4
|
+
export class Scores extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create or update a Score for a given Record and MetricConfig. If a Score with
|
|
7
|
+
* the specified Record ID and MetricConfig ID already exists, it will be updated.
|
|
8
|
+
* Otherwise, a new Score will be created. The score provided should conform to the
|
|
9
|
+
* schema defined by the MetricConfig; otherwise, validation errors will be
|
|
10
|
+
* reported.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const score = await client.scores.upsert(
|
|
15
|
+
* 'a1b2c3d4-e5f6-7890-1234-567890abcdef',
|
|
16
|
+
* {
|
|
17
|
+
* recordId: '777',
|
|
18
|
+
* score: {
|
|
19
|
+
* value: true,
|
|
20
|
+
* reasoning: 'The response is correct',
|
|
21
|
+
* },
|
|
22
|
+
* },
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
upsert(metricConfigID, params, options) {
|
|
27
|
+
const { recordId, ...body } = params;
|
|
28
|
+
return this._client.put(path `/records/${recordId}/scores/${metricConfigID}`, { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=scores.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scores.mjs","sourceRoot":"","sources":["../src/resources/scores.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAsB,EAAE,MAAyB,EAAE,OAAwB;QAChF,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,QAAQ,WAAW,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;CACF"}
|
|
@@ -19,6 +19,21 @@ export declare class SystemConfigs extends APIResource {
|
|
|
19
19
|
* - Validation errors indicate fields that don't match the schema but don't
|
|
20
20
|
* prevent creation
|
|
21
21
|
* - Having validation errors may affect how some evaluation metrics are calculated
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const systemConfig = await client.systemConfigs.create(
|
|
26
|
+
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
27
|
+
* {
|
|
28
|
+
* config: {
|
|
29
|
+
* temperature: 0.1,
|
|
30
|
+
* maxTokens: 1024,
|
|
31
|
+
* model: 'gpt-4-turbo',
|
|
32
|
+
* },
|
|
33
|
+
* name: 'Production (Low Temperature)',
|
|
34
|
+
* },
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
22
37
|
*/
|
|
23
38
|
create(systemID: string, body: SystemConfigCreateParams, options?: RequestOptions): APIPromise<SystemConfig>;
|
|
24
39
|
/**
|
|
@@ -26,10 +41,28 @@ export declare class SystemConfigs extends APIResource {
|
|
|
26
41
|
*
|
|
27
42
|
* System configurations provide concrete parameter values for a System Under Test,
|
|
28
43
|
* defining exactly how the system should be configured during an evaluation run.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Automatically fetches more pages as needed.
|
|
48
|
+
* for await (const systemConfig of client.systemConfigs.list(
|
|
49
|
+
* '12345678-0a8b-4f66-b6f3-2ddcfa097257',
|
|
50
|
+
* )) {
|
|
51
|
+
* // ...
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
29
54
|
*/
|
|
30
55
|
list(systemID: string, query?: SystemConfigListParams | null | undefined, options?: RequestOptions): PagePromise<SystemConfigsPaginatedResponse, SystemConfig>;
|
|
31
56
|
/**
|
|
32
57
|
* Retrieve a specific system configuration by ID.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const systemConfig = await client.systemConfigs.get(
|
|
62
|
+
* '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
|
|
63
|
+
* { systemId: '12345678-0a8b-4f66-b6f3-2ddcfa097257' },
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
33
66
|
*/
|
|
34
67
|
get(systemConfigID: string, params: SystemConfigGetParams, options?: RequestOptions): APIPromise<SystemConfig>;
|
|
35
68
|
}
|