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
|
@@ -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
|
}>;
|
|
@@ -50,7 +50,11 @@ class Prompt {
|
|
|
50
50
|
this._options = _options;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
|
|
54
|
+
*
|
|
55
|
+
* A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
|
|
56
|
+
*
|
|
57
|
+
* 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.
|
|
54
58
|
*
|
|
55
59
|
* @param {Scorecard.PromptCreateParams} request
|
|
56
60
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -62,7 +66,7 @@ class Prompt {
|
|
|
62
66
|
*
|
|
63
67
|
* @example
|
|
64
68
|
* await scorecard.prompt.create({
|
|
65
|
-
* promptTemplate: "
|
|
69
|
+
* 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>",
|
|
66
70
|
* name: "Prompt Name",
|
|
67
71
|
* description: "Description of the prompt",
|
|
68
72
|
* modelParams: {
|
|
@@ -75,7 +79,7 @@ class Prompt {
|
|
|
75
79
|
*
|
|
76
80
|
* @example
|
|
77
81
|
* await scorecard.prompt.create({
|
|
78
|
-
* promptTemplate: "
|
|
82
|
+
* 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>",
|
|
79
83
|
* parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
|
|
80
84
|
* description: "Description of the prompt",
|
|
81
85
|
* modelParams: {
|
|
@@ -93,7 +97,7 @@ class Prompt {
|
|
|
93
97
|
const _response = yield core.fetcher({
|
|
94
98
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, "v1/prompt"),
|
|
95
99
|
method: "POST",
|
|
96
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
100
|
+
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())),
|
|
97
101
|
contentType: "application/json",
|
|
98
102
|
body: yield serializers.PromptCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
99
103
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -165,30 +169,32 @@ class Prompt {
|
|
|
165
169
|
});
|
|
166
170
|
}
|
|
167
171
|
/**
|
|
168
|
-
* Retrieve
|
|
172
|
+
* Retrieve a prompt by id
|
|
169
173
|
*
|
|
174
|
+
* @param {string} id - The id of the prompt to get.
|
|
170
175
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
171
176
|
*
|
|
172
177
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
173
178
|
* @throws {@link Scorecard.ForbiddenError}
|
|
174
179
|
* @throws {@link Scorecard.NotFoundError}
|
|
180
|
+
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
175
181
|
*
|
|
176
182
|
* @example
|
|
177
|
-
* await scorecard.prompt.
|
|
183
|
+
* await scorecard.prompt.get("id")
|
|
178
184
|
*/
|
|
179
|
-
|
|
185
|
+
get(id, requestOptions) {
|
|
180
186
|
var _a;
|
|
181
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
182
188
|
const _response = yield core.fetcher({
|
|
183
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default,
|
|
189
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
|
|
184
190
|
method: "GET",
|
|
185
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
191
|
+
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())),
|
|
186
192
|
contentType: "application/json",
|
|
187
193
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
188
194
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
189
195
|
});
|
|
190
196
|
if (_response.ok) {
|
|
191
|
-
return yield serializers.
|
|
197
|
+
return yield serializers.Prompt.parseOrThrow(_response.body, {
|
|
192
198
|
unrecognizedObjectKeys: "passthrough",
|
|
193
199
|
allowUnrecognizedUnionMembers: true,
|
|
194
200
|
allowUnrecognizedEnumValues: true,
|
|
@@ -222,80 +228,8 @@ class Prompt {
|
|
|
222
228
|
skipValidation: true,
|
|
223
229
|
breadcrumbsPrefix: ["response"],
|
|
224
230
|
}));
|
|
225
|
-
|
|
226
|
-
throw new
|
|
227
|
-
statusCode: _response.error.statusCode,
|
|
228
|
-
body: _response.error.body,
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
switch (_response.error.reason) {
|
|
233
|
-
case "non-json":
|
|
234
|
-
throw new errors.ScorecardError({
|
|
235
|
-
statusCode: _response.error.statusCode,
|
|
236
|
-
body: _response.error.rawBody,
|
|
237
|
-
});
|
|
238
|
-
case "timeout":
|
|
239
|
-
throw new errors.ScorecardTimeoutError();
|
|
240
|
-
case "unknown":
|
|
241
|
-
throw new errors.ScorecardError({
|
|
242
|
-
message: _response.error.errorMessage,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Retrieve prod prompts for the org
|
|
249
|
-
*
|
|
250
|
-
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
251
|
-
*
|
|
252
|
-
* @throws {@link Scorecard.UnauthorizedError}
|
|
253
|
-
* @throws {@link Scorecard.ForbiddenError}
|
|
254
|
-
* @throws {@link Scorecard.NotFoundError}
|
|
255
|
-
*
|
|
256
|
-
* @example
|
|
257
|
-
* await scorecard.prompt.getProds()
|
|
258
|
-
*/
|
|
259
|
-
getProds(requestOptions) {
|
|
260
|
-
var _a;
|
|
261
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
-
const _response = yield core.fetcher({
|
|
263
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, "v1/prompt/prods"),
|
|
264
|
-
method: "GET",
|
|
265
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
266
|
-
contentType: "application/json",
|
|
267
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
268
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
269
|
-
});
|
|
270
|
-
if (_response.ok) {
|
|
271
|
-
return yield serializers.prompt.getProds.Response.parseOrThrow(_response.body, {
|
|
272
|
-
unrecognizedObjectKeys: "passthrough",
|
|
273
|
-
allowUnrecognizedUnionMembers: true,
|
|
274
|
-
allowUnrecognizedEnumValues: true,
|
|
275
|
-
skipValidation: true,
|
|
276
|
-
breadcrumbsPrefix: ["response"],
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
if (_response.error.reason === "status-code") {
|
|
280
|
-
switch (_response.error.statusCode) {
|
|
281
|
-
case 401:
|
|
282
|
-
throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
283
|
-
unrecognizedObjectKeys: "passthrough",
|
|
284
|
-
allowUnrecognizedUnionMembers: true,
|
|
285
|
-
allowUnrecognizedEnumValues: true,
|
|
286
|
-
skipValidation: true,
|
|
287
|
-
breadcrumbsPrefix: ["response"],
|
|
288
|
-
}));
|
|
289
|
-
case 403:
|
|
290
|
-
throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
291
|
-
unrecognizedObjectKeys: "passthrough",
|
|
292
|
-
allowUnrecognizedUnionMembers: true,
|
|
293
|
-
allowUnrecognizedEnumValues: true,
|
|
294
|
-
skipValidation: true,
|
|
295
|
-
breadcrumbsPrefix: ["response"],
|
|
296
|
-
}));
|
|
297
|
-
case 404:
|
|
298
|
-
throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
231
|
+
case 422:
|
|
232
|
+
throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
299
233
|
unrecognizedObjectKeys: "passthrough",
|
|
300
234
|
allowUnrecognizedUnionMembers: true,
|
|
301
235
|
allowUnrecognizedEnumValues: true,
|
|
@@ -325,9 +259,9 @@ class Prompt {
|
|
|
325
259
|
});
|
|
326
260
|
}
|
|
327
261
|
/**
|
|
328
|
-
*
|
|
262
|
+
* Delete a root prompt and all of its children.
|
|
329
263
|
*
|
|
330
|
-
* @param {string} id - The id of the prompt to
|
|
264
|
+
* @param {string} id - The id of the root prompt to delete.
|
|
331
265
|
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
332
266
|
*
|
|
333
267
|
* @throws {@link Scorecard.UnauthorizedError}
|
|
@@ -336,27 +270,21 @@ class Prompt {
|
|
|
336
270
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
337
271
|
*
|
|
338
272
|
* @example
|
|
339
|
-
* await scorecard.prompt.
|
|
273
|
+
* await scorecard.prompt.delete("id")
|
|
340
274
|
*/
|
|
341
|
-
|
|
275
|
+
delete(id, requestOptions) {
|
|
342
276
|
var _a;
|
|
343
277
|
return __awaiter(this, void 0, void 0, function* () {
|
|
344
278
|
const _response = yield core.fetcher({
|
|
345
279
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
|
|
346
|
-
method: "
|
|
347
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
280
|
+
method: "DELETE",
|
|
281
|
+
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())),
|
|
348
282
|
contentType: "application/json",
|
|
349
283
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
350
284
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
351
285
|
});
|
|
352
286
|
if (_response.ok) {
|
|
353
|
-
return
|
|
354
|
-
unrecognizedObjectKeys: "passthrough",
|
|
355
|
-
allowUnrecognizedUnionMembers: true,
|
|
356
|
-
allowUnrecognizedEnumValues: true,
|
|
357
|
-
skipValidation: true,
|
|
358
|
-
breadcrumbsPrefix: ["response"],
|
|
359
|
-
});
|
|
287
|
+
return _response.body;
|
|
360
288
|
}
|
|
361
289
|
if (_response.error.reason === "status-code") {
|
|
362
290
|
switch (_response.error.statusCode) {
|
|
@@ -415,7 +343,9 @@ class Prompt {
|
|
|
415
343
|
});
|
|
416
344
|
}
|
|
417
345
|
/**
|
|
418
|
-
* Update a prompt
|
|
346
|
+
* Update a prompt.
|
|
347
|
+
*
|
|
348
|
+
* `is_prod` tags the provided prompt as the production prompt within the prompt graph.
|
|
419
349
|
*
|
|
420
350
|
* @param {string} id - The id of the prompt to update.
|
|
421
351
|
* @param {Scorecard.PromptUpdateParams} request
|
|
@@ -428,7 +358,7 @@ class Prompt {
|
|
|
428
358
|
*
|
|
429
359
|
* @example
|
|
430
360
|
* await scorecard.prompt.update("id", {
|
|
431
|
-
*
|
|
361
|
+
* isProd: true
|
|
432
362
|
* })
|
|
433
363
|
*/
|
|
434
364
|
update(id, request = {}, requestOptions) {
|
|
@@ -437,7 +367,7 @@ class Prompt {
|
|
|
437
367
|
const _response = yield core.fetcher({
|
|
438
368
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
|
|
439
369
|
method: "PATCH",
|
|
440
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
370
|
+
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())),
|
|
441
371
|
contentType: "application/json",
|
|
442
372
|
body: yield serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
443
373
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -528,7 +458,7 @@ class Prompt {
|
|
|
528
458
|
const _response = yield core.fetcher({
|
|
529
459
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/name/${encodeURIComponent(name)}`),
|
|
530
460
|
method: "GET",
|
|
531
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
461
|
+
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())),
|
|
532
462
|
contentType: "application/json",
|
|
533
463
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
534
464
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -598,96 +528,6 @@ class Prompt {
|
|
|
598
528
|
}
|
|
599
529
|
});
|
|
600
530
|
}
|
|
601
|
-
/**
|
|
602
|
-
* Retrieve all nodes within the same graph as the prompt, sorted by created_at desc
|
|
603
|
-
*
|
|
604
|
-
* @param {string} id - The id of the prompt.
|
|
605
|
-
* @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
|
|
606
|
-
*
|
|
607
|
-
* @throws {@link Scorecard.UnauthorizedError}
|
|
608
|
-
* @throws {@link Scorecard.ForbiddenError}
|
|
609
|
-
* @throws {@link Scorecard.NotFoundError}
|
|
610
|
-
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
611
|
-
*
|
|
612
|
-
* @example
|
|
613
|
-
* await scorecard.prompt.getGraph("id")
|
|
614
|
-
*/
|
|
615
|
-
getGraph(id, requestOptions) {
|
|
616
|
-
var _a;
|
|
617
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
618
|
-
const _response = yield core.fetcher({
|
|
619
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}/graph`),
|
|
620
|
-
method: "GET",
|
|
621
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
622
|
-
contentType: "application/json",
|
|
623
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
624
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
625
|
-
});
|
|
626
|
-
if (_response.ok) {
|
|
627
|
-
return yield serializers.prompt.getGraph.Response.parseOrThrow(_response.body, {
|
|
628
|
-
unrecognizedObjectKeys: "passthrough",
|
|
629
|
-
allowUnrecognizedUnionMembers: true,
|
|
630
|
-
allowUnrecognizedEnumValues: true,
|
|
631
|
-
skipValidation: true,
|
|
632
|
-
breadcrumbsPrefix: ["response"],
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
if (_response.error.reason === "status-code") {
|
|
636
|
-
switch (_response.error.statusCode) {
|
|
637
|
-
case 401:
|
|
638
|
-
throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
|
|
639
|
-
unrecognizedObjectKeys: "passthrough",
|
|
640
|
-
allowUnrecognizedUnionMembers: true,
|
|
641
|
-
allowUnrecognizedEnumValues: true,
|
|
642
|
-
skipValidation: true,
|
|
643
|
-
breadcrumbsPrefix: ["response"],
|
|
644
|
-
}));
|
|
645
|
-
case 403:
|
|
646
|
-
throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
|
|
647
|
-
unrecognizedObjectKeys: "passthrough",
|
|
648
|
-
allowUnrecognizedUnionMembers: true,
|
|
649
|
-
allowUnrecognizedEnumValues: true,
|
|
650
|
-
skipValidation: true,
|
|
651
|
-
breadcrumbsPrefix: ["response"],
|
|
652
|
-
}));
|
|
653
|
-
case 404:
|
|
654
|
-
throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
|
|
655
|
-
unrecognizedObjectKeys: "passthrough",
|
|
656
|
-
allowUnrecognizedUnionMembers: true,
|
|
657
|
-
allowUnrecognizedEnumValues: true,
|
|
658
|
-
skipValidation: true,
|
|
659
|
-
breadcrumbsPrefix: ["response"],
|
|
660
|
-
}));
|
|
661
|
-
case 422:
|
|
662
|
-
throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
663
|
-
unrecognizedObjectKeys: "passthrough",
|
|
664
|
-
allowUnrecognizedUnionMembers: true,
|
|
665
|
-
allowUnrecognizedEnumValues: true,
|
|
666
|
-
skipValidation: true,
|
|
667
|
-
breadcrumbsPrefix: ["response"],
|
|
668
|
-
}));
|
|
669
|
-
default:
|
|
670
|
-
throw new errors.ScorecardError({
|
|
671
|
-
statusCode: _response.error.statusCode,
|
|
672
|
-
body: _response.error.body,
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
switch (_response.error.reason) {
|
|
677
|
-
case "non-json":
|
|
678
|
-
throw new errors.ScorecardError({
|
|
679
|
-
statusCode: _response.error.statusCode,
|
|
680
|
-
body: _response.error.rawBody,
|
|
681
|
-
});
|
|
682
|
-
case "timeout":
|
|
683
|
-
throw new errors.ScorecardTimeoutError();
|
|
684
|
-
case "unknown":
|
|
685
|
-
throw new errors.ScorecardError({
|
|
686
|
-
message: _response.error.errorMessage,
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
531
|
_getCustomAuthorizationHeaders() {
|
|
692
532
|
var _a;
|
|
693
533
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5,7 +5,7 @@ import * as Scorecard from "../../../../index";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* promptTemplate: "
|
|
8
|
+
* 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>",
|
|
9
9
|
* name: "Prompt Name",
|
|
10
10
|
* description: "Description of the prompt",
|
|
11
11
|
* modelParams: {
|
|
@@ -18,7 +18,7 @@ import * as Scorecard from "../../../../index";
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* {
|
|
21
|
-
* promptTemplate: "
|
|
21
|
+
* 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>",
|
|
22
22
|
* parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
|
|
23
23
|
* description: "Description of the prompt",
|
|
24
24
|
* modelParams: {
|
|
@@ -29,15 +29,7 @@ export declare class Run {
|
|
|
29
29
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
|
-
* await scorecard.run.create(
|
|
33
|
-
* testsetId: 1,
|
|
34
|
-
* status: "RUNNING_EXECUTION",
|
|
35
|
-
* modelParams: {
|
|
36
|
-
* "param1": "value1",
|
|
37
|
-
* "param2": "value2"
|
|
38
|
-
* },
|
|
39
|
-
* metrics: [1, 2]
|
|
40
|
-
* })
|
|
32
|
+
* await scorecard.run.create()
|
|
41
33
|
*/
|
|
42
34
|
create(request?: Scorecard.RunCreateParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
43
35
|
/**
|
|
@@ -68,11 +60,9 @@ export declare class Run {
|
|
|
68
60
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
69
61
|
*
|
|
70
62
|
* @example
|
|
71
|
-
* await scorecard.run.updateStatus(1
|
|
72
|
-
* status: Scorecard.RunStatus.Pending
|
|
73
|
-
* })
|
|
63
|
+
* await scorecard.run.updateStatus(1)
|
|
74
64
|
*/
|
|
75
|
-
updateStatus(runId: number, request
|
|
65
|
+
updateStatus(runId: number, request?: Scorecard.UpdateStatusParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
|
|
76
66
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
77
67
|
"X-API-Key": string;
|
|
78
68
|
}>;
|
|
@@ -61,15 +61,7 @@ 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
67
|
var _a;
|
|
@@ -77,7 +69,7 @@ class Run {
|
|
|
77
69
|
const _response = yield core.fetcher({
|
|
78
70
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : 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.4.0", "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,
|
|
@@ -168,7 +160,7 @@ class Run {
|
|
|
168
160
|
const _response = yield core.fetcher({
|
|
169
161
|
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)}`),
|
|
170
162
|
method: "GET",
|
|
171
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.
|
|
163
|
+
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())),
|
|
172
164
|
contentType: "application/json",
|
|
173
165
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
174
166
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -251,17 +243,15 @@ class Run {
|
|
|
251
243
|
* @throws {@link Scorecard.UnprocessableEntityError}
|
|
252
244
|
*
|
|
253
245
|
* @example
|
|
254
|
-
* await scorecard.run.updateStatus(1
|
|
255
|
-
* status: Scorecard.RunStatus.Pending
|
|
256
|
-
* })
|
|
246
|
+
* await scorecard.run.updateStatus(1)
|
|
257
247
|
*/
|
|
258
|
-
updateStatus(runId, request, requestOptions) {
|
|
248
|
+
updateStatus(runId, request = {}, requestOptions) {
|
|
259
249
|
var _a;
|
|
260
250
|
return __awaiter(this, void 0, void 0, function* () {
|
|
261
251
|
const _response = yield core.fetcher({
|
|
262
252
|
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)}/status`),
|
|
263
253
|
method: "PATCH",
|
|
264
|
-
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())),
|
|
265
255
|
contentType: "application/json",
|
|
266
256
|
body: yield serializers.UpdateStatusParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
267
257
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -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;
|
|
@@ -69,7 +69,7 @@ class RunMetric {
|
|
|
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/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.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,
|
|
@@ -20,8 +20,8 @@ export declare class Score {
|
|
|
20
20
|
/**
|
|
21
21
|
* Create a score
|
|
22
22
|
*
|
|
23
|
-
* @param {number} runId
|
|
24
|
-
* @param {number} testrecordId
|
|
23
|
+
* @param {number} runId - The ID of the run that created the testrecord to be scored.
|
|
24
|
+
* @param {number} testrecordId - The ID of the testrecord to be scored.
|
|
25
25
|
* @param {Scorecard.ScoreCreateParams} request
|
|
26
26
|
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
27
|
*
|
|
@@ -39,9 +39,9 @@ export declare class Score {
|
|
|
39
39
|
/**
|
|
40
40
|
* Update a score
|
|
41
41
|
*
|
|
42
|
-
* @param {number} runId
|
|
43
|
-
* @param {number} testrecordId
|
|
44
|
-
* @param {number} scoreId
|
|
42
|
+
* @param {number} runId - The run ID that created the test record to be scored.
|
|
43
|
+
* @param {number} testrecordId - The ID of the testrecord whose score will be updated.
|
|
44
|
+
* @param {number} scoreId - The ID of the score to be updated.
|
|
45
45
|
* @param {Scorecard.ScoreUpdateParams} request
|
|
46
46
|
* @param {Score.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
47
|
*
|