scorecard-ai 0.5.4 → 0.6.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.
Files changed (350) hide show
  1. package/Client.d.ts +9 -3
  2. package/Client.js +8 -3
  3. package/api/resources/index.d.ts +3 -1
  4. package/api/resources/index.js +4 -2
  5. package/api/resources/prompt/client/Client.d.ts +27 -22
  6. package/api/resources/prompt/client/Client.js +110 -99
  7. package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
  8. package/api/resources/prompt/client/requests/index.d.ts +1 -0
  9. package/api/resources/run/client/Client.d.ts +6 -3
  10. package/api/resources/run/client/Client.js +26 -23
  11. package/api/resources/runMetric/client/Client.d.ts +4 -1
  12. package/api/resources/runMetric/client/Client.js +8 -7
  13. package/api/resources/score/client/Client.d.ts +5 -2
  14. package/api/resources/score/client/Client.js +18 -16
  15. package/api/resources/scoringConfig/client/Client.d.ts +62 -0
  16. package/{dist/api/resources/traces → api/resources/scoringConfig}/client/Client.js +114 -16
  17. package/api/resources/scoringConfig/client/index.d.ts +1 -0
  18. package/api/resources/scoringConfig/client/index.js +17 -0
  19. package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
  20. package/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
  21. package/api/resources/testcase/client/Client.d.ts +55 -3
  22. package/api/resources/testcase/client/Client.js +308 -22
  23. package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
  24. package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
  25. package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
  26. package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
  27. package/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  28. package/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
  29. package/api/resources/testcase/client/requests/index.d.ts +3 -0
  30. package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
  31. package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
  32. package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
  33. package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
  34. package/api/resources/testcase/types/index.d.ts +2 -0
  35. package/api/resources/testcase/types/index.js +2 -0
  36. package/api/resources/testrecord/client/Client.d.ts +5 -2
  37. package/api/resources/testrecord/client/Client.js +17 -15
  38. package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
  39. package/api/resources/testset/client/Client.d.ts +24 -5
  40. package/api/resources/testset/client/Client.js +135 -36
  41. package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +6 -0
  42. package/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  43. package/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
  44. package/api/resources/testset/client/requests/index.d.ts +1 -0
  45. package/api/resources/tracing/client/Client.d.ts +72 -0
  46. package/api/resources/tracing/client/Client.js +327 -0
  47. package/api/types/IngestionMethod.d.ts +8 -0
  48. package/api/types/IngestionMethod.js +10 -0
  49. package/api/types/ScoringConfig.d.ts +16 -0
  50. package/api/types/ScoringConfig.js +5 -0
  51. package/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
  52. package/api/types/TestcaseBatchDeletionResponse.js +5 -0
  53. package/api/types/Testrecord.d.ts +2 -0
  54. package/api/types/Trace.d.ts +2 -0
  55. package/api/types/index.d.ts +6 -4
  56. package/api/types/index.js +6 -4
  57. package/core/fetcher/Fetcher.d.ts +4 -1
  58. package/core/fetcher/Fetcher.js +19 -176
  59. package/core/fetcher/createRequestUrl.d.ts +1 -0
  60. package/core/fetcher/createRequestUrl.js +13 -0
  61. package/core/fetcher/getFetchFn.d.ts +4 -0
  62. package/core/fetcher/getFetchFn.js +59 -0
  63. package/core/fetcher/getRequestBody.d.ts +7 -0
  64. package/core/fetcher/getRequestBody.js +23 -0
  65. package/core/fetcher/getResponseBody.d.ts +1 -0
  66. package/core/fetcher/getResponseBody.js +52 -0
  67. package/core/fetcher/makeRequest.d.ts +1 -0
  68. package/core/fetcher/makeRequest.js +42 -0
  69. package/core/fetcher/requestWithRetries.d.ts +1 -0
  70. package/core/fetcher/requestWithRetries.js +32 -0
  71. package/core/fetcher/signals.d.ts +12 -0
  72. package/core/fetcher/signals.js +37 -0
  73. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
  74. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
  75. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  76. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  77. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  78. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
  79. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  80. package/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
  81. package/core/runtime/runtime.d.ts +2 -1
  82. package/core/runtime/runtime.js +12 -1
  83. package/core/schemas/Schema.d.ts +7 -4
  84. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  85. package/core/schemas/builders/lazy/lazy.js +8 -19
  86. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  87. package/core/schemas/builders/list/list.js +31 -44
  88. package/core/schemas/builders/object/object.js +90 -111
  89. package/core/schemas/builders/object/types.d.ts +2 -2
  90. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  91. package/core/schemas/builders/record/record.js +49 -60
  92. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  93. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  94. package/core/schemas/builders/set/set.js +6 -15
  95. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  96. package/core/schemas/builders/union/union.js +51 -62
  97. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  98. package/dist/Client.d.ts +9 -3
  99. package/dist/Client.js +8 -3
  100. package/dist/api/resources/index.d.ts +3 -1
  101. package/dist/api/resources/index.js +4 -2
  102. package/dist/api/resources/prompt/client/Client.d.ts +27 -22
  103. package/dist/api/resources/prompt/client/Client.js +110 -99
  104. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
  105. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
  106. package/dist/api/resources/prompt/client/requests/index.d.ts +1 -0
  107. package/dist/api/resources/run/client/Client.d.ts +6 -3
  108. package/dist/api/resources/run/client/Client.js +26 -23
  109. package/dist/api/resources/runMetric/client/Client.d.ts +4 -1
  110. package/dist/api/resources/runMetric/client/Client.js +8 -7
  111. package/dist/api/resources/score/client/Client.d.ts +5 -2
  112. package/dist/api/resources/score/client/Client.js +18 -16
  113. package/dist/api/resources/scoringConfig/client/Client.d.ts +62 -0
  114. package/{api/resources/traces → dist/api/resources/scoringConfig}/client/Client.js +114 -16
  115. package/dist/api/resources/scoringConfig/client/index.d.ts +1 -0
  116. package/dist/api/resources/scoringConfig/client/index.js +17 -0
  117. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
  118. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
  119. package/dist/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
  120. package/dist/api/resources/scoringConfig/client/requests/index.js +2 -0
  121. package/dist/api/resources/testcase/client/Client.d.ts +55 -3
  122. package/dist/api/resources/testcase/client/Client.js +308 -22
  123. package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
  124. package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
  125. package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
  126. package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
  127. package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  128. package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
  129. package/dist/api/resources/testcase/client/requests/index.d.ts +3 -0
  130. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
  131. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
  132. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
  133. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
  134. package/dist/api/resources/testcase/types/index.d.ts +2 -0
  135. package/dist/api/resources/testcase/types/index.js +2 -0
  136. package/dist/api/resources/testrecord/client/Client.d.ts +5 -2
  137. package/dist/api/resources/testrecord/client/Client.js +17 -15
  138. package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
  139. package/dist/api/resources/testset/client/Client.d.ts +24 -5
  140. package/dist/api/resources/testset/client/Client.js +135 -36
  141. package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +6 -0
  142. package/dist/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  143. package/dist/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
  144. package/dist/api/resources/testset/client/requests/index.d.ts +1 -0
  145. package/dist/api/resources/tracing/client/Client.d.ts +72 -0
  146. package/dist/api/resources/tracing/client/Client.js +327 -0
  147. package/dist/api/resources/tracing/client/index.js +2 -0
  148. package/dist/api/types/IngestionMethod.d.ts +8 -0
  149. package/dist/api/types/IngestionMethod.js +10 -0
  150. package/dist/api/types/ScoringConfig.d.ts +16 -0
  151. package/dist/api/types/ScoringConfig.js +5 -0
  152. package/dist/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
  153. package/dist/api/types/TestcaseBatchDeletionResponse.js +5 -0
  154. package/dist/api/types/Testrecord.d.ts +2 -0
  155. package/dist/api/types/Trace.d.ts +2 -0
  156. package/dist/api/types/index.d.ts +6 -4
  157. package/dist/api/types/index.js +6 -4
  158. package/dist/core/fetcher/Fetcher.d.ts +4 -1
  159. package/dist/core/fetcher/Fetcher.js +19 -176
  160. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  161. package/dist/core/fetcher/createRequestUrl.js +13 -0
  162. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  163. package/dist/core/fetcher/getFetchFn.js +59 -0
  164. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  165. package/dist/core/fetcher/getRequestBody.js +23 -0
  166. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  167. package/dist/core/fetcher/getResponseBody.js +52 -0
  168. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  169. package/dist/core/fetcher/makeRequest.js +42 -0
  170. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  171. package/dist/core/fetcher/requestWithRetries.js +32 -0
  172. package/dist/core/fetcher/signals.d.ts +12 -0
  173. package/dist/core/fetcher/signals.js +37 -0
  174. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
  175. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
  176. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  177. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  178. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  179. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
  180. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  181. package/dist/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
  182. package/dist/core/runtime/runtime.d.ts +2 -1
  183. package/dist/core/runtime/runtime.js +12 -1
  184. package/dist/core/schemas/Schema.d.ts +7 -4
  185. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  186. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  187. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  188. package/dist/core/schemas/builders/list/list.js +31 -44
  189. package/dist/core/schemas/builders/object/object.js +90 -111
  190. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  191. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  192. package/dist/core/schemas/builders/record/record.js +49 -60
  193. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  194. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  195. package/dist/core/schemas/builders/set/set.js +6 -15
  196. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  197. package/dist/core/schemas/builders/union/union.js +51 -62
  198. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  199. package/dist/serialization/resources/index.d.ts +3 -1
  200. package/dist/serialization/resources/index.js +4 -2
  201. package/dist/serialization/resources/scoringConfig/client/index.d.ts +1 -0
  202. package/dist/serialization/resources/scoringConfig/client/index.js +17 -0
  203. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
  204. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
  205. package/dist/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
  206. package/dist/serialization/resources/scoringConfig/client/requests/index.js +5 -0
  207. package/dist/serialization/resources/scoringConfig/index.d.ts +1 -0
  208. package/dist/serialization/resources/scoringConfig/index.js +17 -0
  209. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
  210. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
  211. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
  212. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
  213. package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  214. package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
  215. package/dist/serialization/resources/testcase/client/requests/index.d.ts +3 -0
  216. package/dist/serialization/resources/testcase/client/requests/index.js +7 -1
  217. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
  218. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
  219. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
  220. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
  221. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
  222. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
  223. package/dist/serialization/resources/testcase/types/index.d.ts +2 -0
  224. package/dist/serialization/resources/testcase/types/index.js +2 -0
  225. package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
  226. package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
  227. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
  228. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
  229. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
  230. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
  231. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
  232. package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  233. package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
  234. package/dist/serialization/resources/testset/client/requests/index.d.ts +1 -0
  235. package/dist/serialization/resources/testset/client/requests/index.js +3 -1
  236. package/dist/serialization/resources/tracing/client/index.d.ts +1 -0
  237. package/{serialization/resources/traces → dist/serialization/resources/tracing}/client/index.js +2 -2
  238. package/dist/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
  239. package/dist/serialization/resources/tracing/client/traces.js +32 -0
  240. package/dist/serialization/resources/tracing/index.d.ts +1 -0
  241. package/dist/serialization/resources/tracing/index.js +17 -0
  242. package/dist/serialization/types/IngestionMethod.d.ts +10 -0
  243. package/dist/serialization/types/IngestionMethod.js +31 -0
  244. package/dist/serialization/types/JsonObject.js +2 -10
  245. package/dist/serialization/types/JsonObjectInputValue.js +3 -11
  246. package/dist/serialization/types/JsonObjectOutputValue.js +3 -11
  247. package/dist/serialization/types/ScoringConfig.d.ts +20 -0
  248. package/dist/serialization/types/ScoringConfig.js +41 -0
  249. package/dist/serialization/types/Span.js +2 -10
  250. package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -10
  251. package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -10
  252. package/dist/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
  253. package/dist/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
  254. package/dist/serialization/types/Testrecord.d.ts +1 -0
  255. package/dist/serialization/types/Testrecord.js +1 -0
  256. package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -10
  257. package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -10
  258. package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -10
  259. package/dist/serialization/types/Trace.d.ts +1 -0
  260. package/dist/serialization/types/Trace.js +2 -0
  261. package/dist/serialization/types/index.d.ts +6 -4
  262. package/dist/serialization/types/index.js +6 -4
  263. package/package.json +8 -2
  264. package/reference.md +657 -569
  265. package/serialization/resources/index.d.ts +3 -1
  266. package/serialization/resources/index.js +4 -2
  267. package/serialization/resources/scoringConfig/client/index.d.ts +1 -0
  268. package/serialization/resources/scoringConfig/client/index.js +17 -0
  269. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
  270. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
  271. package/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
  272. package/serialization/resources/scoringConfig/client/requests/index.js +5 -0
  273. package/serialization/resources/scoringConfig/index.d.ts +1 -0
  274. package/serialization/resources/scoringConfig/index.js +17 -0
  275. package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
  276. package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
  277. package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
  278. package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
  279. package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  280. package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
  281. package/serialization/resources/testcase/client/requests/index.d.ts +3 -0
  282. package/serialization/resources/testcase/client/requests/index.js +7 -1
  283. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
  284. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
  285. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
  286. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
  287. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
  288. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
  289. package/serialization/resources/testcase/types/index.d.ts +2 -0
  290. package/serialization/resources/testcase/types/index.js +2 -0
  291. package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
  292. package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
  293. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
  294. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
  295. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
  296. package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
  297. package/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
  298. package/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  299. package/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
  300. package/serialization/resources/testset/client/requests/index.d.ts +1 -0
  301. package/serialization/resources/testset/client/requests/index.js +3 -1
  302. package/serialization/resources/tracing/client/index.d.ts +1 -0
  303. package/{dist/serialization/resources/traces → serialization/resources/tracing}/client/index.js +2 -2
  304. package/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
  305. package/serialization/resources/tracing/client/traces.js +32 -0
  306. package/serialization/resources/tracing/index.d.ts +1 -0
  307. package/serialization/resources/tracing/index.js +17 -0
  308. package/serialization/types/IngestionMethod.d.ts +10 -0
  309. package/serialization/types/IngestionMethod.js +31 -0
  310. package/serialization/types/JsonObject.js +2 -10
  311. package/serialization/types/JsonObjectInputValue.js +3 -11
  312. package/serialization/types/JsonObjectOutputValue.js +3 -11
  313. package/serialization/types/ScoringConfig.d.ts +20 -0
  314. package/serialization/types/ScoringConfig.js +41 -0
  315. package/serialization/types/Span.js +2 -10
  316. package/serialization/types/TestCaseCustomInputsValue.js +2 -10
  317. package/serialization/types/TestCaseCustomLabelsValue.js +2 -10
  318. package/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
  319. package/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
  320. package/serialization/types/Testrecord.d.ts +1 -0
  321. package/serialization/types/Testrecord.js +1 -0
  322. package/serialization/types/TestrecordCustomInputsValue.js +2 -10
  323. package/serialization/types/TestrecordCustomLabelsValue.js +2 -10
  324. package/serialization/types/TestrecordCustomOutputsValue.js +2 -10
  325. package/serialization/types/Trace.d.ts +1 -0
  326. package/serialization/types/Trace.js +2 -0
  327. package/serialization/types/index.d.ts +6 -4
  328. package/serialization/types/index.js +6 -4
  329. package/api/resources/traces/client/Client.d.ts +0 -40
  330. package/api/types/TestCaseCreate.d.ts +0 -10
  331. package/dist/api/resources/traces/client/Client.d.ts +0 -40
  332. package/dist/api/types/TestCaseCreate.d.ts +0 -10
  333. package/dist/serialization/resources/traces/client/index.d.ts +0 -1
  334. package/dist/serialization/types/TestCaseCreate.d.ts +0 -16
  335. package/serialization/resources/traces/client/index.d.ts +0 -1
  336. package/serialization/types/TestCaseCreate.d.ts +0 -16
  337. /package/api/{types/TestCaseCreate.js → resources/prompt/client/requests/PromptGetByNameRequest.js} +0 -0
  338. /package/{dist/api/types/TestCaseCreate.js → api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js} +0 -0
  339. /package/api/resources/{traces/client → scoringConfig/client/requests}/index.js +0 -0
  340. /package/api/resources/{traces → scoringConfig}/index.d.ts +0 -0
  341. /package/api/resources/{traces → scoringConfig}/index.js +0 -0
  342. /package/api/resources/{traces → tracing}/client/index.d.ts +0 -0
  343. /package/{dist/api/resources/traces → api/resources/tracing}/client/index.js +0 -0
  344. /package/{dist/api/resources/traces → api/resources/tracing}/index.d.ts +0 -0
  345. /package/{dist/api/resources/traces → api/resources/tracing}/index.js +0 -0
  346. /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.d.ts +0 -0
  347. /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.js +0 -0
  348. /package/dist/api/resources/{traces → tracing}/client/index.d.ts +0 -0
  349. /package/{serialization/resources/traces → dist/api/resources/tracing}/index.d.ts +0 -0
  350. /package/{serialization/resources/traces → dist/api/resources/tracing}/index.js +0 -0
@@ -61,7 +61,7 @@ class Run {
61
61
  * @throws {@link Scorecard.UnprocessableEntityError}
62
62
  *
63
63
  * @example
64
- * await scorecard.run.create()
64
+ * await client.run.create()
65
65
  */
66
66
  create(request = {}, requestOptions) {
67
67
  var _a, _b;
@@ -69,15 +69,16 @@ 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.5.4", "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.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
73
  contentType: "application/json",
74
- body: yield serializers.RunCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
74
+ requestType: "json",
75
+ body: serializers.RunCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
75
76
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
76
77
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
77
78
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
78
79
  });
79
80
  if (_response.ok) {
80
- return yield serializers.Run.parseOrThrow(_response.body, {
81
+ return serializers.Run.parseOrThrow(_response.body, {
81
82
  unrecognizedObjectKeys: "passthrough",
82
83
  allowUnrecognizedUnionMembers: true,
83
84
  allowUnrecognizedEnumValues: true,
@@ -88,7 +89,7 @@ class Run {
88
89
  if (_response.error.reason === "status-code") {
89
90
  switch (_response.error.statusCode) {
90
91
  case 401:
91
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
92
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
92
93
  unrecognizedObjectKeys: "passthrough",
93
94
  allowUnrecognizedUnionMembers: true,
94
95
  allowUnrecognizedEnumValues: true,
@@ -96,7 +97,7 @@ class Run {
96
97
  breadcrumbsPrefix: ["response"],
97
98
  }));
98
99
  case 403:
99
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
100
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
100
101
  unrecognizedObjectKeys: "passthrough",
101
102
  allowUnrecognizedUnionMembers: true,
102
103
  allowUnrecognizedEnumValues: true,
@@ -104,7 +105,7 @@ class Run {
104
105
  breadcrumbsPrefix: ["response"],
105
106
  }));
106
107
  case 404:
107
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
108
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
108
109
  unrecognizedObjectKeys: "passthrough",
109
110
  allowUnrecognizedUnionMembers: true,
110
111
  allowUnrecognizedEnumValues: true,
@@ -112,7 +113,7 @@ class Run {
112
113
  breadcrumbsPrefix: ["response"],
113
114
  }));
114
115
  case 422:
115
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
116
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
116
117
  unrecognizedObjectKeys: "passthrough",
117
118
  allowUnrecognizedUnionMembers: true,
118
119
  allowUnrecognizedEnumValues: true,
@@ -153,7 +154,7 @@ class Run {
153
154
  * @throws {@link Scorecard.UnprocessableEntityError}
154
155
  *
155
156
  * @example
156
- * await scorecard.run.get(1)
157
+ * await client.run.get(1)
157
158
  */
158
159
  get(runId, requestOptions) {
159
160
  var _a, _b;
@@ -161,14 +162,15 @@ class Run {
161
162
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
162
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)}`),
163
164
  method: "GET",
164
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.4", "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.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
166
  contentType: "application/json",
167
+ requestType: "json",
166
168
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
167
169
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
168
170
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
171
  });
170
172
  if (_response.ok) {
171
- return yield serializers.Run.parseOrThrow(_response.body, {
173
+ return serializers.Run.parseOrThrow(_response.body, {
172
174
  unrecognizedObjectKeys: "passthrough",
173
175
  allowUnrecognizedUnionMembers: true,
174
176
  allowUnrecognizedEnumValues: true,
@@ -179,7 +181,7 @@ class Run {
179
181
  if (_response.error.reason === "status-code") {
180
182
  switch (_response.error.statusCode) {
181
183
  case 401:
182
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
184
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
183
185
  unrecognizedObjectKeys: "passthrough",
184
186
  allowUnrecognizedUnionMembers: true,
185
187
  allowUnrecognizedEnumValues: true,
@@ -187,7 +189,7 @@ class Run {
187
189
  breadcrumbsPrefix: ["response"],
188
190
  }));
189
191
  case 403:
190
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
192
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
191
193
  unrecognizedObjectKeys: "passthrough",
192
194
  allowUnrecognizedUnionMembers: true,
193
195
  allowUnrecognizedEnumValues: true,
@@ -195,7 +197,7 @@ class Run {
195
197
  breadcrumbsPrefix: ["response"],
196
198
  }));
197
199
  case 404:
198
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
200
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
199
201
  unrecognizedObjectKeys: "passthrough",
200
202
  allowUnrecognizedUnionMembers: true,
201
203
  allowUnrecognizedEnumValues: true,
@@ -203,7 +205,7 @@ class Run {
203
205
  breadcrumbsPrefix: ["response"],
204
206
  }));
205
207
  case 422:
206
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
208
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
207
209
  unrecognizedObjectKeys: "passthrough",
208
210
  allowUnrecognizedUnionMembers: true,
209
211
  allowUnrecognizedEnumValues: true,
@@ -245,7 +247,7 @@ class Run {
245
247
  * @throws {@link Scorecard.UnprocessableEntityError}
246
248
  *
247
249
  * @example
248
- * await scorecard.run.updateStatus(1)
250
+ * await client.run.updateStatus(1)
249
251
  */
250
252
  updateStatus(runId, request = {}, requestOptions) {
251
253
  var _a, _b;
@@ -253,15 +255,16 @@ class Run {
253
255
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
254
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`),
255
257
  method: "PATCH",
256
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.4", "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.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
257
259
  contentType: "application/json",
258
- body: yield serializers.UpdateStatusParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
260
+ requestType: "json",
261
+ body: serializers.UpdateStatusParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
259
262
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
260
263
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
261
264
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
262
265
  });
263
266
  if (_response.ok) {
264
- return yield serializers.Run.parseOrThrow(_response.body, {
267
+ return serializers.Run.parseOrThrow(_response.body, {
265
268
  unrecognizedObjectKeys: "passthrough",
266
269
  allowUnrecognizedUnionMembers: true,
267
270
  allowUnrecognizedEnumValues: true,
@@ -272,7 +275,7 @@ class Run {
272
275
  if (_response.error.reason === "status-code") {
273
276
  switch (_response.error.statusCode) {
274
277
  case 401:
275
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
278
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
276
279
  unrecognizedObjectKeys: "passthrough",
277
280
  allowUnrecognizedUnionMembers: true,
278
281
  allowUnrecognizedEnumValues: true,
@@ -280,7 +283,7 @@ class Run {
280
283
  breadcrumbsPrefix: ["response"],
281
284
  }));
282
285
  case 403:
283
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
286
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
284
287
  unrecognizedObjectKeys: "passthrough",
285
288
  allowUnrecognizedUnionMembers: true,
286
289
  allowUnrecognizedEnumValues: true,
@@ -288,7 +291,7 @@ class Run {
288
291
  breadcrumbsPrefix: ["response"],
289
292
  }));
290
293
  case 404:
291
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
294
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
292
295
  unrecognizedObjectKeys: "passthrough",
293
296
  allowUnrecognizedUnionMembers: true,
294
297
  allowUnrecognizedEnumValues: true,
@@ -296,7 +299,7 @@ class Run {
296
299
  breadcrumbsPrefix: ["response"],
297
300
  }));
298
301
  case 422:
299
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
302
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
300
303
  unrecognizedObjectKeys: "passthrough",
301
304
  allowUnrecognizedUnionMembers: true,
302
305
  allowUnrecognizedEnumValues: true,
@@ -11,8 +11,11 @@ export declare namespace RunMetric {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -31,7 +34,7 @@ export declare class RunMetric {
31
34
  * @throws {@link Scorecard.UnprocessableEntityError}
32
35
  *
33
36
  * @example
34
- * await scorecard.runMetric.get(1)
37
+ * await client.runMetric.get(1)
35
38
  */
36
39
  get(runId: number, requestOptions?: RunMetric.RequestOptions): Promise<Scorecard.RunMetric[]>;
37
40
  protected _getCustomAuthorizationHeaders(): Promise<{
@@ -61,7 +61,7 @@ class RunMetric {
61
61
  * @throws {@link Scorecard.UnprocessableEntityError}
62
62
  *
63
63
  * @example
64
- * await scorecard.runMetric.get(1)
64
+ * await client.runMetric.get(1)
65
65
  */
66
66
  get(runId, requestOptions) {
67
67
  var _a, _b;
@@ -69,14 +69,15 @@ 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.5.4", "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.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
73
  contentType: "application/json",
74
+ requestType: "json",
74
75
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
75
76
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
76
77
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
77
78
  });
78
79
  if (_response.ok) {
79
- return yield serializers.runMetric.get.Response.parseOrThrow(_response.body, {
80
+ return serializers.runMetric.get.Response.parseOrThrow(_response.body, {
80
81
  unrecognizedObjectKeys: "passthrough",
81
82
  allowUnrecognizedUnionMembers: true,
82
83
  allowUnrecognizedEnumValues: true,
@@ -87,7 +88,7 @@ class RunMetric {
87
88
  if (_response.error.reason === "status-code") {
88
89
  switch (_response.error.statusCode) {
89
90
  case 401:
90
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
91
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
91
92
  unrecognizedObjectKeys: "passthrough",
92
93
  allowUnrecognizedUnionMembers: true,
93
94
  allowUnrecognizedEnumValues: true,
@@ -95,7 +96,7 @@ class RunMetric {
95
96
  breadcrumbsPrefix: ["response"],
96
97
  }));
97
98
  case 403:
98
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
99
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
99
100
  unrecognizedObjectKeys: "passthrough",
100
101
  allowUnrecognizedUnionMembers: true,
101
102
  allowUnrecognizedEnumValues: true,
@@ -103,7 +104,7 @@ class RunMetric {
103
104
  breadcrumbsPrefix: ["response"],
104
105
  }));
105
106
  case 404:
106
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
107
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
107
108
  unrecognizedObjectKeys: "passthrough",
108
109
  allowUnrecognizedUnionMembers: true,
109
110
  allowUnrecognizedEnumValues: true,
@@ -111,7 +112,7 @@ class RunMetric {
111
112
  breadcrumbsPrefix: ["response"],
112
113
  }));
113
114
  case 422:
114
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
115
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
115
116
  unrecognizedObjectKeys: "passthrough",
116
117
  allowUnrecognizedUnionMembers: true,
117
118
  allowUnrecognizedEnumValues: true,
@@ -11,8 +11,11 @@ export declare namespace Score {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -33,7 +36,7 @@ export declare class Score {
33
36
  * @throws {@link Scorecard.UnprocessableEntityError}
34
37
  *
35
38
  * @example
36
- * await scorecard.score.create(1, 1, {
39
+ * await client.score.create(1, 1, {
37
40
  * metricId: 1
38
41
  * })
39
42
  */
@@ -53,7 +56,7 @@ export declare class Score {
53
56
  * @throws {@link Scorecard.UnprocessableEntityError}
54
57
  *
55
58
  * @example
56
- * await scorecard.score.update(1, 1, 1)
59
+ * await client.score.update(1, 1, 1)
57
60
  */
58
61
  update(runId: number, testrecordId: number, scoreId: number, request?: Scorecard.ScoreUpdateParams, requestOptions?: Score.RequestOptions): Promise<Scorecard.Grade>;
59
62
  protected _getCustomAuthorizationHeaders(): Promise<{
@@ -63,7 +63,7 @@ class Score {
63
63
  * @throws {@link Scorecard.UnprocessableEntityError}
64
64
  *
65
65
  * @example
66
- * await scorecard.score.create(1, 1, {
66
+ * await client.score.create(1, 1, {
67
67
  * metricId: 1
68
68
  * })
69
69
  */
@@ -73,15 +73,16 @@ 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.5.4", "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.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
77
  contentType: "application/json",
78
- body: yield serializers.ScoreCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
78
+ requestType: "json",
79
+ body: serializers.ScoreCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
79
80
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
80
81
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
81
82
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
82
83
  });
83
84
  if (_response.ok) {
84
- return yield serializers.Grade.parseOrThrow(_response.body, {
85
+ return serializers.Grade.parseOrThrow(_response.body, {
85
86
  unrecognizedObjectKeys: "passthrough",
86
87
  allowUnrecognizedUnionMembers: true,
87
88
  allowUnrecognizedEnumValues: true,
@@ -92,7 +93,7 @@ class Score {
92
93
  if (_response.error.reason === "status-code") {
93
94
  switch (_response.error.statusCode) {
94
95
  case 401:
95
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
96
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
96
97
  unrecognizedObjectKeys: "passthrough",
97
98
  allowUnrecognizedUnionMembers: true,
98
99
  allowUnrecognizedEnumValues: true,
@@ -100,7 +101,7 @@ class Score {
100
101
  breadcrumbsPrefix: ["response"],
101
102
  }));
102
103
  case 403:
103
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
104
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
104
105
  unrecognizedObjectKeys: "passthrough",
105
106
  allowUnrecognizedUnionMembers: true,
106
107
  allowUnrecognizedEnumValues: true,
@@ -108,7 +109,7 @@ class Score {
108
109
  breadcrumbsPrefix: ["response"],
109
110
  }));
110
111
  case 404:
111
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
112
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
112
113
  unrecognizedObjectKeys: "passthrough",
113
114
  allowUnrecognizedUnionMembers: true,
114
115
  allowUnrecognizedEnumValues: true,
@@ -116,7 +117,7 @@ class Score {
116
117
  breadcrumbsPrefix: ["response"],
117
118
  }));
118
119
  case 422:
119
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
120
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
120
121
  unrecognizedObjectKeys: "passthrough",
121
122
  allowUnrecognizedUnionMembers: true,
122
123
  allowUnrecognizedEnumValues: true,
@@ -160,7 +161,7 @@ class Score {
160
161
  * @throws {@link Scorecard.UnprocessableEntityError}
161
162
  *
162
163
  * @example
163
- * await scorecard.score.update(1, 1, 1)
164
+ * await client.score.update(1, 1, 1)
164
165
  */
165
166
  update(runId, testrecordId, scoreId, request = {}, requestOptions) {
166
167
  var _a, _b;
@@ -168,15 +169,16 @@ class Score {
168
169
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
169
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)}`),
170
171
  method: "PATCH",
171
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.4", "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.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
173
  contentType: "application/json",
173
- body: yield serializers.ScoreUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
174
+ requestType: "json",
175
+ body: serializers.ScoreUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
174
176
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
175
177
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
176
178
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
177
179
  });
178
180
  if (_response.ok) {
179
- return yield serializers.Grade.parseOrThrow(_response.body, {
181
+ return serializers.Grade.parseOrThrow(_response.body, {
180
182
  unrecognizedObjectKeys: "passthrough",
181
183
  allowUnrecognizedUnionMembers: true,
182
184
  allowUnrecognizedEnumValues: true,
@@ -187,7 +189,7 @@ class Score {
187
189
  if (_response.error.reason === "status-code") {
188
190
  switch (_response.error.statusCode) {
189
191
  case 401:
190
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
192
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
191
193
  unrecognizedObjectKeys: "passthrough",
192
194
  allowUnrecognizedUnionMembers: true,
193
195
  allowUnrecognizedEnumValues: true,
@@ -195,7 +197,7 @@ class Score {
195
197
  breadcrumbsPrefix: ["response"],
196
198
  }));
197
199
  case 403:
198
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
200
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
199
201
  unrecognizedObjectKeys: "passthrough",
200
202
  allowUnrecognizedUnionMembers: true,
201
203
  allowUnrecognizedEnumValues: true,
@@ -203,7 +205,7 @@ class Score {
203
205
  breadcrumbsPrefix: ["response"],
204
206
  }));
205
207
  case 404:
206
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
208
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
207
209
  unrecognizedObjectKeys: "passthrough",
208
210
  allowUnrecognizedUnionMembers: true,
209
211
  allowUnrecognizedEnumValues: true,
@@ -211,7 +213,7 @@ class Score {
211
213
  breadcrumbsPrefix: ["response"],
212
214
  }));
213
215
  case 422:
214
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
216
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
215
217
  unrecognizedObjectKeys: "passthrough",
216
218
  allowUnrecognizedUnionMembers: true,
217
219
  allowUnrecognizedEnumValues: true,
@@ -0,0 +1,62 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments";
5
+ import * as core from "../../../../core";
6
+ import * as Scorecard from "../../../index";
7
+ export declare namespace ScoringConfig {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
+ apiKey: core.Supplier<string>;
11
+ fetcher?: core.FetchFunction;
12
+ }
13
+ interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
15
+ timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
17
+ maxRetries?: number;
18
+ /** A hook to abort the request. */
19
+ abortSignal?: AbortSignal;
20
+ }
21
+ }
22
+ export declare class ScoringConfig {
23
+ protected readonly _options: ScoringConfig.Options;
24
+ constructor(_options: ScoringConfig.Options);
25
+ /**
26
+ * Create a new scoring config.
27
+ *
28
+ * @param {Scorecard.ScoringConfigCreateParams} request
29
+ * @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link Scorecard.UnauthorizedError}
32
+ * @throws {@link Scorecard.ForbiddenError}
33
+ * @throws {@link Scorecard.NotFoundError}
34
+ * @throws {@link Scorecard.UnprocessableEntityError}
35
+ *
36
+ * @example
37
+ * await client.scoringConfig.create({
38
+ * name: "Scoring Config Name",
39
+ * description: "Description of the scoring config",
40
+ * metrics: [1, 2, 3]
41
+ * })
42
+ */
43
+ create(request?: Scorecard.ScoringConfigCreateParams, requestOptions?: ScoringConfig.RequestOptions): Promise<Scorecard.ScoringConfig>;
44
+ /**
45
+ * Retrieve a scoring config by id
46
+ *
47
+ * @param {string} id - The id of the scoring config to get.
48
+ * @param {ScoringConfig.RequestOptions} requestOptions - Request-specific configuration.
49
+ *
50
+ * @throws {@link Scorecard.UnauthorizedError}
51
+ * @throws {@link Scorecard.ForbiddenError}
52
+ * @throws {@link Scorecard.NotFoundError}
53
+ * @throws {@link Scorecard.UnprocessableEntityError}
54
+ *
55
+ * @example
56
+ * await client.scoringConfig.get("id")
57
+ */
58
+ get(id: string, requestOptions?: ScoringConfig.RequestOptions): Promise<Scorecard.ScoringConfig>;
59
+ protected _getCustomAuthorizationHeaders(): Promise<{
60
+ "X-API-Key": string;
61
+ }>;
62
+ }