scorecard-ai 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +9 -9
  2. package/api/resources/prompt/client/Client.d.ts +27 -8
  3. package/api/resources/prompt/client/Client.js +126 -15
  4. package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
  5. package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +4 -0
  6. package/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
  7. package/api/resources/prompt/client/requests/PromptListPromptsRequest.js +5 -0
  8. package/api/resources/prompt/client/requests/index.d.ts +1 -0
  9. package/api/resources/run/client/Client.js +3 -3
  10. package/api/resources/runMetric/client/Client.js +1 -1
  11. package/api/resources/score/client/Client.js +2 -2
  12. package/api/resources/scoringConfig/client/Client.d.ts +17 -1
  13. package/api/resources/scoringConfig/client/Client.js +90 -3
  14. package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +3 -1
  15. package/api/resources/testcase/client/Client.d.ts +1 -1
  16. package/api/resources/testcase/client/Client.js +7 -7
  17. package/api/resources/testrecord/client/Client.js +2 -2
  18. package/api/resources/testset/client/Client.d.ts +4 -4
  19. package/api/resources/testset/client/Client.js +21 -12
  20. package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +2 -0
  21. package/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
  22. package/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
  23. package/api/resources/testset/client/requests/index.d.ts +1 -0
  24. package/api/resources/tracing/client/Client.js +3 -3
  25. package/api/types/Prompt.d.ts +2 -0
  26. package/api/types/PromptCursorPage.d.ts +17 -0
  27. package/api/types/PromptCursorPage.js +5 -0
  28. package/api/types/ScoringConfig.d.ts +2 -0
  29. package/api/types/Testset.d.ts +2 -0
  30. package/api/types/TestsetCursorPage.d.ts +17 -0
  31. package/api/types/TestsetCursorPage.js +5 -0
  32. package/api/types/index.d.ts +2 -0
  33. package/api/types/index.js +2 -0
  34. package/dist/api/resources/prompt/client/Client.d.ts +27 -8
  35. package/dist/api/resources/prompt/client/Client.js +126 -15
  36. package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
  37. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +4 -0
  38. package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
  39. package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.js +5 -0
  40. package/dist/api/resources/prompt/client/requests/index.d.ts +1 -0
  41. package/dist/api/resources/run/client/Client.js +3 -3
  42. package/dist/api/resources/runMetric/client/Client.js +1 -1
  43. package/dist/api/resources/score/client/Client.js +2 -2
  44. package/dist/api/resources/scoringConfig/client/Client.d.ts +17 -1
  45. package/dist/api/resources/scoringConfig/client/Client.js +90 -3
  46. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +3 -1
  47. package/dist/api/resources/testcase/client/Client.d.ts +1 -1
  48. package/dist/api/resources/testcase/client/Client.js +7 -7
  49. package/dist/api/resources/testrecord/client/Client.js +2 -2
  50. package/dist/api/resources/testset/client/Client.d.ts +4 -4
  51. package/dist/api/resources/testset/client/Client.js +21 -12
  52. package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +2 -0
  53. package/dist/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
  54. package/dist/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
  55. package/dist/api/resources/testset/client/requests/index.d.ts +1 -0
  56. package/dist/api/resources/tracing/client/Client.js +3 -3
  57. package/dist/api/types/Prompt.d.ts +2 -0
  58. package/dist/api/types/PromptCursorPage.d.ts +17 -0
  59. package/dist/api/types/PromptCursorPage.js +5 -0
  60. package/dist/api/types/ScoringConfig.d.ts +2 -0
  61. package/dist/api/types/Testset.d.ts +2 -0
  62. package/dist/api/types/TestsetCursorPage.d.ts +17 -0
  63. package/dist/api/types/TestsetCursorPage.js +5 -0
  64. package/dist/api/types/index.d.ts +2 -0
  65. package/dist/api/types/index.js +2 -0
  66. package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
  67. package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
  68. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +1 -0
  69. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +1 -0
  70. package/dist/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
  71. package/dist/serialization/resources/testcase/client/batchCopy.js +32 -0
  72. package/dist/serialization/resources/testcase/client/index.d.ts +1 -0
  73. package/dist/serialization/resources/testcase/client/index.js +14 -0
  74. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +1 -0
  75. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +1 -0
  76. package/dist/serialization/types/Prompt.d.ts +1 -0
  77. package/dist/serialization/types/Prompt.js +1 -0
  78. package/dist/serialization/types/PromptCursorPage.d.ts +18 -0
  79. package/dist/serialization/types/PromptCursorPage.js +39 -0
  80. package/dist/serialization/types/ScoringConfig.d.ts +1 -0
  81. package/dist/serialization/types/ScoringConfig.js +1 -0
  82. package/dist/serialization/types/Testset.d.ts +1 -0
  83. package/dist/serialization/types/Testset.js +1 -0
  84. package/dist/serialization/types/TestsetCursorPage.d.ts +18 -0
  85. package/dist/serialization/types/TestsetCursorPage.js +39 -0
  86. package/dist/serialization/types/index.d.ts +2 -0
  87. package/dist/serialization/types/index.js +2 -0
  88. package/package.json +1 -1
  89. package/reference.md +140 -11
  90. package/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
  91. package/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
  92. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +1 -0
  93. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +1 -0
  94. package/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
  95. package/serialization/resources/testcase/client/batchCopy.js +32 -0
  96. package/serialization/resources/testcase/client/index.d.ts +1 -0
  97. package/serialization/resources/testcase/client/index.js +14 -0
  98. package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +1 -0
  99. package/serialization/resources/testset/client/requests/TestsetCreateParams.js +1 -0
  100. package/serialization/types/Prompt.d.ts +1 -0
  101. package/serialization/types/Prompt.js +1 -0
  102. package/serialization/types/PromptCursorPage.d.ts +18 -0
  103. package/serialization/types/PromptCursorPage.js +39 -0
  104. package/serialization/types/ScoringConfig.d.ts +1 -0
  105. package/serialization/types/ScoringConfig.js +1 -0
  106. package/serialization/types/Testset.d.ts +1 -0
  107. package/serialization/types/Testset.js +1 -0
  108. package/serialization/types/TestsetCursorPage.d.ts +18 -0
  109. package/serialization/types/TestsetCursorPage.js +39 -0
  110. package/serialization/types/index.d.ts +2 -0
  111. package/serialization/types/index.js +2 -0
@@ -50,7 +50,7 @@ class Prompt {
50
50
  this._options = _options;
51
51
  }
52
52
  /**
53
- * Retrieve a prod prompt by name
53
+ * Retrieve a prompt by name, defaulting to the production prompt, unless a tag to select the prompt by is specified
54
54
  *
55
55
  * @param {Scorecard.PromptGetByNameRequest} request
56
56
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
@@ -68,13 +68,16 @@ class Prompt {
68
68
  getByName(request, requestOptions) {
69
69
  var _a, _b;
70
70
  return __awaiter(this, void 0, void 0, function* () {
71
- const { name } = request;
71
+ const { name, tag } = request;
72
72
  const _queryParams = {};
73
73
  _queryParams["name"] = name;
74
+ if (tag != null) {
75
+ _queryParams["tag"] = tag;
76
+ }
74
77
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
75
78
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt"),
76
79
  method: "GET",
77
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
80
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
81
  contentType: "application/json",
79
82
  queryParameters: _queryParams,
80
83
  requestType: "json",
@@ -148,11 +151,11 @@ class Prompt {
148
151
  });
149
152
  }
150
153
  /**
151
- * Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
154
+ * Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in the app).
152
155
  *
153
- * A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
156
+ * A root prompt can be created by providing the `name` param, and it will always be tagged as production.
154
157
  *
155
- * 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.
158
+ * A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all descendants from a root prompt would share the root's name. `is_prod` can also be provided to configure whether a child should be tagged as production.
156
159
  *
157
160
  * @param {Scorecard.PromptCreateParams} request
158
161
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
@@ -172,7 +175,9 @@ class Prompt {
172
175
  * "param2": 0.1,
173
176
  * "param3": 100,
174
177
  * "param4": true
175
- * }
178
+ * },
179
+ * tag: "1.0",
180
+ * projectId: 1
176
181
  * })
177
182
  *
178
183
  * @example
@@ -186,7 +191,9 @@ class Prompt {
186
191
  * "param3": 100,
187
192
  * "param4": true
188
193
  * },
189
- * isProd: true
194
+ * tag: "v1.1",
195
+ * isProd: true,
196
+ * projectId: 1
190
197
  * })
191
198
  */
192
199
  create(request, requestOptions) {
@@ -195,7 +202,7 @@ class Prompt {
195
202
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
196
203
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt"),
197
204
  method: "POST",
198
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
205
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
199
206
  contentType: "application/json",
200
207
  requestType: "json",
201
208
  body: serializers.PromptCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -268,6 +275,110 @@ class Prompt {
268
275
  }
269
276
  });
270
277
  }
278
+ /**
279
+ * List all prompts with cursor-based pagination
280
+ *
281
+ * @param {Scorecard.PromptListPromptsRequest} request
282
+ * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
283
+ *
284
+ * @throws {@link Scorecard.UnauthorizedError}
285
+ * @throws {@link Scorecard.ForbiddenError}
286
+ * @throws {@link Scorecard.NotFoundError}
287
+ * @throws {@link Scorecard.UnprocessableEntityError}
288
+ *
289
+ * @example
290
+ * await client.prompt.listPrompts()
291
+ */
292
+ listPrompts(request = {}, requestOptions) {
293
+ var _a, _b;
294
+ return __awaiter(this, void 0, void 0, function* () {
295
+ const { projectId, cursor, size } = request;
296
+ const _queryParams = {};
297
+ if (projectId != null) {
298
+ _queryParams["project_id"] = projectId;
299
+ }
300
+ if (cursor != null) {
301
+ _queryParams["cursor"] = cursor;
302
+ }
303
+ if (size != null) {
304
+ _queryParams["size"] = size.toString();
305
+ }
306
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
307
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt/list"),
308
+ method: "GET",
309
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
310
+ contentType: "application/json",
311
+ queryParameters: _queryParams,
312
+ requestType: "json",
313
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
314
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
315
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
316
+ });
317
+ if (_response.ok) {
318
+ return serializers.PromptCursorPage.parseOrThrow(_response.body, {
319
+ unrecognizedObjectKeys: "passthrough",
320
+ allowUnrecognizedUnionMembers: true,
321
+ allowUnrecognizedEnumValues: true,
322
+ skipValidation: true,
323
+ breadcrumbsPrefix: ["response"],
324
+ });
325
+ }
326
+ if (_response.error.reason === "status-code") {
327
+ switch (_response.error.statusCode) {
328
+ case 401:
329
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
330
+ unrecognizedObjectKeys: "passthrough",
331
+ allowUnrecognizedUnionMembers: true,
332
+ allowUnrecognizedEnumValues: true,
333
+ skipValidation: true,
334
+ breadcrumbsPrefix: ["response"],
335
+ }));
336
+ case 403:
337
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
338
+ unrecognizedObjectKeys: "passthrough",
339
+ allowUnrecognizedUnionMembers: true,
340
+ allowUnrecognizedEnumValues: true,
341
+ skipValidation: true,
342
+ breadcrumbsPrefix: ["response"],
343
+ }));
344
+ case 404:
345
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
346
+ unrecognizedObjectKeys: "passthrough",
347
+ allowUnrecognizedUnionMembers: true,
348
+ allowUnrecognizedEnumValues: true,
349
+ skipValidation: true,
350
+ breadcrumbsPrefix: ["response"],
351
+ }));
352
+ case 422:
353
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
354
+ unrecognizedObjectKeys: "passthrough",
355
+ allowUnrecognizedUnionMembers: true,
356
+ allowUnrecognizedEnumValues: true,
357
+ skipValidation: true,
358
+ breadcrumbsPrefix: ["response"],
359
+ }));
360
+ default:
361
+ throw new errors.ScorecardError({
362
+ statusCode: _response.error.statusCode,
363
+ body: _response.error.body,
364
+ });
365
+ }
366
+ }
367
+ switch (_response.error.reason) {
368
+ case "non-json":
369
+ throw new errors.ScorecardError({
370
+ statusCode: _response.error.statusCode,
371
+ body: _response.error.rawBody,
372
+ });
373
+ case "timeout":
374
+ throw new errors.ScorecardTimeoutError();
375
+ case "unknown":
376
+ throw new errors.ScorecardError({
377
+ message: _response.error.errorMessage,
378
+ });
379
+ }
380
+ });
381
+ }
271
382
  /**
272
383
  * Retrieve a prompt by id
273
384
  *
@@ -288,7 +399,7 @@ class Prompt {
288
399
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
289
400
  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)}`),
290
401
  method: "GET",
291
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
402
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
292
403
  contentType: "application/json",
293
404
  requestType: "json",
294
405
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -361,9 +472,9 @@ class Prompt {
361
472
  });
362
473
  }
363
474
  /**
364
- * Delete a scoring config.
475
+ * Delete a root prompt and all of its children.
365
476
  *
366
- * @param {string} id - The id of the scoring config to delete.
477
+ * @param {string} id - The id of the root prompt to delete.
367
478
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
368
479
  *
369
480
  * @throws {@link Scorecard.UnauthorizedError}
@@ -378,9 +489,9 @@ class Prompt {
378
489
  var _a, _b;
379
490
  return __awaiter(this, void 0, void 0, function* () {
380
491
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
381
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/scoring_config/${encodeURIComponent(id)}`),
492
+ 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)}`),
382
493
  method: "DELETE",
383
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
494
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
384
495
  contentType: "application/json",
385
496
  requestType: "json",
386
497
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -471,7 +582,7 @@ class Prompt {
471
582
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
472
583
  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)}`),
473
584
  method: "PATCH",
474
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
585
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
475
586
  contentType: "application/json",
476
587
  requestType: "json",
477
588
  body: serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -13,7 +13,9 @@ import * as Scorecard from "../../../../index";
13
13
  * "param2": 0.1,
14
14
  * "param3": 100,
15
15
  * "param4": true
16
- * }
16
+ * },
17
+ * tag: "1.0",
18
+ * projectId: 1
17
19
  * }
18
20
  *
19
21
  * @example
@@ -27,7 +29,9 @@ import * as Scorecard from "../../../../index";
27
29
  * "param3": 100,
28
30
  * "param4": true
29
31
  * },
30
- * isProd: true
32
+ * tag: "v1.1",
33
+ * isProd: true,
34
+ * projectId: 1
31
35
  * }
32
36
  */
33
37
  export interface PromptCreateParams {
@@ -36,5 +40,7 @@ export interface PromptCreateParams {
36
40
  parentId?: string;
37
41
  description?: string;
38
42
  modelParams?: Record<string, Scorecard.PromptCreateParamsModelParamsValue | undefined>;
43
+ tag?: string;
39
44
  isProd?: boolean;
45
+ projectId?: number;
40
46
  }
@@ -12,4 +12,8 @@ export interface PromptGetByNameRequest {
12
12
  * Name of the prompt.
13
13
  */
14
14
  name: string;
15
+ /**
16
+ * Tag to select by. Defaults to selecting the production version
17
+ */
18
+ tag?: string;
15
19
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface PromptListPromptsRequest {
9
+ /**
10
+ * ID of Project to filter by.
11
+ */
12
+ projectId?: string;
13
+ /**
14
+ * Cursor for the next page
15
+ */
16
+ cursor?: string;
17
+ /**
18
+ * Page size
19
+ */
20
+ size?: number;
21
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
1
  export { type PromptGetByNameRequest } from "./PromptGetByNameRequest";
2
2
  export { type PromptCreateParams } from "./PromptCreateParams";
3
+ export { type PromptListPromptsRequest } from "./PromptListPromptsRequest";
3
4
  export { type PromptUpdateParams } from "./PromptUpdateParams";
@@ -69,7 +69,7 @@ class Run {
69
69
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
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"),
71
71
  method: "POST",
72
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.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.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
73
  contentType: "application/json",
74
74
  requestType: "json",
75
75
  body: serializers.RunCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -162,7 +162,7 @@ class Run {
162
162
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
163
163
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}`),
164
164
  method: "GET",
165
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
165
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
166
166
  contentType: "application/json",
167
167
  requestType: "json",
168
168
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -255,7 +255,7 @@ class Run {
255
255
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
256
256
  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`),
257
257
  method: "PATCH",
258
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
258
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
259
259
  contentType: "application/json",
260
260
  requestType: "json",
261
261
  body: serializers.UpdateStatusParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -69,7 +69,7 @@ class RunMetric {
69
69
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
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.6.0", "User-Agent": "scorecard-ai/0.6.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.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
73
  contentType: "application/json",
74
74
  requestType: "json",
75
75
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -73,7 +73,7 @@ class Score {
73
73
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
74
74
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score`),
75
75
  method: "POST",
76
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
76
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
77
77
  contentType: "application/json",
78
78
  requestType: "json",
79
79
  body: serializers.ScoreCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -169,7 +169,7 @@ class Score {
169
169
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
170
170
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score/${encodeURIComponent(scoreId)}`),
171
171
  method: "PATCH",
172
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
172
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
173
173
  contentType: "application/json",
174
174
  requestType: "json",
175
175
  body: serializers.ScoreUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -37,7 +37,8 @@ export declare class ScoringConfig {
37
37
  * await client.scoringConfig.create({
38
38
  * name: "Scoring Config Name",
39
39
  * description: "Description of the scoring config",
40
- * metrics: [1, 2, 3]
40
+ * metrics: [1, 2, 3],
41
+ * projectId: 1
41
42
  * })
42
43
  */
43
44
  create(request?: Scorecard.ScoringConfigCreateParams, requestOptions?: ScoringConfig.RequestOptions): Promise<Scorecard.ScoringConfig>;
@@ -56,6 +57,21 @@ export declare class ScoringConfig {
56
57
  * await client.scoringConfig.get("id")
57
58
  */
58
59
  get(id: string, requestOptions?: ScoringConfig.RequestOptions): Promise<Scorecard.ScoringConfig>;
60
+ /**
61
+ * Delete a scoring config.
62
+ *
63
+ * @param {string} id - The id of the scoring config to delete.
64
+ * @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Scorecard.UnauthorizedError}
67
+ * @throws {@link Scorecard.ForbiddenError}
68
+ * @throws {@link Scorecard.NotFoundError}
69
+ * @throws {@link Scorecard.UnprocessableEntityError}
70
+ *
71
+ * @example
72
+ * await client.scoringConfig.delete("id")
73
+ */
74
+ delete(id: string, requestOptions?: ScoringConfig.RequestOptions): Promise<unknown>;
59
75
  protected _getCustomAuthorizationHeaders(): Promise<{
60
76
  "X-API-Key": string;
61
77
  }>;
@@ -64,7 +64,8 @@ class ScoringConfig {
64
64
  * await client.scoringConfig.create({
65
65
  * name: "Scoring Config Name",
66
66
  * description: "Description of the scoring config",
67
- * metrics: [1, 2, 3]
67
+ * metrics: [1, 2, 3],
68
+ * projectId: 1
68
69
  * })
69
70
  */
70
71
  create(request = {}, requestOptions) {
@@ -73,7 +74,7 @@ class ScoringConfig {
73
74
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
74
75
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/scoring_config"),
75
76
  method: "POST",
76
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
77
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
77
78
  contentType: "application/json",
78
79
  requestType: "json",
79
80
  body: serializers.ScoringConfigCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -166,7 +167,7 @@ class ScoringConfig {
166
167
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
167
168
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/scoring_config/${encodeURIComponent(id)}`),
168
169
  method: "GET",
169
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
170
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
170
171
  contentType: "application/json",
171
172
  requestType: "json",
172
173
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -238,6 +239,92 @@ class ScoringConfig {
238
239
  }
239
240
  });
240
241
  }
242
+ /**
243
+ * Delete a scoring config.
244
+ *
245
+ * @param {string} id - The id of the scoring config to delete.
246
+ * @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
247
+ *
248
+ * @throws {@link Scorecard.UnauthorizedError}
249
+ * @throws {@link Scorecard.ForbiddenError}
250
+ * @throws {@link Scorecard.NotFoundError}
251
+ * @throws {@link Scorecard.UnprocessableEntityError}
252
+ *
253
+ * @example
254
+ * await client.scoringConfig.delete("id")
255
+ */
256
+ delete(id, requestOptions) {
257
+ var _a, _b;
258
+ return __awaiter(this, void 0, void 0, function* () {
259
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
260
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/scoring_config/${encodeURIComponent(id)}`),
261
+ method: "DELETE",
262
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
263
+ contentType: "application/json",
264
+ requestType: "json",
265
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
266
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
267
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
268
+ });
269
+ if (_response.ok) {
270
+ return _response.body;
271
+ }
272
+ if (_response.error.reason === "status-code") {
273
+ switch (_response.error.statusCode) {
274
+ case 401:
275
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
276
+ unrecognizedObjectKeys: "passthrough",
277
+ allowUnrecognizedUnionMembers: true,
278
+ allowUnrecognizedEnumValues: true,
279
+ skipValidation: true,
280
+ breadcrumbsPrefix: ["response"],
281
+ }));
282
+ case 403:
283
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
284
+ unrecognizedObjectKeys: "passthrough",
285
+ allowUnrecognizedUnionMembers: true,
286
+ allowUnrecognizedEnumValues: true,
287
+ skipValidation: true,
288
+ breadcrumbsPrefix: ["response"],
289
+ }));
290
+ case 404:
291
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
292
+ unrecognizedObjectKeys: "passthrough",
293
+ allowUnrecognizedUnionMembers: true,
294
+ allowUnrecognizedEnumValues: true,
295
+ skipValidation: true,
296
+ breadcrumbsPrefix: ["response"],
297
+ }));
298
+ case 422:
299
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
300
+ unrecognizedObjectKeys: "passthrough",
301
+ allowUnrecognizedUnionMembers: true,
302
+ allowUnrecognizedEnumValues: true,
303
+ skipValidation: true,
304
+ breadcrumbsPrefix: ["response"],
305
+ }));
306
+ default:
307
+ throw new errors.ScorecardError({
308
+ statusCode: _response.error.statusCode,
309
+ body: _response.error.body,
310
+ });
311
+ }
312
+ }
313
+ switch (_response.error.reason) {
314
+ case "non-json":
315
+ throw new errors.ScorecardError({
316
+ statusCode: _response.error.statusCode,
317
+ body: _response.error.rawBody,
318
+ });
319
+ case "timeout":
320
+ throw new errors.ScorecardTimeoutError();
321
+ case "unknown":
322
+ throw new errors.ScorecardError({
323
+ message: _response.error.errorMessage,
324
+ });
325
+ }
326
+ });
327
+ }
241
328
  _getCustomAuthorizationHeaders() {
242
329
  var _a;
243
330
  return __awaiter(this, void 0, void 0, function* () {
@@ -6,11 +6,13 @@
6
6
  * {
7
7
  * name: "Scoring Config Name",
8
8
  * description: "Description of the scoring config",
9
- * metrics: [1, 2, 3]
9
+ * metrics: [1, 2, 3],
10
+ * projectId: 1
10
11
  * }
11
12
  */
12
13
  export interface ScoringConfigCreateParams {
13
14
  name?: string;
14
15
  description?: string;
15
16
  metrics?: number[];
17
+ projectId?: number;
16
18
  }
@@ -102,7 +102,7 @@ export declare class Testcase {
102
102
  * @example
103
103
  * await client.testcase.batchCopy(1)
104
104
  */
105
- batchCopy(testsetId: number, request?: Scorecard.TestcaseBatchCopyParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase>;
105
+ batchCopy(testsetId: number, request?: Scorecard.TestcaseBatchCopyParams, requestOptions?: Testcase.RequestOptions): Promise<Scorecard.TestCase[]>;
106
106
  /**
107
107
  * Batch delete Testcases
108
108
  *
@@ -70,7 +70,7 @@ class Testcase {
70
70
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
71
71
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase`),
72
72
  method: "POST",
73
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
74
74
  contentType: "application/json",
75
75
  requestType: "json",
76
76
  body: serializers.TestcaseCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -164,7 +164,7 @@ class Testcase {
164
164
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
165
165
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
166
166
  method: "GET",
167
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
167
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
168
168
  contentType: "application/json",
169
169
  requestType: "json",
170
170
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -257,7 +257,7 @@ class Testcase {
257
257
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
258
258
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
259
259
  method: "DELETE",
260
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
260
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
261
261
  contentType: "application/json",
262
262
  requestType: "json",
263
263
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -351,7 +351,7 @@ class Testcase {
351
351
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
352
352
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
353
353
  method: "PATCH",
354
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
354
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
355
355
  contentType: "application/json",
356
356
  requestType: "json",
357
357
  body: serializers.TestcaseUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -445,7 +445,7 @@ class Testcase {
445
445
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
446
446
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/batch_copy`),
447
447
  method: "POST",
448
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
448
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
449
449
  contentType: "application/json",
450
450
  requestType: "json",
451
451
  body: serializers.TestcaseBatchCopyParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -454,7 +454,7 @@ class Testcase {
454
454
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
455
455
  });
456
456
  if (_response.ok) {
457
- return serializers.TestCase.parseOrThrow(_response.body, {
457
+ return serializers.testcase.batchCopy.Response.parseOrThrow(_response.body, {
458
458
  unrecognizedObjectKeys: "passthrough",
459
459
  allowUnrecognizedUnionMembers: true,
460
460
  allowUnrecognizedEnumValues: true,
@@ -539,7 +539,7 @@ class Testcase {
539
539
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
540
540
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/batch_delete`),
541
541
  method: "PATCH",
542
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
542
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
543
543
  contentType: "application/json",
544
544
  requestType: "json",
545
545
  body: serializers.TestcaseBatchDeleteParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),