scorecard-ai 0.3.0 → 0.4.0
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/api/resources/prompt/client/Client.d.ts +20 -40
- package/api/resources/prompt/client/Client.js +31 -191
- 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 +3 -13
- package/api/resources/run/client/Client.js +6 -16
- 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.js +1 -1
- package/api/resources/score/client/Client.d.ts +5 -5
- package/api/resources/score/client/Client.js +7 -7
- package/api/resources/score/client/requests/ScoreCreateParams.d.ts +1 -0
- package/api/resources/testcase/client/Client.d.ts +8 -10
- package/api/resources/testcase/client/Client.js +17 -13
- 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 +1 -1
- package/api/resources/testrecord/client/Client.js +3 -3
- package/api/resources/testset/client/Client.d.ts +4 -4
- package/api/resources/testset/client/Client.js +9 -9
- package/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -0
- package/api/resources/traces/client/Client.js +1 -1
- 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/dist/api/resources/prompt/client/Client.d.ts +20 -40
- package/dist/api/resources/prompt/client/Client.js +31 -191
- 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 +3 -13
- package/dist/api/resources/run/client/Client.js +6 -16
- 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.js +1 -1
- package/dist/api/resources/score/client/Client.d.ts +5 -5
- package/dist/api/resources/score/client/Client.js +7 -7
- package/dist/api/resources/score/client/requests/ScoreCreateParams.d.ts +1 -0
- package/dist/api/resources/testcase/client/Client.d.ts +8 -10
- package/dist/api/resources/testcase/client/Client.js +17 -13
- 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 +1 -1
- package/dist/api/resources/testrecord/client/Client.js +3 -3
- package/dist/api/resources/testset/client/Client.d.ts +4 -4
- package/dist/api/resources/testset/client/Client.js +9 -9
- package/dist/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -0
- package/dist/api/resources/traces/client/Client.js +1 -1
- 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/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/package.json +1 -1
- 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/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
|
@@ -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
|
*
|
|
@@ -73,7 +73,7 @@ class Score {
|
|
|
73
73
|
const _response = yield core.fetcher({
|
|
74
74
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : 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.4.0", "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,
|
|
@@ -147,9 +147,9 @@ class Score {
|
|
|
147
147
|
/**
|
|
148
148
|
* Update a score
|
|
149
149
|
*
|
|
150
|
-
* @param {number} runId
|
|
151
|
-
* @param {number} testrecordId
|
|
152
|
-
* @param {number} scoreId
|
|
150
|
+
* @param {number} runId - The run ID that created the test record to be scored.
|
|
151
|
+
* @param {number} testrecordId - The ID of the testrecord whose score will be updated.
|
|
152
|
+
* @param {number} scoreId - The ID of the score to be updated.
|
|
153
153
|
* @param {Scorecard.ScoreUpdateParams} request
|
|
154
154
|
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
155
155
|
*
|
|
@@ -167,7 +167,7 @@ class Score {
|
|
|
167
167
|
const _response = yield core.fetcher({
|
|
168
168
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score/${encodeURIComponent(scoreId)}`),
|
|
169
169
|
method: "PATCH",
|
|
170
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
170
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
171
171
|
contentType: "application/json",
|
|
172
172
|
body: yield serializers.ScoreUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
173
173
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -20,7 +20,7 @@ export declare class Testcase {
|
|
|
20
20
|
/**
|
|
21
21
|
* Create a new Testcase
|
|
22
22
|
*
|
|
23
|
-
* @param {number} testsetId
|
|
23
|
+
* @param {number} testsetId - The ID of the Testset to create the Testcase in.
|
|
24
24
|
* @param {Scorecard.TestcaseCreateParams} request
|
|
25
25
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
26
|
*
|
|
@@ -30,16 +30,14 @@ export declare class Testcase {
|
|
|
30
30
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
|
-
* await scorecard.testcase.create(1
|
|
34
|
-
* userQuery: "user_query"
|
|
35
|
-
* })
|
|
33
|
+
* await scorecard.testcase.create(1)
|
|
36
34
|
*/
|
|
37
|
-
create(testsetId: number, request
|
|
35
|
+
create(testsetId: number, request?: Scorecard.TestcaseCreateParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
|
|
38
36
|
/**
|
|
39
37
|
* Retrieve Testcase data
|
|
40
38
|
*
|
|
41
|
-
* @param {number} testcaseId
|
|
42
|
-
* @param {number} testsetId
|
|
39
|
+
* @param {number} testcaseId - The ID of the Testcase to retrieve.
|
|
40
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the Testcase from.
|
|
43
41
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
42
|
*
|
|
45
43
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -54,8 +52,8 @@ export declare class Testcase {
|
|
|
54
52
|
/**
|
|
55
53
|
* Delete a Testcase
|
|
56
54
|
*
|
|
57
|
-
* @param {number} testcaseId
|
|
58
|
-
* @param {number} testsetId
|
|
55
|
+
* @param {number} testcaseId - The ID of the Testcase to delete.
|
|
56
|
+
* @param {number} testsetId - The ID of the Testset to delete the Testcase from.
|
|
59
57
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
58
|
*
|
|
61
59
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -66,7 +64,7 @@ export declare class Testcase {
|
|
|
66
64
|
* @example
|
|
67
65
|
* await scorecard.testcase.delete(1, 1)
|
|
68
66
|
*/
|
|
69
|
-
delete(testcaseId: number, testsetId: number, requestOptions?: Testcase.RequestOptions): Promise<
|
|
67
|
+
delete(testcaseId: number, testsetId: number, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestcaseDeletionResponse>;
|
|
70
68
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
71
69
|
"X-API-Key": string;
|
|
72
70
|
}>;
|
|
@@ -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,17 +62,15 @@ 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) {
|
|
67
|
+
create(testsetId, request = {}, requestOptions) {
|
|
70
68
|
var _a;
|
|
71
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
70
|
const _response = yield core.fetcher({
|
|
73
71
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : 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.4.0", "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,
|
|
@@ -146,8 +144,8 @@ class Testcase {
|
|
|
146
144
|
/**
|
|
147
145
|
* Retrieve Testcase data
|
|
148
146
|
*
|
|
149
|
-
* @param {number} testcaseId
|
|
150
|
-
* @param {number} testsetId
|
|
147
|
+
* @param {number} testcaseId - The ID of the Testcase to retrieve.
|
|
148
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the Testcase from.
|
|
151
149
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
152
150
|
*
|
|
153
151
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -164,7 +162,7 @@ class Testcase {
|
|
|
164
162
|
const _response = yield core.fetcher({
|
|
165
163
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
|
|
166
164
|
method: "GET",
|
|
167
|
-
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.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
168
166
|
contentType: "application/json",
|
|
169
167
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
170
168
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -237,8 +235,8 @@ class Testcase {
|
|
|
237
235
|
/**
|
|
238
236
|
* Delete a Testcase
|
|
239
237
|
*
|
|
240
|
-
* @param {number} testcaseId
|
|
241
|
-
* @param {number} testsetId
|
|
238
|
+
* @param {number} testcaseId - The ID of the Testcase to delete.
|
|
239
|
+
* @param {number} testsetId - The ID of the Testset to delete the Testcase from.
|
|
242
240
|
* @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
|
|
243
241
|
*
|
|
244
242
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -255,13 +253,19 @@ class Testcase {
|
|
|
255
253
|
const _response = yield core.fetcher({
|
|
256
254
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
|
|
257
255
|
method: "DELETE",
|
|
258
|
-
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.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
259
257
|
contentType: "application/json",
|
|
260
258
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
261
259
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
262
260
|
});
|
|
263
261
|
if (_response.ok) {
|
|
264
|
-
return _response.body
|
|
262
|
+
return yield serializers.TestcaseDeletionResponse.parseOrThrow(_response.body, {
|
|
263
|
+
unrecognizedObjectKeys: "passthrough",
|
|
264
|
+
allowUnrecognizedUnionMembers: true,
|
|
265
|
+
allowUnrecognizedEnumValues: true,
|
|
266
|
+
skipValidation: true,
|
|
267
|
+
breadcrumbsPrefix: ["response"],
|
|
268
|
+
});
|
|
265
269
|
}
|
|
266
270
|
if (_response.error.reason === "status-code") {
|
|
267
271
|
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;
|
|
@@ -36,7 +36,7 @@ export declare class Testrecord {
|
|
|
36
36
|
/**
|
|
37
37
|
* Create a new Testrecord
|
|
38
38
|
*
|
|
39
|
-
* @param {number} runId
|
|
39
|
+
* @param {number} runId - The ID of the Run to create the Testrecord in.
|
|
40
40
|
* @param {Scorecard.TestrecordCreateParams} request
|
|
41
41
|
* @param {Testrecord.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
42
|
*
|
|
@@ -70,7 +70,7 @@ class Testrecord {
|
|
|
70
70
|
const _response = yield core.fetcher({
|
|
71
71
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : 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.4.0", "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,
|
|
@@ -143,7 +143,7 @@ class Testrecord {
|
|
|
143
143
|
/**
|
|
144
144
|
* Create a new Testrecord
|
|
145
145
|
*
|
|
146
|
-
* @param {number} runId
|
|
146
|
+
* @param {number} runId - The ID of the Run to create the Testrecord in.
|
|
147
147
|
* @param {Scorecard.TestrecordCreateParams} request
|
|
148
148
|
* @param {Testrecord.RequestOptions} requestOptions - Request-specific configuration.
|
|
149
149
|
*
|
|
@@ -161,7 +161,7 @@ class Testrecord {
|
|
|
161
161
|
const _response = yield core.fetcher({
|
|
162
162
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord`),
|
|
163
163
|
method: "POST",
|
|
164
|
-
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.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
165
165
|
contentType: "application/json",
|
|
166
166
|
body: yield serializers.TestrecordCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
167
167
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -20,7 +20,7 @@ export declare class Testset {
|
|
|
20
20
|
/**
|
|
21
21
|
* Retrieve Testset metadata without Testcase data
|
|
22
22
|
*
|
|
23
|
-
* @param {number} testsetId
|
|
23
|
+
* @param {number} testsetId - The ID of the Testset to retrieve.
|
|
24
24
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
25
|
*
|
|
26
26
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -35,7 +35,7 @@ export declare class Testset {
|
|
|
35
35
|
/**
|
|
36
36
|
* Delete a Testset
|
|
37
37
|
*
|
|
38
|
-
* @param {number} testsetId
|
|
38
|
+
* @param {number} testsetId - The ID of the Testset to delete.
|
|
39
39
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
40
|
*
|
|
41
41
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -67,7 +67,7 @@ export declare class Testset {
|
|
|
67
67
|
/**
|
|
68
68
|
* Read the schema of a Testset
|
|
69
69
|
*
|
|
70
|
-
* @param {number} testsetId
|
|
70
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the schema from.
|
|
71
71
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
72
|
*
|
|
73
73
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -82,7 +82,7 @@ export declare class Testset {
|
|
|
82
82
|
/**
|
|
83
83
|
* Retrieve all Testcases from a Testset
|
|
84
84
|
*
|
|
85
|
-
* @param {number} testsetId
|
|
85
|
+
* @param {number} testsetId - The Testset ID to retrieve testcases from.
|
|
86
86
|
* @param {Scorecard.TestsetGetTestcasesRequest} request
|
|
87
87
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
88
88
|
*
|
|
@@ -52,7 +52,7 @@ class Testset {
|
|
|
52
52
|
/**
|
|
53
53
|
* Retrieve Testset metadata without Testcase data
|
|
54
54
|
*
|
|
55
|
-
* @param {number} testsetId
|
|
55
|
+
* @param {number} testsetId - The ID of the Testset to retrieve.
|
|
56
56
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
57
|
*
|
|
58
58
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -69,7 +69,7 @@ class Testset {
|
|
|
69
69
|
const _response = yield core.fetcher({
|
|
70
70
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}`),
|
|
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.4.0", "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,
|
|
@@ -142,7 +142,7 @@ class Testset {
|
|
|
142
142
|
/**
|
|
143
143
|
* Delete a Testset
|
|
144
144
|
*
|
|
145
|
-
* @param {number} testsetId
|
|
145
|
+
* @param {number} testsetId - The ID of the Testset to delete.
|
|
146
146
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
147
147
|
*
|
|
148
148
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -159,7 +159,7 @@ class Testset {
|
|
|
159
159
|
const _response = yield core.fetcher({
|
|
160
160
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}`),
|
|
161
161
|
method: "DELETE",
|
|
162
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
162
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
163
163
|
contentType: "application/json",
|
|
164
164
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
165
165
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -251,7 +251,7 @@ class Testset {
|
|
|
251
251
|
const _response = yield core.fetcher({
|
|
252
252
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, "v1/testset"),
|
|
253
253
|
method: "POST",
|
|
254
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
254
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
255
255
|
contentType: "application/json",
|
|
256
256
|
body: yield serializers.TestsetCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
257
257
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -325,7 +325,7 @@ class Testset {
|
|
|
325
325
|
/**
|
|
326
326
|
* Read the schema of a Testset
|
|
327
327
|
*
|
|
328
|
-
* @param {number} testsetId
|
|
328
|
+
* @param {number} testsetId - The ID of the Testset to retrieve the schema from.
|
|
329
329
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
330
330
|
*
|
|
331
331
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -342,7 +342,7 @@ class Testset {
|
|
|
342
342
|
const _response = yield core.fetcher({
|
|
343
343
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/schema`),
|
|
344
344
|
method: "GET",
|
|
345
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
345
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
346
346
|
contentType: "application/json",
|
|
347
347
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
348
348
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -415,7 +415,7 @@ class Testset {
|
|
|
415
415
|
/**
|
|
416
416
|
* Retrieve all Testcases from a Testset
|
|
417
417
|
*
|
|
418
|
-
* @param {number} testsetId
|
|
418
|
+
* @param {number} testsetId - The Testset ID to retrieve testcases from.
|
|
419
419
|
* @param {Scorecard.TestsetGetTestcasesRequest} request
|
|
420
420
|
* @param {Testset.RequestOptions} requestOptions - Request-specific configuration.
|
|
421
421
|
*
|
|
@@ -441,7 +441,7 @@ class Testset {
|
|
|
441
441
|
const _response = yield core.fetcher({
|
|
442
442
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase`),
|
|
443
443
|
method: "GET",
|
|
444
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
444
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
445
445
|
contentType: "application/json",
|
|
446
446
|
queryParameters: _queryParams,
|
|
447
447
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -69,7 +69,7 @@ class Traces {
|
|
|
69
69
|
const _response = yield core.fetcher({
|
|
70
70
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}/spans`),
|
|
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.4.0", "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,
|
package/api/types/Grade.d.ts
CHANGED
|
@@ -12,7 +12,9 @@ export interface Grade {
|
|
|
12
12
|
binaryScore?: boolean;
|
|
13
13
|
intScore?: number;
|
|
14
14
|
reasoning?: string;
|
|
15
|
+
/** Indicates if a human should assign a grade. */
|
|
15
16
|
humanEval?: boolean;
|
|
17
|
+
/** The status of the grade. */
|
|
16
18
|
status?: Scorecard.ScoreStatus;
|
|
17
19
|
errorMessage?: string;
|
|
18
20
|
createdAt?: Date;
|
package/api/types/TestCase.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import * as Scorecard from "../index";
|
|
|
5
5
|
export interface TestCase {
|
|
6
6
|
id?: number;
|
|
7
7
|
createdAt?: Date;
|
|
8
|
+
/** The ID of the testset the testcase belongs to. */
|
|
8
9
|
testsetId: number;
|
|
10
|
+
/** The user query for the testcase. */
|
|
9
11
|
userQuery: string;
|
|
10
12
|
context?: string;
|
|
11
13
|
ideal?: string;
|
|
@@ -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 TestCaseCustomInputsValue =
|
|
5
|
+
export declare type TestCaseCustomInputsValue = 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 TestCaseCustomLabelsValue =
|
|
5
|
+
export declare type TestCaseCustomLabelsValue = Scorecard.FileUrl | Scorecard.JsonObject | string | number | number | boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface TestcaseDeletionResponse {
|
|
5
|
+
/** The ID of the testcase that was deleted. */
|
|
6
|
+
id: number;
|
|
7
|
+
/** The message indicating the testcase was deleted. */
|
|
8
|
+
detail: string;
|
|
9
|
+
}
|
|
@@ -12,7 +12,6 @@ export interface Testrecord {
|
|
|
12
12
|
context?: string;
|
|
13
13
|
modelResponse?: string;
|
|
14
14
|
ideal?: string;
|
|
15
|
-
fullPrompt?: string;
|
|
16
15
|
customInputs?: Record<string, Scorecard.TestrecordCustomInputsValue | undefined>;
|
|
17
16
|
customLabels?: Record<string, Scorecard.TestrecordCustomLabelsValue | undefined>;
|
|
18
17
|
customOutputs?: Record<string, Scorecard.TestrecordCustomOutputsValue | undefined>;
|
package/api/types/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from "./TestCase";
|
|
|
24
24
|
export * from "./TestCaseCreate";
|
|
25
25
|
export * from "./TestRecordCreate";
|
|
26
26
|
export * from "./TestSetCreate";
|
|
27
|
+
export * from "./TestcaseDeletionResponse";
|
|
27
28
|
export * from "./TestrecordCustomInputsValue";
|
|
28
29
|
export * from "./TestrecordCustomLabelsValue";
|
|
29
30
|
export * from "./TestrecordCustomOutputsValue";
|
package/api/types/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __exportStar(require("./TestCase"), exports);
|
|
|
40
40
|
__exportStar(require("./TestCaseCreate"), exports);
|
|
41
41
|
__exportStar(require("./TestRecordCreate"), exports);
|
|
42
42
|
__exportStar(require("./TestSetCreate"), exports);
|
|
43
|
+
__exportStar(require("./TestcaseDeletionResponse"), exports);
|
|
43
44
|
__exportStar(require("./TestrecordCustomInputsValue"), exports);
|
|
44
45
|
__exportStar(require("./TestrecordCustomLabelsValue"), exports);
|
|
45
46
|
__exportStar(require("./TestrecordCustomOutputsValue"), exports);
|
|
@@ -18,7 +18,11 @@ export declare class Prompt {
|
|
|
18
18
|
protected readonly _options: Prompt.Options;
|
|
19
19
|
constructor(_options: Prompt.Options);
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
|
|
22
|
+
*
|
|
23
|
+
* A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
|
|
24
|
+
*
|
|
25
|
+
* 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 descendents 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 prod.
|
|
22
26
|
*
|
|
23
27
|
* @param {Scorecard.PromptCreateParams} request
|
|
24
28
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -30,7 +34,7 @@ export declare class Prompt {
|
|
|
30
34
|
*
|
|
31
35
|
* @example
|
|
32
36
|
* await scorecard.prompt.create({
|
|
33
|
-
* promptTemplate: "
|
|
37
|
+
* promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
|
|
34
38
|
* name: "Prompt Name",
|
|
35
39
|
* description: "Description of the prompt",
|
|
36
40
|
* modelParams: {
|
|
@@ -43,7 +47,7 @@ export declare class Prompt {
|
|
|
43
47
|
*
|
|
44
48
|
* @example
|
|
45
49
|
* await scorecard.prompt.create({
|
|
46
|
-
* promptTemplate: "
|
|
50
|
+
* promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
|
|
47
51
|
* parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
|
|
48
52
|
* description: "Description of the prompt",
|
|
49
53
|
* modelParams: {
|
|
@@ -57,35 +61,24 @@ export declare class Prompt {
|
|
|
57
61
|
*/
|
|
58
62
|
create(request: Scorecard.PromptCreateParams, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
59
63
|
/**
|
|
60
|
-
* Retrieve
|
|
61
|
-
*
|
|
62
|
-
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
-
*
|
|
64
|
-
* @throws {@link Scorecard.UnauthorizedError}
|
|
65
|
-
* @throws {@link Scorecard.ForbiddenError}
|
|
66
|
-
* @throws {@link Scorecard.NotFoundError}
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* await scorecard.prompt.getRoots()
|
|
70
|
-
*/
|
|
71
|
-
getRoots(requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt[]>;
|
|
72
|
-
/**
|
|
73
|
-
* Retrieve prod prompts for the org
|
|
64
|
+
* Retrieve a prompt by id
|
|
74
65
|
*
|
|
66
|
+
* @param {string} id - The id of the prompt to get.
|
|
75
67
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
76
68
|
*
|
|
77
69
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
78
70
|
* @throws {@link Scorecard.ForbiddenError}
|
|
79
71
|
* @throws {@link Scorecard.NotFoundError}
|
|
72
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
80
73
|
*
|
|
81
74
|
* @example
|
|
82
|
-
* await scorecard.prompt.
|
|
75
|
+
* await scorecard.prompt.get("id")
|
|
83
76
|
*/
|
|
84
|
-
|
|
77
|
+
get(id: string, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
85
78
|
/**
|
|
86
|
-
*
|
|
79
|
+
* Delete a root prompt and all of its children.
|
|
87
80
|
*
|
|
88
|
-
* @param {string} id - The id of the prompt to
|
|
81
|
+
* @param {string} id - The id of the root prompt to delete.
|
|
89
82
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
83
|
*
|
|
91
84
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -94,11 +87,13 @@ export declare class Prompt {
|
|
|
94
87
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
95
88
|
*
|
|
96
89
|
* @example
|
|
97
|
-
* await scorecard.prompt.
|
|
90
|
+
* await scorecard.prompt.delete("id")
|
|
98
91
|
*/
|
|
99
|
-
|
|
92
|
+
delete(id: string, requestOptions?: Prompt.RequestOptions): Promise<unknown>;
|
|
100
93
|
/**
|
|
101
|
-
* Update a prompt
|
|
94
|
+
* Update a prompt.
|
|
95
|
+
*
|
|
96
|
+
* `is_prod` tags the provided prompt as the production prompt within the prompt graph.
|
|
102
97
|
*
|
|
103
98
|
* @param {string} id - The id of the prompt to update.
|
|
104
99
|
* @param {Scorecard.PromptUpdateParams} request
|
|
@@ -111,7 +106,7 @@ export declare class Prompt {
|
|
|
111
106
|
*
|
|
112
107
|
* @example
|
|
113
108
|
* await scorecard.prompt.update("id", {
|
|
114
|
-
*
|
|
109
|
+
* isProd: true
|
|
115
110
|
* })
|
|
116
111
|
*/
|
|
117
112
|
update(id: string, request?: Scorecard.PromptUpdateParams, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
@@ -130,21 +125,6 @@ export declare class Prompt {
|
|
|
130
125
|
* await scorecard.prompt.getByName("name")
|
|
131
126
|
*/
|
|
132
127
|
getByName(name: string, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
|
|
133
|
-
/**
|
|
134
|
-
* Retrieve all nodes within the same graph as the prompt, sorted by created_at desc
|
|
135
|
-
*
|
|
136
|
-
* @param {string} id - The id of the prompt.
|
|
137
|
-
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
138
|
-
*
|
|
139
|
-
* @throws {@link Scorecard.UnauthorizedError}
|
|
140
|
-
* @throws {@link Scorecard.ForbiddenError}
|
|
141
|
-
* @throws {@link Scorecard.NotFoundError}
|
|
142
|
-
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* await scorecard.prompt.getGraph("id")
|
|
146
|
-
*/
|
|
147
|
-
getGraph(id: string, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt[]>;
|
|
148
128
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
149
129
|
"X-API-Key": string;
|
|
150
130
|
}>;
|