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.
Files changed (140) hide show
  1. package/Client.d.ts +2 -0
  2. package/api/resources/prompt/client/Client.d.ts +22 -40
  3. package/api/resources/prompt/client/Client.js +50 -205
  4. package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -2
  5. package/api/resources/prompt/client/requests/PromptUpdateParams.d.ts +1 -2
  6. package/api/resources/run/client/Client.d.ts +5 -13
  7. package/api/resources/run/client/Client.js +18 -25
  8. package/api/resources/run/client/requests/RunCreateParams.d.ts +1 -9
  9. package/api/resources/run/client/requests/UpdateStatusParams.d.ts +2 -4
  10. package/api/resources/runMetric/client/Client.d.ts +2 -0
  11. package/api/resources/runMetric/client/Client.js +5 -4
  12. package/api/resources/score/client/Client.d.ts +7 -5
  13. package/api/resources/score/client/Client.js +15 -13
  14. package/api/resources/score/client/requests/ScoreCreateParams.d.ts +1 -0
  15. package/api/resources/testcase/client/Client.d.ts +10 -10
  16. package/api/resources/testcase/client/Client.js +29 -22
  17. package/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +3 -4
  18. package/api/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
  19. package/api/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
  20. package/api/resources/testrecord/client/Client.d.ts +3 -1
  21. package/api/resources/testrecord/client/Client.js +11 -9
  22. package/api/resources/testset/client/Client.d.ts +6 -4
  23. package/api/resources/testset/client/Client.js +29 -24
  24. package/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -0
  25. package/api/resources/traces/client/Client.d.ts +2 -0
  26. package/api/resources/traces/client/Client.js +5 -4
  27. package/api/types/Grade.d.ts +2 -0
  28. package/api/types/PaginatedTestcaseResponse.d.ts +1 -0
  29. package/api/types/TestCase.d.ts +2 -0
  30. package/api/types/TestCaseCustomInputsValue.d.ts +1 -1
  31. package/api/types/TestCaseCustomLabelsValue.d.ts +1 -1
  32. package/api/types/TestcaseDeletionResponse.d.ts +9 -0
  33. package/api/types/TestcaseDeletionResponse.js +5 -0
  34. package/api/types/Testrecord.d.ts +0 -1
  35. package/api/types/index.d.ts +1 -0
  36. package/api/types/index.js +1 -0
  37. package/core/fetcher/Fetcher.d.ts +1 -0
  38. package/core/fetcher/Fetcher.js +58 -7
  39. package/dist/Client.d.ts +2 -0
  40. package/dist/api/resources/prompt/client/Client.d.ts +22 -40
  41. package/dist/api/resources/prompt/client/Client.js +50 -205
  42. package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -2
  43. package/dist/api/resources/prompt/client/requests/PromptUpdateParams.d.ts +1 -2
  44. package/dist/api/resources/run/client/Client.d.ts +5 -13
  45. package/dist/api/resources/run/client/Client.js +18 -25
  46. package/dist/api/resources/run/client/requests/RunCreateParams.d.ts +1 -9
  47. package/dist/api/resources/run/client/requests/UpdateStatusParams.d.ts +2 -4
  48. package/dist/api/resources/runMetric/client/Client.d.ts +2 -0
  49. package/dist/api/resources/runMetric/client/Client.js +5 -4
  50. package/dist/api/resources/score/client/Client.d.ts +7 -5
  51. package/dist/api/resources/score/client/Client.js +15 -13
  52. package/dist/api/resources/score/client/requests/ScoreCreateParams.d.ts +1 -0
  53. package/dist/api/resources/testcase/client/Client.d.ts +10 -10
  54. package/dist/api/resources/testcase/client/Client.js +29 -22
  55. package/dist/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +3 -4
  56. package/dist/api/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
  57. package/dist/api/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
  58. package/dist/api/resources/testrecord/client/Client.d.ts +3 -1
  59. package/dist/api/resources/testrecord/client/Client.js +11 -9
  60. package/dist/api/resources/testset/client/Client.d.ts +6 -4
  61. package/dist/api/resources/testset/client/Client.js +29 -24
  62. package/dist/api/resources/testset/client/requests/TestsetGetTestcasesRequest.d.ts +6 -0
  63. package/dist/api/resources/traces/client/Client.d.ts +2 -0
  64. package/dist/api/resources/traces/client/Client.js +5 -4
  65. package/dist/api/types/Grade.d.ts +2 -0
  66. package/dist/api/types/PaginatedTestcaseResponse.d.ts +1 -0
  67. package/dist/api/types/TestCase.d.ts +2 -0
  68. package/dist/api/types/TestCaseCustomInputsValue.d.ts +1 -1
  69. package/dist/api/types/TestCaseCustomLabelsValue.d.ts +1 -1
  70. package/dist/api/types/TestcaseDeletionResponse.d.ts +9 -0
  71. package/dist/api/types/TestcaseDeletionResponse.js +5 -0
  72. package/dist/api/types/Testrecord.d.ts +0 -1
  73. package/dist/api/types/index.d.ts +1 -0
  74. package/dist/api/types/index.js +1 -0
  75. package/dist/core/fetcher/Fetcher.d.ts +1 -0
  76. package/dist/core/fetcher/Fetcher.js +58 -7
  77. package/dist/serialization/resources/prompt/client/index.d.ts +0 -3
  78. package/dist/serialization/resources/prompt/client/index.js +0 -16
  79. package/dist/serialization/resources/prompt/client/requests/PromptUpdateParams.d.ts +0 -1
  80. package/dist/serialization/resources/prompt/client/requests/PromptUpdateParams.js +0 -1
  81. package/dist/serialization/resources/run/client/requests/UpdateStatusParams.d.ts +1 -1
  82. package/dist/serialization/resources/run/client/requests/UpdateStatusParams.js +1 -1
  83. package/dist/serialization/resources/testcase/client/requests/TestcaseCreateParams.d.ts +1 -1
  84. package/dist/serialization/resources/testcase/client/requests/TestcaseCreateParams.js +1 -1
  85. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
  86. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +4 -1
  87. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
  88. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +4 -1
  89. package/dist/serialization/types/TestCaseCustomInputsValue.d.ts +1 -1
  90. package/dist/serialization/types/TestCaseCustomInputsValue.js +4 -1
  91. package/dist/serialization/types/TestCaseCustomLabelsValue.d.ts +1 -1
  92. package/dist/serialization/types/TestCaseCustomLabelsValue.js +4 -1
  93. package/dist/serialization/types/TestcaseDeletionResponse.d.ts +13 -0
  94. package/dist/serialization/{resources/prompt/client/getRoots.js → types/TestcaseDeletionResponse.js} +6 -4
  95. package/dist/serialization/types/Testrecord.d.ts +0 -1
  96. package/dist/serialization/types/Testrecord.js +0 -1
  97. package/dist/serialization/types/index.d.ts +1 -0
  98. package/dist/serialization/types/index.js +1 -0
  99. package/dist/telemetry.d.ts +6 -0
  100. package/dist/telemetry.js +65 -0
  101. package/dist/wrapper/ScorecardClient.d.ts +4 -0
  102. package/dist/wrapper/ScorecardClient.js +4 -6
  103. package/package.json +56 -2
  104. package/reference.md +38 -189
  105. package/serialization/resources/prompt/client/index.d.ts +0 -3
  106. package/serialization/resources/prompt/client/index.js +0 -16
  107. package/serialization/resources/prompt/client/requests/PromptUpdateParams.d.ts +0 -1
  108. package/serialization/resources/prompt/client/requests/PromptUpdateParams.js +0 -1
  109. package/serialization/resources/run/client/requests/UpdateStatusParams.d.ts +1 -1
  110. package/serialization/resources/run/client/requests/UpdateStatusParams.js +1 -1
  111. package/serialization/resources/testcase/client/requests/TestcaseCreateParams.d.ts +1 -1
  112. package/serialization/resources/testcase/client/requests/TestcaseCreateParams.js +1 -1
  113. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.d.ts +1 -1
  114. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +4 -1
  115. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.d.ts +1 -1
  116. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +4 -1
  117. package/serialization/types/TestCaseCustomInputsValue.d.ts +1 -1
  118. package/serialization/types/TestCaseCustomInputsValue.js +4 -1
  119. package/serialization/types/TestCaseCustomLabelsValue.d.ts +1 -1
  120. package/serialization/types/TestCaseCustomLabelsValue.js +4 -1
  121. package/serialization/types/TestcaseDeletionResponse.d.ts +13 -0
  122. package/{dist/serialization/resources/prompt/client/getGraph.js → serialization/types/TestcaseDeletionResponse.js} +6 -4
  123. package/serialization/types/Testrecord.d.ts +0 -1
  124. package/serialization/types/Testrecord.js +0 -1
  125. package/serialization/types/index.d.ts +1 -0
  126. package/serialization/types/index.js +1 -0
  127. package/telemetry.d.ts +6 -0
  128. package/telemetry.js +65 -0
  129. package/wrapper/ScorecardClient.d.ts +4 -0
  130. package/wrapper/ScorecardClient.js +4 -6
  131. package/dist/serialization/resources/prompt/client/getGraph.d.ts +0 -11
  132. package/dist/serialization/resources/prompt/client/getProds.d.ts +0 -11
  133. package/dist/serialization/resources/prompt/client/getProds.js +0 -32
  134. package/dist/serialization/resources/prompt/client/getRoots.d.ts +0 -11
  135. package/serialization/resources/prompt/client/getGraph.d.ts +0 -11
  136. package/serialization/resources/prompt/client/getGraph.js +0 -32
  137. package/serialization/resources/prompt/client/getProds.d.ts +0 -11
  138. package/serialization/resources/prompt/client/getProds.js +0 -32
  139. package/serialization/resources/prompt/client/getRoots.d.ts +0 -11
  140. package/serialization/resources/prompt/client/getRoots.js +0 -32
@@ -50,7 +50,11 @@ class Prompt {
50
50
  this._options = _options;
51
51
  }
52
52
  /**
53
- * Create a new prompt
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: "You are a virtual assistant",
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: "You are a virtual assistant",
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: {
@@ -88,16 +92,17 @@ class Prompt {
88
92
  * })
89
93
  */
90
94
  create(request, requestOptions) {
91
- var _a;
95
+ var _a, _b;
92
96
  return __awaiter(this, void 0, void 0, function* () {
93
- const _response = yield core.fetcher({
94
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, "v1/prompt"),
97
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
98
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : 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.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
100
+ 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())),
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,
100
104
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
105
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
101
106
  });
102
107
  if (_response.ok) {
103
108
  return yield serializers.Prompt.parseOrThrow(_response.body, {
@@ -165,30 +170,33 @@ class Prompt {
165
170
  });
166
171
  }
167
172
  /**
168
- * Retrieve active root prompts for the org
173
+ * Retrieve a prompt by id
169
174
  *
175
+ * @param {string} id - The id of the prompt to get.
170
176
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
171
177
  *
172
178
  * @throws {@link Scorecard.UnauthorizedError}
173
179
  * @throws {@link Scorecard.ForbiddenError}
174
180
  * @throws {@link Scorecard.NotFoundError}
181
+ * @throws {@link Scorecard.UnprocessableEntityError}
175
182
  *
176
183
  * @example
177
- * await scorecard.prompt.getRoots()
184
+ * await scorecard.prompt.get("id")
178
185
  */
179
- getRoots(requestOptions) {
180
- var _a;
186
+ get(id, requestOptions) {
187
+ var _a, _b;
181
188
  return __awaiter(this, void 0, void 0, function* () {
182
- 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, "v1/prompt/roots"),
189
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
190
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
184
191
  method: "GET",
185
- 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())),
192
+ 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())),
186
193
  contentType: "application/json",
187
194
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
188
195
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
196
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
189
197
  });
190
198
  if (_response.ok) {
191
- return yield serializers.prompt.getRoots.Response.parseOrThrow(_response.body, {
199
+ return yield serializers.Prompt.parseOrThrow(_response.body, {
192
200
  unrecognizedObjectKeys: "passthrough",
193
201
  allowUnrecognizedUnionMembers: true,
194
202
  allowUnrecognizedEnumValues: true,
@@ -222,80 +230,8 @@ class Prompt {
222
230
  skipValidation: true,
223
231
  breadcrumbsPrefix: ["response"],
224
232
  }));
225
- default:
226
- throw new errors.ScorecardError({
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, {
233
+ case 422:
234
+ throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
299
235
  unrecognizedObjectKeys: "passthrough",
300
236
  allowUnrecognizedUnionMembers: true,
301
237
  allowUnrecognizedEnumValues: true,
@@ -325,9 +261,9 @@ class Prompt {
325
261
  });
326
262
  }
327
263
  /**
328
- * Retrieve a prompt by id
264
+ * Delete a root prompt and all of its children.
329
265
  *
330
- * @param {string} id - The id of the prompt to get.
266
+ * @param {string} id - The id of the root prompt to delete.
331
267
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
332
268
  *
333
269
  * @throws {@link Scorecard.UnauthorizedError}
@@ -336,27 +272,22 @@ class Prompt {
336
272
  * @throws {@link Scorecard.UnprocessableEntityError}
337
273
  *
338
274
  * @example
339
- * await scorecard.prompt.get("id")
275
+ * await scorecard.prompt.delete("id")
340
276
  */
341
- get(id, requestOptions) {
342
- var _a;
277
+ delete(id, requestOptions) {
278
+ var _a, _b;
343
279
  return __awaiter(this, void 0, void 0, function* () {
344
- const _response = yield core.fetcher({
345
- 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: "GET",
347
- 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())),
280
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
281
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
282
+ method: "DELETE",
283
+ 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())),
348
284
  contentType: "application/json",
349
285
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
350
286
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
287
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
351
288
  });
352
289
  if (_response.ok) {
353
- return yield serializers.Prompt.parseOrThrow(_response.body, {
354
- unrecognizedObjectKeys: "passthrough",
355
- allowUnrecognizedUnionMembers: true,
356
- allowUnrecognizedEnumValues: true,
357
- skipValidation: true,
358
- breadcrumbsPrefix: ["response"],
359
- });
290
+ return _response.body;
360
291
  }
361
292
  if (_response.error.reason === "status-code") {
362
293
  switch (_response.error.statusCode) {
@@ -415,7 +346,9 @@ class Prompt {
415
346
  });
416
347
  }
417
348
  /**
418
- * Update a prompt
349
+ * Update a prompt.
350
+ *
351
+ * `is_prod` tags the provided prompt as the production prompt within the prompt graph.
419
352
  *
420
353
  * @param {string} id - The id of the prompt to update.
421
354
  * @param {Scorecard.PromptUpdateParams} request
@@ -428,20 +361,21 @@ class Prompt {
428
361
  *
429
362
  * @example
430
363
  * await scorecard.prompt.update("id", {
431
- * isArchived: true
364
+ * isProd: true
432
365
  * })
433
366
  */
434
367
  update(id, request = {}, requestOptions) {
435
- var _a;
368
+ var _a, _b;
436
369
  return __awaiter(this, void 0, void 0, function* () {
437
- const _response = yield core.fetcher({
438
- 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)}`),
370
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
371
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
439
372
  method: "PATCH",
440
- 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())),
373
+ 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())),
441
374
  contentType: "application/json",
442
375
  body: yield serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
443
376
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
444
377
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
378
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
445
379
  });
446
380
  if (_response.ok) {
447
381
  return yield serializers.Prompt.parseOrThrow(_response.body, {
@@ -523,15 +457,16 @@ class Prompt {
523
457
  * await scorecard.prompt.getByName("name")
524
458
  */
525
459
  getByName(name, requestOptions) {
526
- var _a;
460
+ var _a, _b;
527
461
  return __awaiter(this, void 0, void 0, function* () {
528
- const _response = yield core.fetcher({
529
- 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)}`),
462
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
463
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/name/${encodeURIComponent(name)}`),
530
464
  method: "GET",
531
- 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())),
465
+ 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())),
532
466
  contentType: "application/json",
533
467
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
534
468
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
469
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
535
470
  });
536
471
  if (_response.ok) {
537
472
  return yield serializers.Prompt.parseOrThrow(_response.body, {
@@ -598,96 +533,6 @@ class Prompt {
598
533
  }
599
534
  });
600
535
  }
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
536
  _getCustomAuthorizationHeaders() {
692
537
  var _a;
693
538
  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: "You are a virtual assistant",
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: "You are a virtual assistant",
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: {
@@ -4,10 +4,9 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * isArchived: true
7
+ * isProd: true
8
8
  * }
9
9
  */
10
10
  export interface PromptUpdateParams {
11
- isArchived?: boolean;
12
11
  isProd?: boolean;
13
12
  }
@@ -8,10 +8,12 @@ export declare namespace Run {
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 Run {
@@ -29,15 +31,7 @@ export declare class Run {
29
31
  * @throws {@link Scorecard.UnprocessableEntityError}
30
32
  *
31
33
  * @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
- * })
34
+ * await scorecard.run.create()
41
35
  */
42
36
  create(request?: Scorecard.RunCreateParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
43
37
  /**
@@ -68,11 +62,9 @@ export declare class Run {
68
62
  * @throws {@link Scorecard.UnprocessableEntityError}
69
63
  *
70
64
  * @example
71
- * await scorecard.run.updateStatus(1, {
72
- * status: Scorecard.RunStatus.Pending
73
- * })
65
+ * await scorecard.run.updateStatus(1)
74
66
  */
75
- updateStatus(runId: number, request: Scorecard.UpdateStatusParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
67
+ updateStatus(runId: number, request?: Scorecard.UpdateStatusParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
76
68
  protected _getCustomAuthorizationHeaders(): Promise<{
77
69
  "X-API-Key": string;
78
70
  }>;
@@ -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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, "v1/run"),
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.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}`),
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.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/status`),
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.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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;
@@ -4,10 +4,8 @@
4
4
  import * as Scorecard from "../../../../index";
5
5
  /**
6
6
  * @example
7
- * {
8
- * status: Scorecard.RunStatus.Pending
9
- * }
7
+ * {}
10
8
  */
11
9
  export interface UpdateStatusParams {
12
- status: Scorecard.RunStatus;
10
+ status?: Scorecard.RunStatus;
13
11
  }
@@ -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)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run_metric/${encodeURIComponent(runId)}`),
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.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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, {