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
@@ -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,2 +1,3 @@
1
+ export { type TestsetUpdateParams } from "./TestsetUpdateParams";
1
2
  export { type TestsetCreateParams } from "./TestsetCreateParams";
2
3
  export { type TestsetGetTestcasesRequest } from "./TestsetGetTestcasesRequest";
@@ -0,0 +1,72 @@
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 Tracing {
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 Tracing {
23
+ protected readonly _options: Tracing.Options;
24
+ constructor(_options: Tracing.Options);
25
+ /**
26
+ * Retrieve traces
27
+ *
28
+ * @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
29
+ *
30
+ * @throws {@link Scorecard.UnauthorizedError}
31
+ * @throws {@link Scorecard.ForbiddenError}
32
+ * @throws {@link Scorecard.NotFoundError}
33
+ *
34
+ * @example
35
+ * await client.tracing.traces()
36
+ */
37
+ traces(requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Trace[]>;
38
+ /**
39
+ * Retrieve specified trace
40
+ *
41
+ * @param {string} traceId - The ID of the trace to retrieve spans from.
42
+ * @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
43
+ *
44
+ * @throws {@link Scorecard.UnauthorizedError}
45
+ * @throws {@link Scorecard.ForbiddenError}
46
+ * @throws {@link Scorecard.NotFoundError}
47
+ * @throws {@link Scorecard.UnprocessableEntityError}
48
+ *
49
+ * @example
50
+ * await client.tracing.trace("trace_id")
51
+ */
52
+ trace(traceId: string, requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Trace>;
53
+ /**
54
+ * Retrieve specified span
55
+ *
56
+ * @param {string} traceId - The ID of the trace which the span is a part of.
57
+ * @param {string} spanId - The ID of the span to retrieve.
58
+ * @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
59
+ *
60
+ * @throws {@link Scorecard.UnauthorizedError}
61
+ * @throws {@link Scorecard.ForbiddenError}
62
+ * @throws {@link Scorecard.NotFoundError}
63
+ * @throws {@link Scorecard.UnprocessableEntityError}
64
+ *
65
+ * @example
66
+ * await client.tracing.span("trace_id", "span_id")
67
+ */
68
+ span(traceId: string, spanId: string, requestOptions?: Tracing.RequestOptions): Promise<Scorecard.Span>;
69
+ protected _getCustomAuthorizationHeaders(): Promise<{
70
+ "X-API-Key": string;
71
+ }>;
72
+ }
@@ -0,0 +1,327 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __importDefault = (this && this.__importDefault) || function (mod) {
38
+ return (mod && mod.__esModule) ? mod : { "default": mod };
39
+ };
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.Tracing = void 0;
42
+ const environments = __importStar(require("../../../../environments"));
43
+ const core = __importStar(require("../../../../core"));
44
+ const Scorecard = __importStar(require("../../../index"));
45
+ const url_join_1 = __importDefault(require("url-join"));
46
+ const serializers = __importStar(require("../../../../serialization/index"));
47
+ const errors = __importStar(require("../../../../errors/index"));
48
+ class Tracing {
49
+ constructor(_options) {
50
+ this._options = _options;
51
+ }
52
+ /**
53
+ * Retrieve traces
54
+ *
55
+ * @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
56
+ *
57
+ * @throws {@link Scorecard.UnauthorizedError}
58
+ * @throws {@link Scorecard.ForbiddenError}
59
+ * @throws {@link Scorecard.NotFoundError}
60
+ *
61
+ * @example
62
+ * await client.tracing.traces()
63
+ */
64
+ traces(requestOptions) {
65
+ var _a, _b;
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
68
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/traces"),
69
+ method: "GET",
70
+ 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())),
71
+ contentType: "application/json",
72
+ requestType: "json",
73
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
74
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
75
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
76
+ });
77
+ if (_response.ok) {
78
+ return serializers.tracing.traces.Response.parseOrThrow(_response.body, {
79
+ unrecognizedObjectKeys: "passthrough",
80
+ allowUnrecognizedUnionMembers: true,
81
+ allowUnrecognizedEnumValues: true,
82
+ skipValidation: true,
83
+ breadcrumbsPrefix: ["response"],
84
+ });
85
+ }
86
+ if (_response.error.reason === "status-code") {
87
+ switch (_response.error.statusCode) {
88
+ case 401:
89
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
90
+ unrecognizedObjectKeys: "passthrough",
91
+ allowUnrecognizedUnionMembers: true,
92
+ allowUnrecognizedEnumValues: true,
93
+ skipValidation: true,
94
+ breadcrumbsPrefix: ["response"],
95
+ }));
96
+ case 403:
97
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
98
+ unrecognizedObjectKeys: "passthrough",
99
+ allowUnrecognizedUnionMembers: true,
100
+ allowUnrecognizedEnumValues: true,
101
+ skipValidation: true,
102
+ breadcrumbsPrefix: ["response"],
103
+ }));
104
+ case 404:
105
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
106
+ unrecognizedObjectKeys: "passthrough",
107
+ allowUnrecognizedUnionMembers: true,
108
+ allowUnrecognizedEnumValues: true,
109
+ skipValidation: true,
110
+ breadcrumbsPrefix: ["response"],
111
+ }));
112
+ default:
113
+ throw new errors.ScorecardError({
114
+ statusCode: _response.error.statusCode,
115
+ body: _response.error.body,
116
+ });
117
+ }
118
+ }
119
+ switch (_response.error.reason) {
120
+ case "non-json":
121
+ throw new errors.ScorecardError({
122
+ statusCode: _response.error.statusCode,
123
+ body: _response.error.rawBody,
124
+ });
125
+ case "timeout":
126
+ throw new errors.ScorecardTimeoutError();
127
+ case "unknown":
128
+ throw new errors.ScorecardError({
129
+ message: _response.error.errorMessage,
130
+ });
131
+ }
132
+ });
133
+ }
134
+ /**
135
+ * Retrieve specified trace
136
+ *
137
+ * @param {string} traceId - The ID of the trace to retrieve spans from.
138
+ * @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
139
+ *
140
+ * @throws {@link Scorecard.UnauthorizedError}
141
+ * @throws {@link Scorecard.ForbiddenError}
142
+ * @throws {@link Scorecard.NotFoundError}
143
+ * @throws {@link Scorecard.UnprocessableEntityError}
144
+ *
145
+ * @example
146
+ * await client.tracing.trace("trace_id")
147
+ */
148
+ trace(traceId, requestOptions) {
149
+ var _a, _b;
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
152
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}`),
153
+ method: "GET",
154
+ 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())),
155
+ contentType: "application/json",
156
+ requestType: "json",
157
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
158
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
159
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
160
+ });
161
+ if (_response.ok) {
162
+ return serializers.Trace.parseOrThrow(_response.body, {
163
+ unrecognizedObjectKeys: "passthrough",
164
+ allowUnrecognizedUnionMembers: true,
165
+ allowUnrecognizedEnumValues: true,
166
+ skipValidation: true,
167
+ breadcrumbsPrefix: ["response"],
168
+ });
169
+ }
170
+ if (_response.error.reason === "status-code") {
171
+ switch (_response.error.statusCode) {
172
+ case 401:
173
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
174
+ unrecognizedObjectKeys: "passthrough",
175
+ allowUnrecognizedUnionMembers: true,
176
+ allowUnrecognizedEnumValues: true,
177
+ skipValidation: true,
178
+ breadcrumbsPrefix: ["response"],
179
+ }));
180
+ case 403:
181
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
182
+ unrecognizedObjectKeys: "passthrough",
183
+ allowUnrecognizedUnionMembers: true,
184
+ allowUnrecognizedEnumValues: true,
185
+ skipValidation: true,
186
+ breadcrumbsPrefix: ["response"],
187
+ }));
188
+ case 404:
189
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
190
+ unrecognizedObjectKeys: "passthrough",
191
+ allowUnrecognizedUnionMembers: true,
192
+ allowUnrecognizedEnumValues: true,
193
+ skipValidation: true,
194
+ breadcrumbsPrefix: ["response"],
195
+ }));
196
+ case 422:
197
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
198
+ unrecognizedObjectKeys: "passthrough",
199
+ allowUnrecognizedUnionMembers: true,
200
+ allowUnrecognizedEnumValues: true,
201
+ skipValidation: true,
202
+ breadcrumbsPrefix: ["response"],
203
+ }));
204
+ default:
205
+ throw new errors.ScorecardError({
206
+ statusCode: _response.error.statusCode,
207
+ body: _response.error.body,
208
+ });
209
+ }
210
+ }
211
+ switch (_response.error.reason) {
212
+ case "non-json":
213
+ throw new errors.ScorecardError({
214
+ statusCode: _response.error.statusCode,
215
+ body: _response.error.rawBody,
216
+ });
217
+ case "timeout":
218
+ throw new errors.ScorecardTimeoutError();
219
+ case "unknown":
220
+ throw new errors.ScorecardError({
221
+ message: _response.error.errorMessage,
222
+ });
223
+ }
224
+ });
225
+ }
226
+ /**
227
+ * Retrieve specified span
228
+ *
229
+ * @param {string} traceId - The ID of the trace which the span is a part of.
230
+ * @param {string} spanId - The ID of the span to retrieve.
231
+ * @param {Tracing.RequestOptions} requestOptions - Request-specific configuration.
232
+ *
233
+ * @throws {@link Scorecard.UnauthorizedError}
234
+ * @throws {@link Scorecard.ForbiddenError}
235
+ * @throws {@link Scorecard.NotFoundError}
236
+ * @throws {@link Scorecard.UnprocessableEntityError}
237
+ *
238
+ * @example
239
+ * await client.tracing.span("trace_id", "span_id")
240
+ */
241
+ span(traceId, spanId, requestOptions) {
242
+ var _a, _b;
243
+ return __awaiter(this, void 0, void 0, function* () {
244
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
245
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}/spans/${encodeURIComponent(spanId)}`),
246
+ method: "GET",
247
+ 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())),
248
+ contentType: "application/json",
249
+ requestType: "json",
250
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
251
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
252
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
253
+ });
254
+ if (_response.ok) {
255
+ return serializers.Span.parseOrThrow(_response.body, {
256
+ unrecognizedObjectKeys: "passthrough",
257
+ allowUnrecognizedUnionMembers: true,
258
+ allowUnrecognizedEnumValues: true,
259
+ skipValidation: true,
260
+ breadcrumbsPrefix: ["response"],
261
+ });
262
+ }
263
+ if (_response.error.reason === "status-code") {
264
+ switch (_response.error.statusCode) {
265
+ case 401:
266
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
267
+ unrecognizedObjectKeys: "passthrough",
268
+ allowUnrecognizedUnionMembers: true,
269
+ allowUnrecognizedEnumValues: true,
270
+ skipValidation: true,
271
+ breadcrumbsPrefix: ["response"],
272
+ }));
273
+ case 403:
274
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
275
+ unrecognizedObjectKeys: "passthrough",
276
+ allowUnrecognizedUnionMembers: true,
277
+ allowUnrecognizedEnumValues: true,
278
+ skipValidation: true,
279
+ breadcrumbsPrefix: ["response"],
280
+ }));
281
+ case 404:
282
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
283
+ unrecognizedObjectKeys: "passthrough",
284
+ allowUnrecognizedUnionMembers: true,
285
+ allowUnrecognizedEnumValues: true,
286
+ skipValidation: true,
287
+ breadcrumbsPrefix: ["response"],
288
+ }));
289
+ case 422:
290
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
291
+ unrecognizedObjectKeys: "passthrough",
292
+ allowUnrecognizedUnionMembers: true,
293
+ allowUnrecognizedEnumValues: true,
294
+ skipValidation: true,
295
+ breadcrumbsPrefix: ["response"],
296
+ }));
297
+ default:
298
+ throw new errors.ScorecardError({
299
+ statusCode: _response.error.statusCode,
300
+ body: _response.error.body,
301
+ });
302
+ }
303
+ }
304
+ switch (_response.error.reason) {
305
+ case "non-json":
306
+ throw new errors.ScorecardError({
307
+ statusCode: _response.error.statusCode,
308
+ body: _response.error.rawBody,
309
+ });
310
+ case "timeout":
311
+ throw new errors.ScorecardTimeoutError();
312
+ case "unknown":
313
+ throw new errors.ScorecardError({
314
+ message: _response.error.errorMessage,
315
+ });
316
+ }
317
+ });
318
+ }
319
+ _getCustomAuthorizationHeaders() {
320
+ var _a;
321
+ return __awaiter(this, void 0, void 0, function* () {
322
+ const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["SCORECARD_API_KEY"];
323
+ return { "X-API-Key": apiKeyValue };
324
+ });
325
+ }
326
+ }
327
+ exports.Tracing = Tracing;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare type IngestionMethod = "csv" | "logging";
5
+ export declare const IngestionMethod: {
6
+ readonly Csv: "csv";
7
+ readonly Logging: "logging";
8
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.IngestionMethod = void 0;
7
+ exports.IngestionMethod = {
8
+ Csv: "csv",
9
+ Logging: "logging",
10
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ScoringConfig {
5
+ /** The organization this resource belongs to. */
6
+ orgId?: string;
7
+ /** The user this record belongs to. */
8
+ userId?: string;
9
+ id?: number;
10
+ name?: string;
11
+ description?: string;
12
+ config?: Record<string, unknown>;
13
+ isArchived?: boolean;
14
+ metrics?: number[];
15
+ createdAt?: Date;
16
+ }
@@ -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 });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface TestcaseBatchDeletionResponse {
5
+ /** The IDs of the testcases that were deleted. */
6
+ ids: number[];
7
+ /** The message indicating the testcases were deleted. */
8
+ detail: string;
9
+ }
@@ -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 });
@@ -31,4 +31,6 @@ export interface Testrecord {
31
31
  modelParams?: Record<string, Scorecard.TestrecordModelParamsValue | undefined>;
32
32
  /** Debug information produced during the testrecord's generation. */
33
33
  modelDebugInfo?: Record<string, Scorecard.TestrecordModelDebugInfoValue | undefined>;
34
+ /** The error message for the testrecord. */
35
+ errorMessage?: string;
34
36
  }
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Scorecard from "../index";
4
5
  export interface Trace {
5
6
  traceId: string;
6
7
  start: Date;
7
8
  end: Date;
9
+ spans?: Scorecard.Span[];
8
10
  }
@@ -1,10 +1,10 @@
1
- export * from "./CreateRunParams";
2
1
  export * from "./CustomSchema";
3
2
  export * from "./CustomVariable";
4
3
  export * from "./DataTypeEnum";
5
4
  export * from "./FileUrl";
6
5
  export * from "./Grade";
7
6
  export * from "./HttpValidationError";
7
+ export * from "./IngestionMethod";
8
8
  export * from "./JsonObjectInputValue";
9
9
  export * from "./JsonObject";
10
10
  export * from "./JsonObjectOutputValue";
@@ -17,13 +17,12 @@ export * from "./Run";
17
17
  export * from "./RunMetric";
18
18
  export * from "./RunStatus";
19
19
  export * from "./ScoreStatus";
20
+ export * from "./ScoringConfig";
20
21
  export * from "./Span";
21
22
  export * from "./TestCaseCustomInputsValue";
22
23
  export * from "./TestCaseCustomLabelsValue";
23
24
  export * from "./TestCase";
24
- export * from "./TestCaseCreate";
25
- export * from "./TestRecordCreate";
26
- export * from "./TestSetCreate";
25
+ export * from "./TestcaseBatchDeletionResponse";
27
26
  export * from "./TestcaseDeletionResponse";
28
27
  export * from "./TestrecordCustomInputsValue";
29
28
  export * from "./TestrecordCustomLabelsValue";
@@ -38,3 +37,6 @@ export * from "./UnauthorizedErrorBody";
38
37
  export * from "./ValidationErrorLocItem";
39
38
  export * from "./ValidationError";
40
39
  export * from "./CreateGithubWorkflowParams";
40
+ export * from "./CreateRunParams";
41
+ export * from "./TestRecordCreate";
42
+ export * from "./TestSetCreate";
@@ -14,13 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./CreateRunParams"), exports);
18
17
  __exportStar(require("./CustomSchema"), exports);
19
18
  __exportStar(require("./CustomVariable"), exports);
20
19
  __exportStar(require("./DataTypeEnum"), exports);
21
20
  __exportStar(require("./FileUrl"), exports);
22
21
  __exportStar(require("./Grade"), exports);
23
22
  __exportStar(require("./HttpValidationError"), exports);
23
+ __exportStar(require("./IngestionMethod"), exports);
24
24
  __exportStar(require("./JsonObjectInputValue"), exports);
25
25
  __exportStar(require("./JsonObject"), exports);
26
26
  __exportStar(require("./JsonObjectOutputValue"), exports);
@@ -33,13 +33,12 @@ __exportStar(require("./Run"), exports);
33
33
  __exportStar(require("./RunMetric"), exports);
34
34
  __exportStar(require("./RunStatus"), exports);
35
35
  __exportStar(require("./ScoreStatus"), exports);
36
+ __exportStar(require("./ScoringConfig"), exports);
36
37
  __exportStar(require("./Span"), exports);
37
38
  __exportStar(require("./TestCaseCustomInputsValue"), exports);
38
39
  __exportStar(require("./TestCaseCustomLabelsValue"), exports);
39
40
  __exportStar(require("./TestCase"), exports);
40
- __exportStar(require("./TestCaseCreate"), exports);
41
- __exportStar(require("./TestRecordCreate"), exports);
42
- __exportStar(require("./TestSetCreate"), exports);
41
+ __exportStar(require("./TestcaseBatchDeletionResponse"), exports);
43
42
  __exportStar(require("./TestcaseDeletionResponse"), exports);
44
43
  __exportStar(require("./TestrecordCustomInputsValue"), exports);
45
44
  __exportStar(require("./TestrecordCustomLabelsValue"), exports);
@@ -54,3 +53,6 @@ __exportStar(require("./UnauthorizedErrorBody"), exports);
54
53
  __exportStar(require("./ValidationErrorLocItem"), exports);
55
54
  __exportStar(require("./ValidationError"), exports);
56
55
  __exportStar(require("./CreateGithubWorkflowParams"), exports);
56
+ __exportStar(require("./CreateRunParams"), exports);
57
+ __exportStar(require("./TestRecordCreate"), exports);
58
+ __exportStar(require("./TestSetCreate"), exports);
@@ -12,7 +12,9 @@ export declare namespace Fetcher {
12
12
  maxRetries?: number;
13
13
  withCredentials?: boolean;
14
14
  abortSignal?: AbortSignal;
15
- responseType?: "json" | "blob" | "streaming" | "text";
15
+ requestType?: "json" | "file" | "bytes";
16
+ responseType?: "json" | "blob" | "sse" | "streaming" | "text";
17
+ duplex?: "half";
16
18
  }
17
19
  type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
18
20
  interface FailedStatusCodeError {
@@ -33,4 +35,5 @@ export declare namespace Fetcher {
33
35
  errorMessage: string;
34
36
  }
35
37
  }
38
+ export declare function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>>;
36
39
  export declare const fetcher: FetchFunction;