scorecard-ai 0.5.4 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/Client.d.ts +9 -3
  2. package/Client.js +8 -3
  3. package/README.md +9 -9
  4. package/api/resources/index.d.ts +3 -1
  5. package/api/resources/index.js +4 -2
  6. package/api/resources/prompt/client/Client.d.ts +49 -25
  7. package/api/resources/prompt/client/Client.js +194 -72
  8. package/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
  9. package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +19 -0
  10. package/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
  11. package/api/resources/prompt/client/requests/index.d.ts +2 -0
  12. package/api/resources/run/client/Client.d.ts +6 -3
  13. package/api/resources/run/client/Client.js +26 -23
  14. package/api/resources/runMetric/client/Client.d.ts +4 -1
  15. package/api/resources/runMetric/client/Client.js +8 -7
  16. package/api/resources/score/client/Client.d.ts +5 -2
  17. package/api/resources/score/client/Client.js +18 -16
  18. package/api/resources/scoringConfig/client/Client.d.ts +78 -0
  19. package/api/resources/scoringConfig/client/Client.js +336 -0
  20. package/api/resources/scoringConfig/client/index.d.ts +1 -0
  21. package/api/resources/scoringConfig/client/index.js +17 -0
  22. package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +18 -0
  23. package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
  24. package/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
  25. package/api/resources/testcase/client/Client.d.ts +55 -3
  26. package/api/resources/testcase/client/Client.js +308 -22
  27. package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
  28. package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
  29. package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
  30. package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
  31. package/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  32. package/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
  33. package/api/resources/testcase/client/requests/index.d.ts +3 -0
  34. package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
  35. package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
  36. package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
  37. package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
  38. package/api/resources/testcase/types/index.d.ts +2 -0
  39. package/api/resources/testcase/types/index.js +2 -0
  40. package/api/resources/testrecord/client/Client.d.ts +5 -2
  41. package/api/resources/testrecord/client/Client.js +17 -15
  42. package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
  43. package/api/resources/testset/client/Client.d.ts +27 -8
  44. package/api/resources/testset/client/Client.js +148 -40
  45. package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
  46. package/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
  47. package/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
  48. package/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  49. package/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
  50. package/api/resources/testset/client/requests/index.d.ts +2 -0
  51. package/api/resources/tracing/client/Client.d.ts +72 -0
  52. package/api/resources/tracing/client/Client.js +327 -0
  53. package/api/types/IngestionMethod.d.ts +8 -0
  54. package/api/types/IngestionMethod.js +10 -0
  55. package/api/types/Prompt.d.ts +2 -0
  56. package/api/types/PromptCursorPage.d.ts +17 -0
  57. package/api/types/PromptCursorPage.js +5 -0
  58. package/api/types/ScoringConfig.d.ts +18 -0
  59. package/api/types/ScoringConfig.js +5 -0
  60. package/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
  61. package/api/types/TestcaseBatchDeletionResponse.js +5 -0
  62. package/api/types/Testrecord.d.ts +2 -0
  63. package/api/types/Testset.d.ts +2 -0
  64. package/api/types/TestsetCursorPage.d.ts +17 -0
  65. package/api/types/TestsetCursorPage.js +5 -0
  66. package/api/types/Trace.d.ts +2 -0
  67. package/api/types/index.d.ts +8 -4
  68. package/api/types/index.js +8 -4
  69. package/core/fetcher/Fetcher.d.ts +4 -1
  70. package/core/fetcher/Fetcher.js +19 -176
  71. package/core/fetcher/createRequestUrl.d.ts +1 -0
  72. package/core/fetcher/createRequestUrl.js +13 -0
  73. package/core/fetcher/getFetchFn.d.ts +4 -0
  74. package/core/fetcher/getFetchFn.js +59 -0
  75. package/core/fetcher/getRequestBody.d.ts +7 -0
  76. package/core/fetcher/getRequestBody.js +23 -0
  77. package/core/fetcher/getResponseBody.d.ts +1 -0
  78. package/core/fetcher/getResponseBody.js +52 -0
  79. package/core/fetcher/makeRequest.d.ts +1 -0
  80. package/core/fetcher/makeRequest.js +42 -0
  81. package/core/fetcher/requestWithRetries.d.ts +1 -0
  82. package/core/fetcher/requestWithRetries.js +32 -0
  83. package/core/fetcher/signals.d.ts +12 -0
  84. package/core/fetcher/signals.js +37 -0
  85. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
  86. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
  87. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  88. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  89. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  90. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
  91. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  92. package/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
  93. package/core/runtime/runtime.d.ts +2 -1
  94. package/core/runtime/runtime.js +12 -1
  95. package/core/schemas/Schema.d.ts +7 -4
  96. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  97. package/core/schemas/builders/lazy/lazy.js +8 -19
  98. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  99. package/core/schemas/builders/list/list.js +31 -44
  100. package/core/schemas/builders/object/object.js +90 -111
  101. package/core/schemas/builders/object/types.d.ts +2 -2
  102. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  103. package/core/schemas/builders/record/record.js +49 -60
  104. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  105. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  106. package/core/schemas/builders/set/set.js +6 -15
  107. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  108. package/core/schemas/builders/union/union.js +51 -62
  109. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  110. package/dist/Client.d.ts +9 -3
  111. package/dist/Client.js +8 -3
  112. package/dist/api/resources/index.d.ts +3 -1
  113. package/dist/api/resources/index.js +4 -2
  114. package/dist/api/resources/prompt/client/Client.d.ts +49 -25
  115. package/dist/api/resources/prompt/client/Client.js +194 -72
  116. package/dist/api/resources/prompt/client/requests/PromptCreateParams.d.ts +8 -2
  117. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +19 -0
  118. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
  119. package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.d.ts +21 -0
  120. package/dist/api/resources/prompt/client/requests/PromptListPromptsRequest.js +5 -0
  121. package/dist/api/resources/prompt/client/requests/index.d.ts +2 -0
  122. package/dist/api/resources/run/client/Client.d.ts +6 -3
  123. package/dist/api/resources/run/client/Client.js +26 -23
  124. package/dist/api/resources/runMetric/client/Client.d.ts +4 -1
  125. package/dist/api/resources/runMetric/client/Client.js +8 -7
  126. package/dist/api/resources/score/client/Client.d.ts +5 -2
  127. package/dist/api/resources/score/client/Client.js +18 -16
  128. package/dist/api/resources/scoringConfig/client/Client.d.ts +78 -0
  129. package/dist/api/resources/scoringConfig/client/Client.js +336 -0
  130. package/dist/api/resources/scoringConfig/client/index.d.ts +1 -0
  131. package/dist/api/resources/scoringConfig/client/index.js +17 -0
  132. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +18 -0
  133. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
  134. package/dist/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
  135. package/dist/api/resources/scoringConfig/client/requests/index.js +2 -0
  136. package/dist/api/resources/testcase/client/Client.d.ts +55 -3
  137. package/dist/api/resources/testcase/client/Client.js +308 -22
  138. package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
  139. package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
  140. package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
  141. package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
  142. package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  143. package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
  144. package/dist/api/resources/testcase/client/requests/index.d.ts +3 -0
  145. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
  146. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
  147. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
  148. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
  149. package/dist/api/resources/testcase/types/index.d.ts +2 -0
  150. package/dist/api/resources/testcase/types/index.js +2 -0
  151. package/dist/api/resources/testrecord/client/Client.d.ts +5 -2
  152. package/dist/api/resources/testrecord/client/Client.js +17 -15
  153. package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
  154. package/dist/api/resources/testset/client/Client.d.ts +27 -8
  155. package/dist/api/resources/testset/client/Client.js +148 -40
  156. package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
  157. package/dist/api/resources/testset/client/requests/TestsetGetRequest.d.ts +11 -0
  158. package/dist/api/resources/testset/client/requests/TestsetGetRequest.js +5 -0
  159. package/dist/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  160. package/dist/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
  161. package/dist/api/resources/testset/client/requests/index.d.ts +2 -0
  162. package/dist/api/resources/tracing/client/Client.d.ts +72 -0
  163. package/dist/api/resources/tracing/client/Client.js +327 -0
  164. package/dist/api/resources/tracing/client/index.js +2 -0
  165. package/dist/api/types/IngestionMethod.d.ts +8 -0
  166. package/dist/api/types/IngestionMethod.js +10 -0
  167. package/dist/api/types/Prompt.d.ts +2 -0
  168. package/dist/api/types/PromptCursorPage.d.ts +17 -0
  169. package/dist/api/types/PromptCursorPage.js +5 -0
  170. package/dist/api/types/ScoringConfig.d.ts +18 -0
  171. package/dist/api/types/ScoringConfig.js +5 -0
  172. package/dist/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
  173. package/dist/api/types/TestcaseBatchDeletionResponse.js +5 -0
  174. package/dist/api/types/Testrecord.d.ts +2 -0
  175. package/dist/api/types/Testset.d.ts +2 -0
  176. package/dist/api/types/TestsetCursorPage.d.ts +17 -0
  177. package/dist/api/types/TestsetCursorPage.js +5 -0
  178. package/dist/api/types/Trace.d.ts +2 -0
  179. package/dist/api/types/index.d.ts +8 -4
  180. package/dist/api/types/index.js +8 -4
  181. package/dist/core/fetcher/Fetcher.d.ts +4 -1
  182. package/dist/core/fetcher/Fetcher.js +19 -176
  183. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  184. package/dist/core/fetcher/createRequestUrl.js +13 -0
  185. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  186. package/dist/core/fetcher/getFetchFn.js +59 -0
  187. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  188. package/dist/core/fetcher/getRequestBody.js +23 -0
  189. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  190. package/dist/core/fetcher/getResponseBody.js +52 -0
  191. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  192. package/dist/core/fetcher/makeRequest.js +42 -0
  193. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  194. package/dist/core/fetcher/requestWithRetries.js +32 -0
  195. package/dist/core/fetcher/signals.d.ts +12 -0
  196. package/dist/core/fetcher/signals.js +37 -0
  197. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
  198. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
  199. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  200. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  201. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  202. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
  203. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  204. package/dist/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
  205. package/dist/core/runtime/runtime.d.ts +2 -1
  206. package/dist/core/runtime/runtime.js +12 -1
  207. package/dist/core/schemas/Schema.d.ts +7 -4
  208. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  209. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  210. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  211. package/dist/core/schemas/builders/list/list.js +31 -44
  212. package/dist/core/schemas/builders/object/object.js +90 -111
  213. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  214. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  215. package/dist/core/schemas/builders/record/record.js +49 -60
  216. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  217. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  218. package/dist/core/schemas/builders/set/set.js +6 -15
  219. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  220. package/dist/core/schemas/builders/union/union.js +51 -62
  221. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  222. package/dist/serialization/resources/index.d.ts +3 -1
  223. package/dist/serialization/resources/index.js +4 -2
  224. package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
  225. package/dist/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
  226. package/dist/serialization/resources/scoringConfig/client/index.d.ts +1 -0
  227. package/dist/serialization/resources/scoringConfig/client/index.js +17 -0
  228. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +15 -0
  229. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +36 -0
  230. package/dist/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
  231. package/dist/serialization/resources/scoringConfig/client/requests/index.js +5 -0
  232. package/dist/serialization/resources/scoringConfig/index.d.ts +1 -0
  233. package/dist/serialization/resources/scoringConfig/index.js +17 -0
  234. package/dist/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
  235. package/dist/serialization/resources/testcase/client/batchCopy.js +32 -0
  236. package/dist/serialization/resources/testcase/client/index.d.ts +1 -0
  237. package/dist/serialization/resources/testcase/client/index.js +14 -0
  238. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
  239. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
  240. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
  241. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
  242. package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  243. package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
  244. package/dist/serialization/resources/testcase/client/requests/index.d.ts +3 -0
  245. package/dist/serialization/resources/testcase/client/requests/index.js +7 -1
  246. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
  247. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
  248. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
  249. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
  250. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
  251. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
  252. package/dist/serialization/resources/testcase/types/index.d.ts +2 -0
  253. package/dist/serialization/resources/testcase/types/index.js +2 -0
  254. package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
  255. package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
  256. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
  257. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
  258. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
  259. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +5 -0
  260. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +5 -0
  261. package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  262. package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
  263. package/dist/serialization/resources/testset/client/requests/index.d.ts +1 -0
  264. package/dist/serialization/resources/testset/client/requests/index.js +3 -1
  265. package/dist/serialization/resources/tracing/client/index.d.ts +1 -0
  266. package/{serialization/resources/traces → dist/serialization/resources/tracing}/client/index.js +2 -2
  267. package/dist/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
  268. package/dist/serialization/resources/tracing/client/traces.js +32 -0
  269. package/dist/serialization/resources/tracing/index.d.ts +1 -0
  270. package/dist/serialization/resources/tracing/index.js +17 -0
  271. package/dist/serialization/types/IngestionMethod.d.ts +10 -0
  272. package/dist/serialization/types/IngestionMethod.js +31 -0
  273. package/dist/serialization/types/JsonObject.js +2 -10
  274. package/dist/serialization/types/JsonObjectInputValue.js +3 -11
  275. package/dist/serialization/types/JsonObjectOutputValue.js +3 -11
  276. package/dist/serialization/types/Prompt.d.ts +1 -0
  277. package/dist/serialization/types/Prompt.js +1 -0
  278. package/dist/serialization/types/PromptCursorPage.d.ts +18 -0
  279. package/dist/serialization/types/PromptCursorPage.js +39 -0
  280. package/dist/serialization/types/ScoringConfig.d.ts +21 -0
  281. package/dist/serialization/types/ScoringConfig.js +42 -0
  282. package/dist/serialization/types/Span.js +2 -10
  283. package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -10
  284. package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -10
  285. package/dist/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
  286. package/dist/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
  287. package/dist/serialization/types/Testrecord.d.ts +1 -0
  288. package/dist/serialization/types/Testrecord.js +1 -0
  289. package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -10
  290. package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -10
  291. package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -10
  292. package/dist/serialization/types/Testset.d.ts +1 -0
  293. package/dist/serialization/types/Testset.js +1 -0
  294. package/dist/serialization/types/TestsetCursorPage.d.ts +18 -0
  295. package/dist/serialization/types/TestsetCursorPage.js +39 -0
  296. package/dist/serialization/types/Trace.d.ts +1 -0
  297. package/dist/serialization/types/Trace.js +2 -0
  298. package/dist/serialization/types/index.d.ts +8 -4
  299. package/dist/serialization/types/index.js +8 -4
  300. package/package.json +8 -2
  301. package/reference.md +840 -623
  302. package/serialization/resources/index.d.ts +3 -1
  303. package/serialization/resources/index.js +4 -2
  304. package/serialization/resources/prompt/client/requests/PromptCreateParams.d.ts +2 -0
  305. package/serialization/resources/prompt/client/requests/PromptCreateParams.js +2 -0
  306. package/serialization/resources/scoringConfig/client/index.d.ts +1 -0
  307. package/serialization/resources/scoringConfig/client/index.js +17 -0
  308. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +15 -0
  309. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +36 -0
  310. package/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
  311. package/serialization/resources/scoringConfig/client/requests/index.js +5 -0
  312. package/serialization/resources/scoringConfig/index.d.ts +1 -0
  313. package/serialization/resources/scoringConfig/index.js +17 -0
  314. package/serialization/resources/testcase/client/batchCopy.d.ts +11 -0
  315. package/serialization/resources/testcase/client/batchCopy.js +32 -0
  316. package/serialization/resources/testcase/client/index.d.ts +1 -0
  317. package/serialization/resources/testcase/client/index.js +14 -0
  318. package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
  319. package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
  320. package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
  321. package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
  322. package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  323. package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
  324. package/serialization/resources/testcase/client/requests/index.d.ts +3 -0
  325. package/serialization/resources/testcase/client/requests/index.js +7 -1
  326. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
  327. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
  328. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
  329. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
  330. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
  331. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
  332. package/serialization/resources/testcase/types/index.d.ts +2 -0
  333. package/serialization/resources/testcase/types/index.js +2 -0
  334. package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
  335. package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
  336. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
  337. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
  338. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
  339. package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +5 -0
  340. package/serialization/resources/testset/client/requests/TestsetCreateParams.js +5 -0
  341. package/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  342. package/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
  343. package/serialization/resources/testset/client/requests/index.d.ts +1 -0
  344. package/serialization/resources/testset/client/requests/index.js +3 -1
  345. package/serialization/resources/tracing/client/index.d.ts +1 -0
  346. package/{dist/serialization/resources/traces → serialization/resources/tracing}/client/index.js +2 -2
  347. package/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
  348. package/serialization/resources/tracing/client/traces.js +32 -0
  349. package/serialization/resources/tracing/index.d.ts +1 -0
  350. package/serialization/resources/tracing/index.js +17 -0
  351. package/serialization/types/IngestionMethod.d.ts +10 -0
  352. package/serialization/types/IngestionMethod.js +31 -0
  353. package/serialization/types/JsonObject.js +2 -10
  354. package/serialization/types/JsonObjectInputValue.js +3 -11
  355. package/serialization/types/JsonObjectOutputValue.js +3 -11
  356. package/serialization/types/Prompt.d.ts +1 -0
  357. package/serialization/types/Prompt.js +1 -0
  358. package/serialization/types/PromptCursorPage.d.ts +18 -0
  359. package/serialization/types/PromptCursorPage.js +39 -0
  360. package/serialization/types/ScoringConfig.d.ts +21 -0
  361. package/serialization/types/ScoringConfig.js +42 -0
  362. package/serialization/types/Span.js +2 -10
  363. package/serialization/types/TestCaseCustomInputsValue.js +2 -10
  364. package/serialization/types/TestCaseCustomLabelsValue.js +2 -10
  365. package/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
  366. package/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
  367. package/serialization/types/Testrecord.d.ts +1 -0
  368. package/serialization/types/Testrecord.js +1 -0
  369. package/serialization/types/TestrecordCustomInputsValue.js +2 -10
  370. package/serialization/types/TestrecordCustomLabelsValue.js +2 -10
  371. package/serialization/types/TestrecordCustomOutputsValue.js +2 -10
  372. package/serialization/types/Testset.d.ts +1 -0
  373. package/serialization/types/Testset.js +1 -0
  374. package/serialization/types/TestsetCursorPage.d.ts +18 -0
  375. package/serialization/types/TestsetCursorPage.js +39 -0
  376. package/serialization/types/Trace.d.ts +1 -0
  377. package/serialization/types/Trace.js +2 -0
  378. package/serialization/types/index.d.ts +8 -4
  379. package/serialization/types/index.js +8 -4
  380. package/api/resources/traces/client/Client.d.ts +0 -40
  381. package/api/resources/traces/client/Client.js +0 -151
  382. package/api/types/TestCaseCreate.d.ts +0 -10
  383. package/dist/api/resources/traces/client/Client.d.ts +0 -40
  384. package/dist/api/resources/traces/client/Client.js +0 -151
  385. package/dist/api/types/TestCaseCreate.d.ts +0 -10
  386. package/dist/serialization/resources/traces/client/index.d.ts +0 -1
  387. package/dist/serialization/types/TestCaseCreate.d.ts +0 -16
  388. package/serialization/resources/traces/client/index.d.ts +0 -1
  389. package/serialization/types/TestCaseCreate.d.ts +0 -16
  390. /package/api/{types/TestCaseCreate.js → resources/prompt/client/requests/PromptGetByNameRequest.js} +0 -0
  391. /package/{dist/api/types/TestCaseCreate.js → api/resources/prompt/client/requests/PromptListPromptsRequest.js} +0 -0
  392. /package/api/resources/{traces/client → scoringConfig/client/requests}/index.js +0 -0
  393. /package/api/resources/{traces → scoringConfig}/index.d.ts +0 -0
  394. /package/api/resources/{traces → scoringConfig}/index.js +0 -0
  395. /package/api/resources/{traces → tracing}/client/index.d.ts +0 -0
  396. /package/{dist/api/resources/traces → api/resources/tracing}/client/index.js +0 -0
  397. /package/{dist/api/resources/traces → api/resources/tracing}/index.d.ts +0 -0
  398. /package/{dist/api/resources/traces → api/resources/tracing}/index.js +0 -0
  399. /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.d.ts +0 -0
  400. /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.js +0 -0
  401. /package/dist/api/resources/{traces → tracing}/client/index.d.ts +0 -0
  402. /package/{serialization/resources/traces → dist/api/resources/tracing}/index.d.ts +0 -0
  403. /package/{serialization/resources/traces → dist/api/resources/tracing}/index.js +0 -0
@@ -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.1", "User-Agent": "scorecard-ai/0.6.1", "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.1", "User-Agent": "scorecard-ai/0.6.1", "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.1", "User-Agent": "scorecard-ai/0.6.1", "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
+ };
@@ -17,4 +17,6 @@ export interface Prompt {
17
17
  parentId?: string;
18
18
  mergeParentId?: string;
19
19
  createdAt?: Date;
20
+ /** The ID of the project the prompt belongs to. */
21
+ projectId?: number;
20
22
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Scorecard from "../index";
5
+ export interface PromptCursorPage {
6
+ items: Scorecard.Prompt[];
7
+ /** Total items */
8
+ total?: number;
9
+ /** Cursor to refetch the current page */
10
+ currentPage?: string;
11
+ /** Cursor to refetch the current page starting from the last item */
12
+ currentPageBackwards?: string;
13
+ /** Cursor for the previous page */
14
+ previousPage?: string;
15
+ /** Cursor for the next page */
16
+ nextPage?: string;
17
+ }
@@ -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,18 @@
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
+ /** The ID of the project the scoring config belongs to. */
17
+ projectId?: number;
18
+ }
@@ -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
  }
@@ -26,4 +26,6 @@ export interface Testset {
26
26
  /** The ID of the project the testset belongs to. */
27
27
  projectId?: number;
28
28
  customSchema?: Scorecard.CustomSchema;
29
+ /** Whether or not the testset was created by the playground. */
30
+ createdByPlayground?: boolean;
29
31
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Scorecard from "../index";
5
+ export interface TestsetCursorPage {
6
+ items: Scorecard.Testset[];
7
+ /** Total items */
8
+ total?: number;
9
+ /** Cursor to refetch the current page */
10
+ currentPage?: string;
11
+ /** Cursor to refetch the current page starting from the last item */
12
+ currentPageBackwards?: string;
13
+ /** Cursor for the previous page */
14
+ previousPage?: string;
15
+ /** Cursor for the next page */
16
+ nextPage?: string;
17
+ }
@@ -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,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";
@@ -12,18 +12,18 @@ export * from "./NotFoundErrorBody";
12
12
  export * from "./PaginatedTestcaseResponse";
13
13
  export * from "./PromptModelParamsValue";
14
14
  export * from "./Prompt";
15
+ export * from "./PromptCursorPage";
15
16
  export * from "./RoleEnum";
16
17
  export * from "./Run";
17
18
  export * from "./RunMetric";
18
19
  export * from "./RunStatus";
19
20
  export * from "./ScoreStatus";
21
+ export * from "./ScoringConfig";
20
22
  export * from "./Span";
21
23
  export * from "./TestCaseCustomInputsValue";
22
24
  export * from "./TestCaseCustomLabelsValue";
23
25
  export * from "./TestCase";
24
- export * from "./TestCaseCreate";
25
- export * from "./TestRecordCreate";
26
- export * from "./TestSetCreate";
26
+ export * from "./TestcaseBatchDeletionResponse";
27
27
  export * from "./TestcaseDeletionResponse";
28
28
  export * from "./TestrecordCustomInputsValue";
29
29
  export * from "./TestrecordCustomLabelsValue";
@@ -32,9 +32,13 @@ export * from "./TestrecordModelParamsValue";
32
32
  export * from "./TestrecordModelDebugInfoValue";
33
33
  export * from "./Testrecord";
34
34
  export * from "./Testset";
35
+ export * from "./TestsetCursorPage";
35
36
  export * from "./Trace";
36
37
  export * from "./UnauthenticatedError";
37
38
  export * from "./UnauthorizedErrorBody";
38
39
  export * from "./ValidationErrorLocItem";
39
40
  export * from "./ValidationError";
40
41
  export * from "./CreateGithubWorkflowParams";
42
+ export * from "./CreateRunParams";
43
+ export * from "./TestRecordCreate";
44
+ 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);
@@ -28,18 +28,18 @@ __exportStar(require("./NotFoundErrorBody"), exports);
28
28
  __exportStar(require("./PaginatedTestcaseResponse"), exports);
29
29
  __exportStar(require("./PromptModelParamsValue"), exports);
30
30
  __exportStar(require("./Prompt"), exports);
31
+ __exportStar(require("./PromptCursorPage"), exports);
31
32
  __exportStar(require("./RoleEnum"), exports);
32
33
  __exportStar(require("./Run"), exports);
33
34
  __exportStar(require("./RunMetric"), exports);
34
35
  __exportStar(require("./RunStatus"), exports);
35
36
  __exportStar(require("./ScoreStatus"), exports);
37
+ __exportStar(require("./ScoringConfig"), exports);
36
38
  __exportStar(require("./Span"), exports);
37
39
  __exportStar(require("./TestCaseCustomInputsValue"), exports);
38
40
  __exportStar(require("./TestCaseCustomLabelsValue"), exports);
39
41
  __exportStar(require("./TestCase"), exports);
40
- __exportStar(require("./TestCaseCreate"), exports);
41
- __exportStar(require("./TestRecordCreate"), exports);
42
- __exportStar(require("./TestSetCreate"), exports);
42
+ __exportStar(require("./TestcaseBatchDeletionResponse"), exports);
43
43
  __exportStar(require("./TestcaseDeletionResponse"), exports);
44
44
  __exportStar(require("./TestrecordCustomInputsValue"), exports);
45
45
  __exportStar(require("./TestrecordCustomLabelsValue"), exports);
@@ -48,9 +48,13 @@ __exportStar(require("./TestrecordModelParamsValue"), exports);
48
48
  __exportStar(require("./TestrecordModelDebugInfoValue"), exports);
49
49
  __exportStar(require("./Testrecord"), exports);
50
50
  __exportStar(require("./Testset"), exports);
51
+ __exportStar(require("./TestsetCursorPage"), exports);
51
52
  __exportStar(require("./Trace"), exports);
52
53
  __exportStar(require("./UnauthenticatedError"), exports);
53
54
  __exportStar(require("./UnauthorizedErrorBody"), exports);
54
55
  __exportStar(require("./ValidationErrorLocItem"), exports);
55
56
  __exportStar(require("./ValidationError"), exports);
56
57
  __exportStar(require("./CreateGithubWorkflowParams"), exports);
58
+ __exportStar(require("./CreateRunParams"), exports);
59
+ __exportStar(require("./TestRecordCreate"), exports);
60
+ __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;