scorecard-ai 0.3.0 → 0.5.2
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/Client.d.ts +2 -0
- package/api/resources/prompt/client/Client.d.ts +22 -40
- package/api/resources/prompt/client/Client.js +50 -205
- package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -2
- package/api/resources/prompt/client/requests/PromptUpdateParams.d.ts +1 -2
- package/api/resources/run/client/Client.d.ts +5 -13
- package/api/resources/run/client/Client.js +18 -25
- package/api/resources/run/client/requests/RunCreateParams.d.ts +1 -9
- package/api/resources/run/client/requests/UpdateStatusParams.d.ts +2 -4
- package/api/resources/runMetric/client/Client.d.ts +2 -0
- package/api/resources/runMetric/client/Client.js +5 -4
- package/api/resources/score/client/Client.d.ts +7 -5
- package/api/resources/score/client/Client.js +15 -13
- package/api/resources/score/client/requests/ScoreCreateParams.d.ts +1 -0
- package/api/resources/testcase/client/Client.d.ts +10 -10
- package/api/resources/testcase/client/Client.js +29 -22
- package/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +3 -4
- package/api/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
- package/api/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
- package/api/resources/testrecord/client/Client.d.ts +3 -1
- package/api/resources/testrecord/client/Client.js +11 -9
- package/api/resources/testset/client/Client.d.ts +6 -4
- package/api/resources/testset/client/Client.js +29 -24
- package/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -0
- package/api/resources/traces/client/Client.d.ts +2 -0
- package/api/resources/traces/client/Client.js +5 -4
- package/api/types/Grade.d.ts +2 -0
- package/api/types/PaginatedTestcaseResponse.d.ts +1 -0
- package/api/types/TestCase.d.ts +2 -0
- package/api/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/api/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/api/types/TestcaseDeletionResponse.d.ts +9 -0
- package/api/types/TestcaseDeletionResponse.js +5 -0
- package/api/types/Testrecord.d.ts +0 -1
- package/api/types/index.d.ts +1 -0
- package/api/types/index.js +1 -0
- package/core/fetcher/Fetcher.d.ts +1 -0
- package/core/fetcher/Fetcher.js +58 -7
- package/dist/Client.d.ts +2 -0
- package/dist/api/resources/prompt/client/Client.d.ts +22 -40
- package/dist/api/resources/prompt/client/Client.js +50 -205
- package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -2
- package/dist/api/resources/prompt/client/requests/PromptUpdateParams.d.ts +1 -2
- package/dist/api/resources/run/client/Client.d.ts +5 -13
- package/dist/api/resources/run/client/Client.js +18 -25
- package/dist/api/resources/run/client/requests/RunCreateParams.d.ts +1 -9
- package/dist/api/resources/run/client/requests/UpdateStatusParams.d.ts +2 -4
- package/dist/api/resources/runMetric/client/Client.d.ts +2 -0
- package/dist/api/resources/runMetric/client/Client.js +5 -4
- package/dist/api/resources/score/client/Client.d.ts +7 -5
- package/dist/api/resources/score/client/Client.js +15 -13
- package/dist/api/resources/score/client/requests/ScoreCreateParams.d.ts +1 -0
- package/dist/api/resources/testcase/client/Client.d.ts +10 -10
- package/dist/api/resources/testcase/client/Client.js +29 -22
- package/dist/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +3 -4
- package/dist/api/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
- package/dist/api/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
- package/dist/api/resources/testrecord/client/Client.d.ts +3 -1
- package/dist/api/resources/testrecord/client/Client.js +11 -9
- package/dist/api/resources/testset/client/Client.d.ts +6 -4
- package/dist/api/resources/testset/client/Client.js +29 -24
- package/dist/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -0
- package/dist/api/resources/traces/client/Client.d.ts +2 -0
- package/dist/api/resources/traces/client/Client.js +5 -4
- package/dist/api/types/Grade.d.ts +2 -0
- package/dist/api/types/PaginatedTestcaseResponse.d.ts +1 -0
- package/dist/api/types/TestCase.d.ts +2 -0
- package/dist/api/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/dist/api/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/dist/api/types/TestcaseDeletionResponse.d.ts +9 -0
- package/dist/api/types/TestcaseDeletionResponse.js +5 -0
- package/dist/api/types/Testrecord.d.ts +0 -1
- package/dist/api/types/index.d.ts +1 -0
- package/dist/api/types/index.js +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +1 -0
- package/dist/core/fetcher/Fetcher.js +58 -7
- package/dist/serialization/resources/prompt/client/index.d.ts +0 -3
- package/dist/serialization/resources/prompt/client/index.js +0 -16
- package/dist/serialization/resources/prompt/client/requests/PromptUpdateParams.d.ts +0 -1
- package/dist/serialization/resources/prompt/client/requests/PromptUpdateParams.js +0 -1
- package/dist/serialization/resources/run/client/requests/UpdateStatusParams.d.ts +1 -1
- package/dist/serialization/resources/run/client/requests/UpdateStatusParams.js +1 -1
- package/dist/serialization/resources/testcase/client/requests/TestcaseCreateParams.d.ts +1 -1
- package/dist/serialization/resources/testcase/client/requests/TestcaseCreateParams.js +1 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +4 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
- package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +4 -1
- package/dist/serialization/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/dist/serialization/types/TestCaseCustomInputsValue.js +4 -1
- package/dist/serialization/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/dist/serialization/types/TestCaseCustomLabelsValue.js +4 -1
- package/dist/serialization/types/TestcaseDeletionResponse.d.ts +13 -0
- package/dist/serialization/{resources/prompt/client/getRoots.js → types/TestcaseDeletionResponse.js} +6 -4
- package/dist/serialization/types/Testrecord.d.ts +0 -1
- package/dist/serialization/types/Testrecord.js +0 -1
- package/dist/serialization/types/index.d.ts +1 -0
- package/dist/serialization/types/index.js +1 -0
- package/dist/telemetry.d.ts +6 -0
- package/dist/telemetry.js +65 -0
- package/dist/wrapper/ScorecardClient.d.ts +4 -0
- package/dist/wrapper/ScorecardClient.js +4 -6
- package/package.json +56 -2
- package/reference.md +38 -189
- package/serialization/resources/prompt/client/index.d.ts +0 -3
- package/serialization/resources/prompt/client/index.js +0 -16
- package/serialization/resources/prompt/client/requests/PromptUpdateParams.d.ts +0 -1
- package/serialization/resources/prompt/client/requests/PromptUpdateParams.js +0 -1
- package/serialization/resources/run/client/requests/UpdateStatusParams.d.ts +1 -1
- package/serialization/resources/run/client/requests/UpdateStatusParams.js +1 -1
- package/serialization/resources/testcase/client/requests/TestcaseCreateParams.d.ts +1 -1
- package/serialization/resources/testcase/client/requests/TestcaseCreateParams.js +1 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +4 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
- package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +4 -1
- package/serialization/types/TestCaseCustomInputsValue.d.ts +1 -1
- package/serialization/types/TestCaseCustomInputsValue.js +4 -1
- package/serialization/types/TestCaseCustomLabelsValue.d.ts +1 -1
- package/serialization/types/TestCaseCustomLabelsValue.js +4 -1
- package/serialization/types/TestcaseDeletionResponse.d.ts +13 -0
- package/{dist/serialization/resources/prompt/client/getGraph.js → serialization/types/TestcaseDeletionResponse.js} +6 -4
- package/serialization/types/Testrecord.d.ts +0 -1
- package/serialization/types/Testrecord.js +0 -1
- package/serialization/types/index.d.ts +1 -0
- package/serialization/types/index.js +1 -0
- package/telemetry.d.ts +6 -0
- package/telemetry.js +65 -0
- package/wrapper/ScorecardClient.d.ts +4 -0
- package/wrapper/ScorecardClient.js +4 -6
- package/dist/serialization/resources/prompt/client/getGraph.d.ts +0 -11
- package/dist/serialization/resources/prompt/client/getProds.d.ts +0 -11
- package/dist/serialization/resources/prompt/client/getProds.js +0 -32
- package/dist/serialization/resources/prompt/client/getRoots.d.ts +0 -11
- package/serialization/resources/prompt/client/getGraph.d.ts +0 -11
- package/serialization/resources/prompt/client/getGraph.js +0 -32
- package/serialization/resources/prompt/client/getProds.d.ts +0 -11
- package/serialization/resources/prompt/client/getProds.js +0 -32
- package/serialization/resources/prompt/client/getRoots.d.ts +0 -11
- package/serialization/resources/prompt/client/getRoots.js +0 -32
|
@@ -61,27 +61,20 @@ class Run {
|
|
|
61
61
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
|
-
* await scorecard.run.create(
|
|
65
|
-
* testsetId: 1,
|
|
66
|
-
* status: "RUNNING_EXECUTION",
|
|
67
|
-
* modelParams: {
|
|
68
|
-
* "param1": "value1",
|
|
69
|
-
* "param2": "value2"
|
|
70
|
-
* },
|
|
71
|
-
* metrics: [1, 2]
|
|
72
|
-
* })
|
|
64
|
+
* await scorecard.run.create()
|
|
73
65
|
*/
|
|
74
66
|
create(request = {}, requestOptions) {
|
|
75
|
-
var _a;
|
|
67
|
+
var _a, _b;
|
|
76
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
const _response = yield core.fetcher({
|
|
78
|
-
url: (0, url_join_1.default)((
|
|
69
|
+
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, "v1/run"),
|
|
79
71
|
method: "POST",
|
|
80
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
72
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
81
73
|
contentType: "application/json",
|
|
82
74
|
body: yield serializers.RunCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
83
75
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
84
76
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
77
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
85
78
|
});
|
|
86
79
|
if (_response.ok) {
|
|
87
80
|
return yield serializers.Run.parseOrThrow(_response.body, {
|
|
@@ -163,15 +156,16 @@ class Run {
|
|
|
163
156
|
* await scorecard.run.get(1)
|
|
164
157
|
*/
|
|
165
158
|
get(runId, requestOptions) {
|
|
166
|
-
var _a;
|
|
159
|
+
var _a, _b;
|
|
167
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
const _response = yield core.fetcher({
|
|
169
|
-
url: (0, url_join_1.default)((
|
|
161
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
162
|
+
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)}`),
|
|
170
163
|
method: "GET",
|
|
171
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
164
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
172
165
|
contentType: "application/json",
|
|
173
166
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
174
167
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
168
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
175
169
|
});
|
|
176
170
|
if (_response.ok) {
|
|
177
171
|
return yield serializers.Run.parseOrThrow(_response.body, {
|
|
@@ -251,21 +245,20 @@ class Run {
|
|
|
251
245
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
252
246
|
*
|
|
253
247
|
* @example
|
|
254
|
-
* await scorecard.run.updateStatus(1
|
|
255
|
-
* status: Scorecard.RunStatus.Pending
|
|
256
|
-
* })
|
|
248
|
+
* await scorecard.run.updateStatus(1)
|
|
257
249
|
*/
|
|
258
|
-
updateStatus(runId, request, requestOptions) {
|
|
259
|
-
var _a;
|
|
250
|
+
updateStatus(runId, request = {}, requestOptions) {
|
|
251
|
+
var _a, _b;
|
|
260
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
-
const _response = yield core.fetcher({
|
|
262
|
-
url: (0, url_join_1.default)((
|
|
253
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
254
|
+
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)}/status`),
|
|
263
255
|
method: "PATCH",
|
|
264
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
256
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
265
257
|
contentType: "application/json",
|
|
266
258
|
body: yield serializers.UpdateStatusParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
267
259
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
268
260
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
261
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
269
262
|
});
|
|
270
263
|
if (_response.ok) {
|
|
271
264
|
return yield serializers.Run.parseOrThrow(_response.body, {
|
|
@@ -3,15 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
|
-
* {
|
|
7
|
-
* testsetId: 1,
|
|
8
|
-
* status: "RUNNING_EXECUTION",
|
|
9
|
-
* modelParams: {
|
|
10
|
-
* "param1": "value1",
|
|
11
|
-
* "param2": "value2"
|
|
12
|
-
* },
|
|
13
|
-
* metrics: [1, 2]
|
|
14
|
-
* }
|
|
6
|
+
* {}
|
|
15
7
|
*/
|
|
16
8
|
export interface RunCreateParams {
|
|
17
9
|
testsetId?: number;
|
|
@@ -8,10 +8,12 @@ export declare namespace RunMetric {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
10
10
|
apiKey: core.Supplier<string>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
14
15
|
maxRetries?: number;
|
|
16
|
+
abortSignal?: AbortSignal;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
export declare class RunMetric {
|
|
@@ -64,15 +64,16 @@ class RunMetric {
|
|
|
64
64
|
* await scorecard.runMetric.get(1)
|
|
65
65
|
*/
|
|
66
66
|
get(runId, requestOptions) {
|
|
67
|
-
var _a;
|
|
67
|
+
var _a, _b;
|
|
68
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
const _response = yield core.fetcher({
|
|
70
|
-
url: (0, url_join_1.default)((
|
|
69
|
+
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, `v1/run_metric/${encodeURIComponent(runId)}`),
|
|
71
71
|
method: "GET",
|
|
72
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
72
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
73
73
|
contentType: "application/json",
|
|
74
74
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
75
75
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
76
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
76
77
|
});
|
|
77
78
|
if (_response.ok) {
|
|
78
79
|
return yield serializers.runMetric.get.Response.parseOrThrow(_response.body, {
|
|
@@ -8,10 +8,12 @@ export declare namespace Score {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
10
10
|
apiKey: core.Supplier<string>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
14
15
|
maxRetries?: number;
|
|
16
|
+
abortSignal?: AbortSignal;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
export declare class Score {
|
|
@@ -20,8 +22,8 @@ export declare class Score {
|
|
|
20
22
|
/**
|
|
21
23
|
* Create a score
|
|
22
24
|
*
|
|
23
|
-
* @param {number} runId
|
|
24
|
-
* @param {number} testrecordId
|
|
25
|
+
* @param {number} runId - The ID of the run that created the testrecord to be scored.
|
|
26
|
+
* @param {number} testrecordId - The ID of the testrecord to be scored.
|
|
25
27
|
* @param {Scorecard.ScoreCreateParams} request
|
|
26
28
|
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
29
|
*
|
|
@@ -39,9 +41,9 @@ export declare class Score {
|
|
|
39
41
|
/**
|
|
40
42
|
* Update a score
|
|
41
43
|
*
|
|
42
|
-
* @param {number} runId
|
|
43
|
-
* @param {number} testrecordId
|
|
44
|
-
* @param {number} scoreId
|
|
44
|
+
* @param {number} runId - The run ID that created the test record to be scored.
|
|
45
|
+
* @param {number} testrecordId - The ID of the testrecord whose score will be updated.
|
|
46
|
+
* @param {number} scoreId - The ID of the score to be updated.
|
|
45
47
|
* @param {Scorecard.ScoreUpdateParams} request
|
|
46
48
|
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
49
|
*
|
|
@@ -52,8 +52,8 @@ class Score {
|
|
|
52
52
|
/**
|
|
53
53
|
* Create a score
|
|
54
54
|
*
|
|
55
|
-
* @param {number} runId
|
|
56
|
-
* @param {number} testrecordId
|
|
55
|
+
* @param {number} runId - The ID of the run that created the testrecord to be scored.
|
|
56
|
+
* @param {number} testrecordId - The ID of the testrecord to be scored.
|
|
57
57
|
* @param {Scorecard.ScoreCreateParams} request
|
|
58
58
|
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
59
|
*
|
|
@@ -68,16 +68,17 @@ class Score {
|
|
|
68
68
|
* })
|
|
69
69
|
*/
|
|
70
70
|
create(runId, testrecordId, request, requestOptions) {
|
|
71
|
-
var _a;
|
|
71
|
+
var _a, _b;
|
|
72
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
const _response = yield core.fetcher({
|
|
74
|
-
url: (0, url_join_1.default)((
|
|
73
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
74
|
+
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)}/score`),
|
|
75
75
|
method: "POST",
|
|
76
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
76
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
77
77
|
contentType: "application/json",
|
|
78
78
|
body: yield serializers.ScoreCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
79
79
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
80
80
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
81
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
81
82
|
});
|
|
82
83
|
if (_response.ok) {
|
|
83
84
|
return yield serializers.Grade.parseOrThrow(_response.body, {
|
|
@@ -147,9 +148,9 @@ class Score {
|
|
|
147
148
|
/**
|
|
148
149
|
* Update a score
|
|
149
150
|
*
|
|
150
|
-
* @param {number} runId
|
|
151
|
-
* @param {number} testrecordId
|
|
152
|
-
* @param {number} scoreId
|
|
151
|
+
* @param {number} runId - The run ID that created the test record to be scored.
|
|
152
|
+
* @param {number} testrecordId - The ID of the testrecord whose score will be updated.
|
|
153
|
+
* @param {number} scoreId - The ID of the score to be updated.
|
|
153
154
|
* @param {Scorecard.ScoreUpdateParams} request
|
|
154
155
|
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
155
156
|
*
|
|
@@ -162,16 +163,17 @@ class Score {
|
|
|
162
163
|
* await scorecard.score.update(1, 1, 1)
|
|
163
164
|
*/
|
|
164
165
|
update(runId, testrecordId, scoreId, request = {}, requestOptions) {
|
|
165
|
-
var _a;
|
|
166
|
+
var _a, _b;
|
|
166
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
const _response = yield core.fetcher({
|
|
168
|
-
url: (0, url_join_1.default)((
|
|
168
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
169
|
+
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)}/score/${encodeURIComponent(scoreId)}`),
|
|
169
170
|
method: "PATCH",
|
|
170
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
171
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
171
172
|
contentType: "application/json",
|
|
172
173
|
body: yield serializers.ScoreUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
173
174
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
174
175
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
176
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
175
177
|
});
|
|
176
178
|
if (_response.ok) {
|
|
177
179
|
return yield serializers.Grade.parseOrThrow(_response.body, {
|
|
@@ -8,10 +8,12 @@ export declare namespace Testcase {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
10
10
|
apiKey: core.Supplier<string>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
14
15
|
maxRetries?: number;
|
|
16
|
+
abortSignal?: AbortSignal;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
export declare class Testcase {
|
|
@@ -20,7 +22,7 @@ export declare class Testcase {
|
|
|
20
22
|
/**
|
|
21
23
|
* Create a new Testcase
|
|
22
24
|
*
|
|
23
|
-
* @param {number} testsetId
|
|
25
|
+
* @param {number} testsetId - The ID of the Testset to create the Testcase in.
|
|
24
26
|
* @param {Scorecard.TestcaseCreateParams} request
|
|
25
27
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
28
|
*
|
|
@@ -30,16 +32,14 @@ export declare class Testcase {
|
|
|
30
32
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
31
33
|
*
|
|
32
34
|
* @example
|
|
33
|
-
* await scorecard.testcase.create(1
|
|
34
|
-
* userQuery: "user_query"
|
|
35
|
-
* })
|
|
35
|
+
* await scorecard.testcase.create(1)
|
|
36
36
|
*/
|
|
37
|
-
create(testsetId: number, request
|
|
37
|
+
create(testsetId: number, request?: Scorecard.TestcaseCreateParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
38
38
|
/**
|
|
39
39
|
* Retrieve Testcase data
|
|
40
40
|
*
|
|
41
|
-
* @param {number} testcaseId
|
|
42
|
-
* @param {number} testsetId
|
|
41
|
+
* @param {number} testcaseId - The ID of the Testcase to retrieve.
|
|
42
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the Testcase from.
|
|
43
43
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
44
|
*
|
|
45
45
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -54,8 +54,8 @@ export declare class Testcase {
|
|
|
54
54
|
/**
|
|
55
55
|
* Delete a Testcase
|
|
56
56
|
*
|
|
57
|
-
* @param {number} testcaseId
|
|
58
|
-
* @param {number} testsetId
|
|
57
|
+
* @param {number} testcaseId - The ID of the Testcase to delete.
|
|
58
|
+
* @param {number} testsetId - The ID of the Testset to delete the Testcase from.
|
|
59
59
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
60
|
*
|
|
61
61
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -66,7 +66,7 @@ export declare class Testcase {
|
|
|
66
66
|
* @example
|
|
67
67
|
* await scorecard.testcase.delete(1, 1)
|
|
68
68
|
*/
|
|
69
|
-
delete(testcaseId: number, testsetId: number, requestOptions?: Testcase.RequestOptions): Promise<
|
|
69
|
+
delete(testcaseId: number, testsetId: number, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestcaseDeletionResponse>;
|
|
70
70
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
71
71
|
"X-API-Key": string;
|
|
72
72
|
}>;
|
|
@@ -52,7 +52,7 @@ class Testcase {
|
|
|
52
52
|
/**
|
|
53
53
|
* Create a new Testcase
|
|
54
54
|
*
|
|
55
|
-
* @param {number} testsetId
|
|
55
|
+
* @param {number} testsetId - The ID of the Testset to create the Testcase in.
|
|
56
56
|
* @param {Scorecard.TestcaseCreateParams} request
|
|
57
57
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
58
|
*
|
|
@@ -62,21 +62,20 @@ class Testcase {
|
|
|
62
62
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
|
-
* await scorecard.testcase.create(1
|
|
66
|
-
* userQuery: "user_query"
|
|
67
|
-
* })
|
|
65
|
+
* await scorecard.testcase.create(1)
|
|
68
66
|
*/
|
|
69
|
-
create(testsetId, request, requestOptions) {
|
|
70
|
-
var _a;
|
|
67
|
+
create(testsetId, request = {}, requestOptions) {
|
|
68
|
+
var _a, _b;
|
|
71
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
const _response = yield core.fetcher({
|
|
73
|
-
url: (0, url_join_1.default)((
|
|
70
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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`),
|
|
74
72
|
method: "POST",
|
|
75
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
73
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
76
74
|
contentType: "application/json",
|
|
77
75
|
body: yield serializers.TestcaseCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
78
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
79
77
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
78
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
80
79
|
});
|
|
81
80
|
if (_response.ok) {
|
|
82
81
|
return yield serializers.TestCase.parseOrThrow(_response.body, {
|
|
@@ -146,8 +145,8 @@ class Testcase {
|
|
|
146
145
|
/**
|
|
147
146
|
* Retrieve Testcase data
|
|
148
147
|
*
|
|
149
|
-
* @param {number} testcaseId
|
|
150
|
-
* @param {number} testsetId
|
|
148
|
+
* @param {number} testcaseId - The ID of the Testcase to retrieve.
|
|
149
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the Testcase from.
|
|
151
150
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
152
151
|
*
|
|
153
152
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -159,15 +158,16 @@ class Testcase {
|
|
|
159
158
|
* await scorecard.testcase.get(1, 1)
|
|
160
159
|
*/
|
|
161
160
|
get(testcaseId, testsetId, requestOptions) {
|
|
162
|
-
var _a;
|
|
161
|
+
var _a, _b;
|
|
163
162
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
-
const _response = yield core.fetcher({
|
|
165
|
-
url: (0, url_join_1.default)((
|
|
163
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
164
|
+
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
165
|
method: "GET",
|
|
167
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
166
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
168
167
|
contentType: "application/json",
|
|
169
168
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
170
169
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
170
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
171
171
|
});
|
|
172
172
|
if (_response.ok) {
|
|
173
173
|
return yield serializers.TestCase.parseOrThrow(_response.body, {
|
|
@@ -237,8 +237,8 @@ class Testcase {
|
|
|
237
237
|
/**
|
|
238
238
|
* Delete a Testcase
|
|
239
239
|
*
|
|
240
|
-
* @param {number} testcaseId
|
|
241
|
-
* @param {number} testsetId
|
|
240
|
+
* @param {number} testcaseId - The ID of the Testcase to delete.
|
|
241
|
+
* @param {number} testsetId - The ID of the Testset to delete the Testcase from.
|
|
242
242
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
243
243
|
*
|
|
244
244
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -250,18 +250,25 @@ class Testcase {
|
|
|
250
250
|
* await scorecard.testcase.delete(1, 1)
|
|
251
251
|
*/
|
|
252
252
|
delete(testcaseId, testsetId, requestOptions) {
|
|
253
|
-
var _a;
|
|
253
|
+
var _a, _b;
|
|
254
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
-
const _response = yield core.fetcher({
|
|
256
|
-
url: (0, url_join_1.default)((
|
|
255
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
256
|
+
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)}`),
|
|
257
257
|
method: "DELETE",
|
|
258
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
258
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
259
259
|
contentType: "application/json",
|
|
260
260
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
261
261
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
262
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
262
263
|
});
|
|
263
264
|
if (_response.ok) {
|
|
264
|
-
return _response.body
|
|
265
|
+
return yield serializers.TestcaseDeletionResponse.parseOrThrow(_response.body, {
|
|
266
|
+
unrecognizedObjectKeys: "passthrough",
|
|
267
|
+
allowUnrecognizedUnionMembers: true,
|
|
268
|
+
allowUnrecognizedEnumValues: true,
|
|
269
|
+
skipValidation: true,
|
|
270
|
+
breadcrumbsPrefix: ["response"],
|
|
271
|
+
});
|
|
265
272
|
}
|
|
266
273
|
if (_response.error.reason === "status-code") {
|
|
267
274
|
switch (_response.error.statusCode) {
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
import * as Scorecard from "../../../../index";
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
|
-
* {
|
|
8
|
-
* userQuery: "user_query"
|
|
9
|
-
* }
|
|
7
|
+
* {}
|
|
10
8
|
*/
|
|
11
9
|
export interface TestcaseCreateParams {
|
|
12
|
-
|
|
10
|
+
/** The user query to be executed. */
|
|
11
|
+
userQuery?: string;
|
|
13
12
|
context?: string;
|
|
14
13
|
ideal?: string;
|
|
15
14
|
customInputs?: Record<string, Scorecard.TestcaseCreateParamsCustomInputsValue | undefined>;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Scorecard from "../../../index";
|
|
5
|
-
export declare type TestcaseCreateParamsCustomInputsValue =
|
|
5
|
+
export declare type TestcaseCreateParamsCustomInputsValue = Scorecard.FileUrl | Scorecard.JsonObject | string | number | number | boolean;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Scorecard from "../../../index";
|
|
5
|
-
export declare type TestcaseCreateParamsCustomLabelsValue =
|
|
5
|
+
export declare type TestcaseCreateParamsCustomLabelsValue = Scorecard.FileUrl | Scorecard.JsonObject | string | number | number | boolean;
|
|
@@ -8,10 +8,12 @@ export declare namespace Testrecord {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
10
10
|
apiKey: core.Supplier<string>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
14
15
|
maxRetries?: number;
|
|
16
|
+
abortSignal?: AbortSignal;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
export declare class Testrecord {
|
|
@@ -36,7 +38,7 @@ export declare class Testrecord {
|
|
|
36
38
|
/**
|
|
37
39
|
* Create a new Testrecord
|
|
38
40
|
*
|
|
39
|
-
* @param {number} runId
|
|
41
|
+
* @param {number} runId - The ID of the Run to create the Testrecord in.
|
|
40
42
|
* @param {Scorecard.TestrecordCreateParams} request
|
|
41
43
|
* @param {Testrecord.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
44
|
*
|
|
@@ -65,15 +65,16 @@ class Testrecord {
|
|
|
65
65
|
* await scorecard.testrecord.get(1, 1)
|
|
66
66
|
*/
|
|
67
67
|
get(testrecordId, runId, requestOptions) {
|
|
68
|
-
var _a;
|
|
68
|
+
var _a, _b;
|
|
69
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const _response = yield core.fetcher({
|
|
71
|
-
url: (0, url_join_1.default)((
|
|
70
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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.
|
|
73
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
74
74
|
contentType: "application/json",
|
|
75
75
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
76
76
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
77
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
77
78
|
});
|
|
78
79
|
if (_response.ok) {
|
|
79
80
|
return yield serializers.Testrecord.parseOrThrow(_response.body, {
|
|
@@ -143,7 +144,7 @@ class Testrecord {
|
|
|
143
144
|
/**
|
|
144
145
|
* Create a new Testrecord
|
|
145
146
|
*
|
|
146
|
-
* @param {number} runId
|
|
147
|
+
* @param {number} runId - The ID of the Run to create the Testrecord in.
|
|
147
148
|
* @param {Scorecard.TestrecordCreateParams} request
|
|
148
149
|
* @param {Testrecord.RequestOptions} requestOptions - Request-specific configuration.
|
|
149
150
|
*
|
|
@@ -156,16 +157,17 @@ class Testrecord {
|
|
|
156
157
|
* await scorecard.testrecord.create(1)
|
|
157
158
|
*/
|
|
158
159
|
create(runId, request = {}, requestOptions) {
|
|
159
|
-
var _a;
|
|
160
|
+
var _a, _b;
|
|
160
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
-
const _response = yield core.fetcher({
|
|
162
|
-
url: (0, url_join_1.default)((
|
|
162
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
163
|
+
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`),
|
|
163
164
|
method: "POST",
|
|
164
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
165
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
165
166
|
contentType: "application/json",
|
|
166
167
|
body: yield serializers.TestrecordCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
167
168
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
168
169
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
170
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
169
171
|
});
|
|
170
172
|
if (_response.ok) {
|
|
171
173
|
return yield serializers.Testrecord.parseOrThrow(_response.body, {
|
|
@@ -8,10 +8,12 @@ export declare namespace Testset {
|
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ScorecardEnvironment | string>;
|
|
10
10
|
apiKey: core.Supplier<string>;
|
|
11
|
+
fetcher?: core.FetchFunction;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
13
14
|
timeoutInSeconds?: number;
|
|
14
15
|
maxRetries?: number;
|
|
16
|
+
abortSignal?: AbortSignal;
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
export declare class Testset {
|
|
@@ -20,7 +22,7 @@ export declare class Testset {
|
|
|
20
22
|
/**
|
|
21
23
|
* Retrieve Testset metadata without Testcase data
|
|
22
24
|
*
|
|
23
|
-
* @param {number} testsetId
|
|
25
|
+
* @param {number} testsetId - The ID of the Testset to retrieve.
|
|
24
26
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
27
|
*
|
|
26
28
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -35,7 +37,7 @@ export declare class Testset {
|
|
|
35
37
|
/**
|
|
36
38
|
* Delete a Testset
|
|
37
39
|
*
|
|
38
|
-
* @param {number} testsetId
|
|
40
|
+
* @param {number} testsetId - The ID of the Testset to delete.
|
|
39
41
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
42
|
*
|
|
41
43
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -67,7 +69,7 @@ export declare class Testset {
|
|
|
67
69
|
/**
|
|
68
70
|
* Read the schema of a Testset
|
|
69
71
|
*
|
|
70
|
-
* @param {number} testsetId
|
|
72
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the schema from.
|
|
71
73
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
74
|
*
|
|
73
75
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -82,7 +84,7 @@ export declare class Testset {
|
|
|
82
84
|
/**
|
|
83
85
|
* Retrieve all Testcases from a Testset
|
|
84
86
|
*
|
|
85
|
-
* @param {number} testsetId
|
|
87
|
+
* @param {number} testsetId - The Testset ID to retrieve testcases from.
|
|
86
88
|
* @param {Scorecard.TestsetGetTestcasesRequest} request
|
|
87
89
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
88
90
|
*
|