scorecard-ai 0.6.0 → 0.6.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/README.md +9 -9
- package/api/resources/prompt/client/Client.d.ts +27 -8
- package/api/resources/prompt/client/Client.js +126 -15
- package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
- package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +4 -0
- package/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
- package/api/resources/prompt/client/requests/PromptListPromptsRequest.js +5 -0
- package/api/resources/prompt/client/requests/index.d.ts +1 -0
- package/api/resources/run/client/Client.js +3 -3
- package/api/resources/runMetric/client/Client.js +1 -1
- package/api/resources/score/client/Client.js +2 -2
- package/api/resources/scoringConfig/client/Client.d.ts +17 -1
- package/api/resources/scoringConfig/client/Client.js +90 -3
- package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +3 -1
- package/api/resources/testcase/client/Client.d.ts +1 -1
- package/api/resources/testcase/client/Client.js +7 -7
- package/api/resources/testrecord/client/Client.js +2 -2
- package/api/resources/testset/client/Client.d.ts +4 -4
- package/api/resources/testset/client/Client.js +21 -12
- package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +2 -0
- package/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
- package/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
- package/api/resources/testset/client/requests/index.d.ts +1 -0
- package/api/resources/tracing/client/Client.js +3 -3
- package/api/types/Prompt.d.ts +2 -0
- package/api/types/PromptCursorPage.d.ts +17 -0
- package/api/types/PromptCursorPage.js +5 -0
- package/api/types/ScoringConfig.d.ts +2 -0
- package/api/types/Testset.d.ts +2 -0
- package/api/types/TestsetCursorPage.d.ts +17 -0
- package/api/types/TestsetCursorPage.js +5 -0
- package/api/types/index.d.ts +2 -0
- package/api/types/index.js +2 -0
- package/dist/api/resources/prompt/client/Client.d.ts +27 -8
- package/dist/api/resources/prompt/client/Client.js +126 -15
- package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
- package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +4 -0
- package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
- package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.js +5 -0
- package/dist/api/resources/prompt/client/requests/index.d.ts +1 -0
- package/dist/api/resources/run/client/Client.js +3 -3
- package/dist/api/resources/runMetric/client/Client.js +1 -1
- package/dist/api/resources/score/client/Client.js +2 -2
- package/dist/api/resources/scoringConfig/client/Client.d.ts +17 -1
- package/dist/api/resources/scoringConfig/client/Client.js +90 -3
- package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +3 -1
- package/dist/api/resources/testcase/client/Client.d.ts +1 -1
- package/dist/api/resources/testcase/client/Client.js +7 -7
- package/dist/api/resources/testrecord/client/Client.js +2 -2
- package/dist/api/resources/testset/client/Client.d.ts +4 -4
- package/dist/api/resources/testset/client/Client.js +21 -12
- package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +2 -0
- package/dist/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
- package/dist/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
- package/dist/api/resources/testset/client/requests/index.d.ts +1 -0
- package/dist/api/resources/tracing/client/Client.js +3 -3
- package/dist/api/types/Prompt.d.ts +2 -0
- package/dist/api/types/PromptCursorPage.d.ts +17 -0
- package/dist/api/types/PromptCursorPage.js +5 -0
- package/dist/api/types/ScoringConfig.d.ts +2 -0
- package/dist/api/types/Testset.d.ts +2 -0
- package/dist/api/types/TestsetCursorPage.d.ts +17 -0
- package/dist/api/types/TestsetCursorPage.js +5 -0
- package/dist/api/types/index.d.ts +2 -0
- package/dist/api/types/index.js +2 -0
- package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
- package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +1 -0
- package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +1 -0
- package/dist/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
- package/dist/serialization/resources/testcase/client/batchCopy.js +32 -0
- package/dist/serialization/resources/testcase/client/index.d.ts +1 -0
- package/dist/serialization/resources/testcase/client/index.js +14 -0
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +1 -0
- package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +1 -0
- package/dist/serialization/types/Prompt.d.ts +1 -0
- package/dist/serialization/types/Prompt.js +1 -0
- package/dist/serialization/types/PromptCursorPage.d.ts +18 -0
- package/dist/serialization/types/PromptCursorPage.js +39 -0
- package/dist/serialization/types/ScoringConfig.d.ts +1 -0
- package/dist/serialization/types/ScoringConfig.js +1 -0
- package/dist/serialization/types/Testset.d.ts +1 -0
- package/dist/serialization/types/Testset.js +1 -0
- package/dist/serialization/types/TestsetCursorPage.d.ts +18 -0
- package/dist/serialization/types/TestsetCursorPage.js +39 -0
- package/dist/serialization/types/index.d.ts +2 -0
- package/dist/serialization/types/index.js +2 -0
- package/package.json +1 -1
- package/reference.md +140 -11
- package/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
- package/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +1 -0
- package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +1 -0
- package/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
- package/serialization/resources/testcase/client/batchCopy.js +32 -0
- package/serialization/resources/testcase/client/index.d.ts +1 -0
- package/serialization/resources/testcase/client/index.js +14 -0
- package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +1 -0
- package/serialization/resources/testset/client/requests/TestsetCreateParams.js +1 -0
- package/serialization/types/Prompt.d.ts +1 -0
- package/serialization/types/Prompt.js +1 -0
- package/serialization/types/PromptCursorPage.d.ts +18 -0
- package/serialization/types/PromptCursorPage.js +39 -0
- package/serialization/types/ScoringConfig.d.ts +1 -0
- package/serialization/types/ScoringConfig.js +1 -0
- package/serialization/types/Testset.d.ts +1 -0
- package/serialization/types/Testset.js +1 -0
- package/serialization/types/TestsetCursorPage.d.ts +18 -0
- package/serialization/types/TestsetCursorPage.js +39 -0
- package/serialization/types/index.d.ts +2 -0
- package/serialization/types/index.js +2 -0
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
* {
|
|
7
7
|
* name: "Scoring Config Name",
|
|
8
8
|
* description: "Description of the scoring config",
|
|
9
|
-
* metrics: [1, 2, 3]
|
|
9
|
+
* metrics: [1, 2, 3],
|
|
10
|
+
* projectId: 1
|
|
10
11
|
* }
|
|
11
12
|
*/
|
|
12
13
|
export interface ScoringConfigCreateParams {
|
|
13
14
|
name?: string;
|
|
14
15
|
description?: string;
|
|
15
16
|
metrics?: number[];
|
|
17
|
+
projectId?: number;
|
|
16
18
|
}
|
|
@@ -102,7 +102,7 @@ export declare class Testcase {
|
|
|
102
102
|
* @example
|
|
103
103
|
* await client.testcase.batchCopy(1)
|
|
104
104
|
*/
|
|
105
|
-
batchCopy(testsetId: number, request?: Scorecard.TestcaseBatchCopyParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
105
|
+
batchCopy(testsetId: number, request?: Scorecard.TestcaseBatchCopyParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase[]>;
|
|
106
106
|
/**
|
|
107
107
|
* Batch delete Testcases
|
|
108
108
|
*
|
|
@@ -70,7 +70,7 @@ class Testcase {
|
|
|
70
70
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
71
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase`),
|
|
72
72
|
method: "POST",
|
|
73
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
73
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
74
74
|
contentType: "application/json",
|
|
75
75
|
requestType: "json",
|
|
76
76
|
body: serializers.TestcaseCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -164,7 +164,7 @@ class Testcase {
|
|
|
164
164
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
165
165
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
|
|
166
166
|
method: "GET",
|
|
167
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
167
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
168
168
|
contentType: "application/json",
|
|
169
169
|
requestType: "json",
|
|
170
170
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -257,7 +257,7 @@ class Testcase {
|
|
|
257
257
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
258
258
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
|
|
259
259
|
method: "DELETE",
|
|
260
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
260
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
261
261
|
contentType: "application/json",
|
|
262
262
|
requestType: "json",
|
|
263
263
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -351,7 +351,7 @@ class Testcase {
|
|
|
351
351
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
352
352
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
|
|
353
353
|
method: "PATCH",
|
|
354
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
354
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
355
355
|
contentType: "application/json",
|
|
356
356
|
requestType: "json",
|
|
357
357
|
body: serializers.TestcaseUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -445,7 +445,7 @@ class Testcase {
|
|
|
445
445
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
446
446
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/batch_copy`),
|
|
447
447
|
method: "POST",
|
|
448
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
448
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
449
449
|
contentType: "application/json",
|
|
450
450
|
requestType: "json",
|
|
451
451
|
body: serializers.TestcaseBatchCopyParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -454,7 +454,7 @@ class Testcase {
|
|
|
454
454
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
455
455
|
});
|
|
456
456
|
if (_response.ok) {
|
|
457
|
-
return serializers.
|
|
457
|
+
return serializers.testcase.batchCopy.Response.parseOrThrow(_response.body, {
|
|
458
458
|
unrecognizedObjectKeys: "passthrough",
|
|
459
459
|
allowUnrecognizedUnionMembers: true,
|
|
460
460
|
allowUnrecognizedEnumValues: true,
|
|
@@ -539,7 +539,7 @@ class Testcase {
|
|
|
539
539
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
540
540
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/batch_delete`),
|
|
541
541
|
method: "PATCH",
|
|
542
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
542
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
543
543
|
contentType: "application/json",
|
|
544
544
|
requestType: "json",
|
|
545
545
|
body: serializers.TestcaseBatchDeleteParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -70,7 +70,7 @@ class Testrecord {
|
|
|
70
70
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
71
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}`),
|
|
72
72
|
method: "GET",
|
|
73
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
73
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
74
74
|
contentType: "application/json",
|
|
75
75
|
requestType: "json",
|
|
76
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -163,7 +163,7 @@ class Testrecord {
|
|
|
163
163
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
164
164
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord`),
|
|
165
165
|
method: "POST",
|
|
166
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
166
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
167
167
|
contentType: "application/json",
|
|
168
168
|
requestType: "json",
|
|
169
169
|
body: serializers.TestrecordCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -23,9 +23,9 @@ export declare class Testset {
|
|
|
23
23
|
protected readonly _options: Testset.Options;
|
|
24
24
|
constructor(_options: Testset.Options);
|
|
25
25
|
/**
|
|
26
|
-
* Retrieve
|
|
26
|
+
* Retrieve all Testsets with cursor-based pagination
|
|
27
27
|
*
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {Scorecard.TestsetGetRequest} request
|
|
29
29
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
30
|
*
|
|
31
31
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -34,9 +34,9 @@ export declare class Testset {
|
|
|
34
34
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
|
-
* await client.testset.get(
|
|
37
|
+
* await client.testset.get()
|
|
38
38
|
*/
|
|
39
|
-
get(
|
|
39
|
+
get(request?: Scorecard.TestsetGetRequest, requestOptions?: Testset.RequestOptions): Promise<Scorecard.TestsetCursorPage>;
|
|
40
40
|
/**
|
|
41
41
|
* Delete a Testset
|
|
42
42
|
*
|
|
@@ -50,9 +50,9 @@ class Testset {
|
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* Retrieve
|
|
53
|
+
* Retrieve all Testsets with cursor-based pagination
|
|
54
54
|
*
|
|
55
|
-
* @param {
|
|
55
|
+
* @param {Scorecard.TestsetGetRequest} request
|
|
56
56
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
57
|
*
|
|
58
58
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -61,23 +61,32 @@ class Testset {
|
|
|
61
61
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
|
-
* await client.testset.get(
|
|
64
|
+
* await client.testset.get()
|
|
65
65
|
*/
|
|
66
|
-
get(
|
|
66
|
+
get(request = {}, requestOptions) {
|
|
67
67
|
var _a, _b;
|
|
68
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const { cursor, size } = request;
|
|
70
|
+
const _queryParams = {};
|
|
71
|
+
if (cursor != null) {
|
|
72
|
+
_queryParams["cursor"] = cursor;
|
|
73
|
+
}
|
|
74
|
+
if (size != null) {
|
|
75
|
+
_queryParams["size"] = size.toString();
|
|
76
|
+
}
|
|
69
77
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
70
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default,
|
|
78
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/testset"),
|
|
71
79
|
method: "GET",
|
|
72
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
80
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
73
81
|
contentType: "application/json",
|
|
82
|
+
queryParameters: _queryParams,
|
|
74
83
|
requestType: "json",
|
|
75
84
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
76
85
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
77
86
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
78
87
|
});
|
|
79
88
|
if (_response.ok) {
|
|
80
|
-
return serializers.
|
|
89
|
+
return serializers.TestsetCursorPage.parseOrThrow(_response.body, {
|
|
81
90
|
unrecognizedObjectKeys: "passthrough",
|
|
82
91
|
allowUnrecognizedUnionMembers: true,
|
|
83
92
|
allowUnrecognizedEnumValues: true,
|
|
@@ -161,7 +170,7 @@ class Testset {
|
|
|
161
170
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
162
171
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}`),
|
|
163
172
|
method: "DELETE",
|
|
164
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
173
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
165
174
|
contentType: "application/json",
|
|
166
175
|
requestType: "json",
|
|
167
176
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -254,7 +263,7 @@ class Testset {
|
|
|
254
263
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
255
264
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}`),
|
|
256
265
|
method: "PATCH",
|
|
257
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
266
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
258
267
|
contentType: "application/json",
|
|
259
268
|
requestType: "json",
|
|
260
269
|
body: serializers.TestsetUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -349,7 +358,7 @@ class Testset {
|
|
|
349
358
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
350
359
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/testset"),
|
|
351
360
|
method: "POST",
|
|
352
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
361
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
353
362
|
contentType: "application/json",
|
|
354
363
|
requestType: "json",
|
|
355
364
|
body: serializers.TestsetCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -442,7 +451,7 @@ class Testset {
|
|
|
442
451
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
443
452
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/schema`),
|
|
444
453
|
method: "GET",
|
|
445
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
454
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
446
455
|
contentType: "application/json",
|
|
447
456
|
requestType: "json",
|
|
448
457
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -543,7 +552,7 @@ class Testset {
|
|
|
543
552
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
544
553
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase`),
|
|
545
554
|
method: "GET",
|
|
546
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
555
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
547
556
|
contentType: "application/json",
|
|
548
557
|
queryParameters: _queryParams,
|
|
549
558
|
requestType: "json",
|
|
@@ -21,4 +21,6 @@ export interface TestsetCreateParams {
|
|
|
21
21
|
ingestionMethod?: Scorecard.IngestionMethod;
|
|
22
22
|
/** Whether or not the testset is published. */
|
|
23
23
|
published?: boolean;
|
|
24
|
+
/** Whether or not the testset was created by the playground. */
|
|
25
|
+
createdByPlayground?: boolean;
|
|
24
26
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { type TestsetGetRequest } from "./TestsetGetRequest";
|
|
1
2
|
export { type TestsetUpdateParams } from "./TestsetUpdateParams";
|
|
2
3
|
export { type TestsetCreateParams } from "./TestsetCreateParams";
|
|
3
4
|
export { type TestsetGetTestcasesRequest } from "./TestsetGetTestcasesRequest";
|
|
@@ -67,7 +67,7 @@ class Tracing {
|
|
|
67
67
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
68
68
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/traces"),
|
|
69
69
|
method: "GET",
|
|
70
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
70
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
71
71
|
contentType: "application/json",
|
|
72
72
|
requestType: "json",
|
|
73
73
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -151,7 +151,7 @@ class Tracing {
|
|
|
151
151
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
152
152
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}`),
|
|
153
153
|
method: "GET",
|
|
154
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
154
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
155
155
|
contentType: "application/json",
|
|
156
156
|
requestType: "json",
|
|
157
157
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -244,7 +244,7 @@ class Tracing {
|
|
|
244
244
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
245
245
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}/spans/${encodeURIComponent(spanId)}`),
|
|
246
246
|
method: "GET",
|
|
247
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.
|
|
247
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
248
248
|
contentType: "application/json",
|
|
249
249
|
requestType: "json",
|
|
250
250
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
package/api/types/Prompt.d.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Scorecard from "../index";
|
|
5
|
+
export interface PromptCursorPage {
|
|
6
|
+
items: Scorecard.Prompt[];
|
|
7
|
+
/** Total items */
|
|
8
|
+
total?: number;
|
|
9
|
+
/** Cursor to refetch the current page */
|
|
10
|
+
currentPage?: string;
|
|
11
|
+
/** Cursor to refetch the current page starting from the last item */
|
|
12
|
+
currentPageBackwards?: string;
|
|
13
|
+
/** Cursor for the previous page */
|
|
14
|
+
previousPage?: string;
|
|
15
|
+
/** Cursor for the next page */
|
|
16
|
+
nextPage?: string;
|
|
17
|
+
}
|
package/api/types/Testset.d.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Scorecard from "../index";
|
|
5
|
+
export interface TestsetCursorPage {
|
|
6
|
+
items: Scorecard.Testset[];
|
|
7
|
+
/** Total items */
|
|
8
|
+
total?: number;
|
|
9
|
+
/** Cursor to refetch the current page */
|
|
10
|
+
currentPage?: string;
|
|
11
|
+
/** Cursor to refetch the current page starting from the last item */
|
|
12
|
+
currentPageBackwards?: string;
|
|
13
|
+
/** Cursor for the previous page */
|
|
14
|
+
previousPage?: string;
|
|
15
|
+
/** Cursor for the next page */
|
|
16
|
+
nextPage?: string;
|
|
17
|
+
}
|
package/api/types/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from "./NotFoundErrorBody";
|
|
|
12
12
|
export * from "./PaginatedTestcaseResponse";
|
|
13
13
|
export * from "./PromptModelParamsValue";
|
|
14
14
|
export * from "./Prompt";
|
|
15
|
+
export * from "./PromptCursorPage";
|
|
15
16
|
export * from "./RoleEnum";
|
|
16
17
|
export * from "./Run";
|
|
17
18
|
export * from "./RunMetric";
|
|
@@ -31,6 +32,7 @@ export * from "./TestrecordModelParamsValue";
|
|
|
31
32
|
export * from "./TestrecordModelDebugInfoValue";
|
|
32
33
|
export * from "./Testrecord";
|
|
33
34
|
export * from "./Testset";
|
|
35
|
+
export * from "./TestsetCursorPage";
|
|
34
36
|
export * from "./Trace";
|
|
35
37
|
export * from "./UnauthenticatedError";
|
|
36
38
|
export * from "./UnauthorizedErrorBody";
|
package/api/types/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __exportStar(require("./NotFoundErrorBody"), exports);
|
|
|
28
28
|
__exportStar(require("./PaginatedTestcaseResponse"), exports);
|
|
29
29
|
__exportStar(require("./PromptModelParamsValue"), exports);
|
|
30
30
|
__exportStar(require("./Prompt"), exports);
|
|
31
|
+
__exportStar(require("./PromptCursorPage"), exports);
|
|
31
32
|
__exportStar(require("./RoleEnum"), exports);
|
|
32
33
|
__exportStar(require("./Run"), exports);
|
|
33
34
|
__exportStar(require("./RunMetric"), exports);
|
|
@@ -47,6 +48,7 @@ __exportStar(require("./TestrecordModelParamsValue"), exports);
|
|
|
47
48
|
__exportStar(require("./TestrecordModelDebugInfoValue"), exports);
|
|
48
49
|
__exportStar(require("./Testrecord"), exports);
|
|
49
50
|
__exportStar(require("./Testset"), exports);
|
|
51
|
+
__exportStar(require("./TestsetCursorPage"), exports);
|
|
50
52
|
__exportStar(require("./Trace"), exports);
|
|
51
53
|
__exportStar(require("./UnauthenticatedError"), exports);
|
|
52
54
|
__exportStar(require("./UnauthorizedErrorBody"), exports);
|
|
@@ -23,7 +23,7 @@ export declare class Prompt {
|
|
|
23
23
|
protected readonly _options: Prompt.Options;
|
|
24
24
|
constructor(_options: Prompt.Options);
|
|
25
25
|
/**
|
|
26
|
-
* Retrieve a
|
|
26
|
+
* Retrieve a prompt by name, defaulting to the production prompt, unless a tag to select the prompt by is specified
|
|
27
27
|
*
|
|
28
28
|
* @param {Scorecard.PromptGetByNameRequest} request
|
|
29
29
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -40,11 +40,11 @@ export declare class Prompt {
|
|
|
40
40
|
*/
|
|
41
41
|
getByName(request: Scorecard.PromptGetByNameRequest, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
42
42
|
/**
|
|
43
|
-
* Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
|
|
43
|
+
* Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in the app).
|
|
44
44
|
*
|
|
45
|
-
* A root prompt can be created by providing the `name` param, and it will always be tagged as
|
|
45
|
+
* A root prompt can be created by providing the `name` param, and it will always be tagged as production.
|
|
46
46
|
*
|
|
47
|
-
* A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all
|
|
47
|
+
* A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all descendants from a root prompt would share the root's name. `is_prod` can also be provided to configure whether a child should be tagged as production.
|
|
48
48
|
*
|
|
49
49
|
* @param {Scorecard.PromptCreateParams} request
|
|
50
50
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -64,7 +64,9 @@ export declare class Prompt {
|
|
|
64
64
|
* "param2": 0.1,
|
|
65
65
|
* "param3": 100,
|
|
66
66
|
* "param4": true
|
|
67
|
-
* }
|
|
67
|
+
* },
|
|
68
|
+
* tag: "1.0",
|
|
69
|
+
* projectId: 1
|
|
68
70
|
* })
|
|
69
71
|
*
|
|
70
72
|
* @example
|
|
@@ -78,10 +80,27 @@ export declare class Prompt {
|
|
|
78
80
|
* "param3": 100,
|
|
79
81
|
* "param4": true
|
|
80
82
|
* },
|
|
81
|
-
*
|
|
83
|
+
* tag: "v1.1",
|
|
84
|
+
* isProd: true,
|
|
85
|
+
* projectId: 1
|
|
82
86
|
* })
|
|
83
87
|
*/
|
|
84
88
|
create(request: Scorecard.PromptCreateParams, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
89
|
+
/**
|
|
90
|
+
* List all prompts with cursor-based pagination
|
|
91
|
+
*
|
|
92
|
+
* @param {Scorecard.PromptListPromptsRequest} request
|
|
93
|
+
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
94
|
+
*
|
|
95
|
+
* @throws {@link Scorecard.UnauthorizedError}
|
|
96
|
+
* @throws {@link Scorecard.ForbiddenError}
|
|
97
|
+
* @throws {@link Scorecard.NotFoundError}
|
|
98
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* await client.prompt.listPrompts()
|
|
102
|
+
*/
|
|
103
|
+
listPrompts(request?: Scorecard.PromptListPromptsRequest, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.PromptCursorPage>;
|
|
85
104
|
/**
|
|
86
105
|
* Retrieve a prompt by id
|
|
87
106
|
*
|
|
@@ -98,9 +117,9 @@ export declare class Prompt {
|
|
|
98
117
|
*/
|
|
99
118
|
get(id: string, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
100
119
|
/**
|
|
101
|
-
* Delete a
|
|
120
|
+
* Delete a root prompt and all of its children.
|
|
102
121
|
*
|
|
103
|
-
* @param {string} id - The id of the
|
|
122
|
+
* @param {string} id - The id of the root prompt to delete.
|
|
104
123
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
105
124
|
*
|
|
106
125
|
* @throws {@link Scorecard.UnauthorizedError}
|