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
package/Client.d.ts CHANGED
@@ -9,8 +9,9 @@ import { Testrecord } from "./api/resources/testrecord/client/Client";
9
9
  import { Run } from "./api/resources/run/client/Client";
10
10
  import { Score } from "./api/resources/score/client/Client";
11
11
  import { RunMetric } from "./api/resources/runMetric/client/Client";
12
- import { Traces } from "./api/resources/traces/client/Client";
12
+ import { Tracing } from "./api/resources/tracing/client/Client";
13
13
  import { Prompt } from "./api/resources/prompt/client/Client";
14
+ import { ScoringConfig } from "./api/resources/scoringConfig/client/Client";
14
15
  export declare namespace ScorecardClient {
15
16
  interface Options {
16
17
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
@@ -18,8 +19,11 @@ export declare namespace ScorecardClient {
18
19
  fetcher?: core.FetchFunction;
19
20
  }
20
21
  interface RequestOptions {
22
+ /** The maximum time to wait for a response in seconds. */
21
23
  timeoutInSeconds?: number;
24
+ /** The number of times to retry the request. Defaults to 2. */
22
25
  maxRetries?: number;
26
+ /** A hook to abort the request. */
23
27
  abortSignal?: AbortSignal;
24
28
  }
25
29
  }
@@ -38,8 +42,10 @@ export declare class ScorecardClient {
38
42
  get score(): Score;
39
43
  protected _runMetric: RunMetric | undefined;
40
44
  get runMetric(): RunMetric;
41
- protected _traces: Traces | undefined;
42
- get traces(): Traces;
45
+ protected _tracing: Tracing | undefined;
46
+ get tracing(): Tracing;
43
47
  protected _prompt: Prompt | undefined;
44
48
  get prompt(): Prompt;
49
+ protected _scoringConfig: ScoringConfig | undefined;
50
+ get scoringConfig(): ScoringConfig;
45
51
  }
package/Client.js CHANGED
@@ -10,8 +10,9 @@ const Client_3 = require("./api/resources/testrecord/client/Client");
10
10
  const Client_4 = require("./api/resources/run/client/Client");
11
11
  const Client_5 = require("./api/resources/score/client/Client");
12
12
  const Client_6 = require("./api/resources/runMetric/client/Client");
13
- const Client_7 = require("./api/resources/traces/client/Client");
13
+ const Client_7 = require("./api/resources/tracing/client/Client");
14
14
  const Client_8 = require("./api/resources/prompt/client/Client");
15
+ const Client_9 = require("./api/resources/scoringConfig/client/Client");
15
16
  class ScorecardClient {
16
17
  constructor(_options) {
17
18
  this._options = _options;
@@ -40,13 +41,17 @@ class ScorecardClient {
40
41
  var _a;
41
42
  return ((_a = this._runMetric) !== null && _a !== void 0 ? _a : (this._runMetric = new Client_6.RunMetric(this._options)));
42
43
  }
43
- get traces() {
44
+ get tracing() {
44
45
  var _a;
45
- return ((_a = this._traces) !== null && _a !== void 0 ? _a : (this._traces = new Client_7.Traces(this._options)));
46
+ return ((_a = this._tracing) !== null && _a !== void 0 ? _a : (this._tracing = new Client_7.Tracing(this._options)));
46
47
  }
47
48
  get prompt() {
48
49
  var _a;
49
50
  return ((_a = this._prompt) !== null && _a !== void 0 ? _a : (this._prompt = new Client_8.Prompt(this._options)));
50
51
  }
52
+ get scoringConfig() {
53
+ var _a;
54
+ return ((_a = this._scoringConfig) !== null && _a !== void 0 ? _a : (this._scoringConfig = new Client_9.ScoringConfig(this._options)));
55
+ }
51
56
  }
52
57
  exports.ScorecardClient = ScorecardClient;
package/README.md CHANGED
@@ -17,11 +17,11 @@ The SDK uses fetch and is compatible in multiple environments
17
17
  such as Node, Vercel, Cloudflare Workers.
18
18
 
19
19
  ```typescript
20
- import { ScorecardClient } from "scorecard";
20
+ import { ScorecardClient } from "scorecard-ai";
21
21
 
22
- const scorecard = new ScorecardClient(
23
- api_key="YOUR_API_KEY" // Defaults to SCORECARD_API_KEY
24
- )
22
+ const scorecard = new ScorecardClient({
23
+ apiKey: "YOUR_API_KEY"
24
+ })
25
25
 
26
26
  const testset = await scorecard.testset.create({
27
27
  testsetId=1234,
@@ -42,11 +42,11 @@ available on both the sync and async client.
42
42
 
43
43
  ```typescript
44
44
  import { callModel } from "../app.ts";
45
- import { ScorecardClient } from "scorecard";
45
+ import { ScorecardClient } from "scorecard-ai";
46
46
 
47
- const scorecard = new ScorecardClient(
48
- apiKey="YOUR_API_KEY"
49
- )
47
+ const scorecard = new ScorecardClient({
48
+ apiKey: "YOUR_API_KEY"
49
+ })
50
50
 
51
51
  client.runTests({
52
52
  inputTestsetId: 123,
@@ -76,7 +76,7 @@ All exceptions thrown by the SDK will
76
76
  sublcass [ScorecardError](./src/errors/ScorecardError.ts).
77
77
 
78
78
  ```typescript
79
- import { Scorecard, ScorecardError } from "scorecard";
79
+ import { Scorecard, ScorecardError } from "scorecard-ai";
80
80
 
81
81
  try {
82
82
  await client.testset.get({...});
@@ -8,10 +8,12 @@ export * as testset from "./testset";
8
8
  export * as run from "./run";
9
9
  export * as score from "./score";
10
10
  export * as runMetric from "./runMetric";
11
- export * as traces from "./traces";
11
+ export * as tracing from "./tracing";
12
+ export * as scoringConfig from "./scoringConfig";
12
13
  export * from "./testset/client/requests";
13
14
  export * from "./testcase/client/requests";
14
15
  export * from "./testrecord/client/requests";
15
16
  export * from "./run/client/requests";
16
17
  export * from "./score/client/requests";
17
18
  export * from "./prompt/client/requests";
19
+ export * from "./scoringConfig/client/requests";
@@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.traces = exports.runMetric = exports.score = exports.run = exports.testset = exports.prompt = exports.testrecord = exports.testcase = void 0;
29
+ exports.scoringConfig = exports.tracing = exports.runMetric = exports.score = exports.run = exports.testset = exports.prompt = exports.testrecord = exports.testcase = void 0;
30
30
  exports.testcase = __importStar(require("./testcase"));
31
31
  __exportStar(require("./testcase/types"), exports);
32
32
  exports.testrecord = __importStar(require("./testrecord"));
@@ -37,10 +37,12 @@ exports.testset = __importStar(require("./testset"));
37
37
  exports.run = __importStar(require("./run"));
38
38
  exports.score = __importStar(require("./score"));
39
39
  exports.runMetric = __importStar(require("./runMetric"));
40
- exports.traces = __importStar(require("./traces"));
40
+ exports.tracing = __importStar(require("./tracing"));
41
+ exports.scoringConfig = __importStar(require("./scoringConfig"));
41
42
  __exportStar(require("./testset/client/requests"), exports);
42
43
  __exportStar(require("./testcase/client/requests"), exports);
43
44
  __exportStar(require("./testrecord/client/requests"), exports);
44
45
  __exportStar(require("./run/client/requests"), exports);
45
46
  __exportStar(require("./score/client/requests"), exports);
46
47
  __exportStar(require("./prompt/client/requests"), exports);
48
+ __exportStar(require("./scoringConfig/client/requests"), exports);
@@ -11,8 +11,11 @@ export declare namespace Prompt {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -20,11 +23,28 @@ export declare class Prompt {
20
23
  protected readonly _options: Prompt.Options;
21
24
  constructor(_options: Prompt.Options);
22
25
  /**
23
- * Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
26
+ * Retrieve a prompt by name, defaulting to the production prompt, unless a tag to select the prompt by is specified
24
27
  *
25
- * A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
28
+ * @param {Scorecard.PromptGetByNameRequest} request
29
+ * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link Scorecard.UnauthorizedError}
32
+ * @throws {@link Scorecard.ForbiddenError}
33
+ * @throws {@link Scorecard.NotFoundError}
34
+ * @throws {@link Scorecard.UnprocessableEntityError}
35
+ *
36
+ * @example
37
+ * await client.prompt.getByName({
38
+ * name: "name"
39
+ * })
40
+ */
41
+ getByName(request: Scorecard.PromptGetByNameRequest, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
42
+ /**
43
+ * Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in the app).
44
+ *
45
+ * A root prompt can be created by providing the `name` param, and it will always be tagged as production.
26
46
  *
27
- * A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all descendents from a root prompt would share the root's name. `is_prod` can also be provided to configure whether a child should be tagged as prod.
47
+ * A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all descendants from a root prompt would share the root's name. `is_prod` can also be provided to configure whether a child should be tagged as production.
28
48
  *
29
49
  * @param {Scorecard.PromptCreateParams} request
30
50
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
@@ -35,7 +55,7 @@ export declare class Prompt {
35
55
  * @throws {@link Scorecard.UnprocessableEntityError}
36
56
  *
37
57
  * @example
38
- * await scorecard.prompt.create({
58
+ * await client.prompt.create({
39
59
  * promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
40
60
  * name: "Prompt Name",
41
61
  * description: "Description of the prompt",
@@ -44,11 +64,13 @@ export declare class Prompt {
44
64
  * "param2": 0.1,
45
65
  * "param3": 100,
46
66
  * "param4": true
47
- * }
67
+ * },
68
+ * tag: "1.0",
69
+ * projectId: 1
48
70
  * })
49
71
  *
50
72
  * @example
51
- * await scorecard.prompt.create({
73
+ * await client.prompt.create({
52
74
  * promptTemplate: "<system>\nYou are a helpful assistant. Use the provided context to answer the user's query.\n\nContext: {context}\n</system>\n\n<user>\n{user_query}\n</user>",
53
75
  * parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
54
76
  * description: "Description of the prompt",
@@ -58,10 +80,27 @@ export declare class Prompt {
58
80
  * "param3": 100,
59
81
  * "param4": true
60
82
  * },
61
- * isProd: true
83
+ * tag: "v1.1",
84
+ * isProd: true,
85
+ * projectId: 1
62
86
  * })
63
87
  */
64
88
  create(request: Scorecard.PromptCreateParams, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
89
+ /**
90
+ * List all prompts with cursor-based pagination
91
+ *
92
+ * @param {Scorecard.PromptListPromptsRequest} request
93
+ * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
94
+ *
95
+ * @throws {@link Scorecard.UnauthorizedError}
96
+ * @throws {@link Scorecard.ForbiddenError}
97
+ * @throws {@link Scorecard.NotFoundError}
98
+ * @throws {@link Scorecard.UnprocessableEntityError}
99
+ *
100
+ * @example
101
+ * await client.prompt.listPrompts()
102
+ */
103
+ listPrompts(request?: Scorecard.PromptListPromptsRequest, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.PromptCursorPage>;
65
104
  /**
66
105
  * Retrieve a prompt by id
67
106
  *
@@ -74,7 +113,7 @@ export declare class Prompt {
74
113
  * @throws {@link Scorecard.UnprocessableEntityError}
75
114
  *
76
115
  * @example
77
- * await scorecard.prompt.get("id")
116
+ * await client.prompt.get("id")
78
117
  */
79
118
  get(id: string, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
80
119
  /**
@@ -89,7 +128,7 @@ export declare class Prompt {
89
128
  * @throws {@link Scorecard.UnprocessableEntityError}
90
129
  *
91
130
  * @example
92
- * await scorecard.prompt.delete("id")
131
+ * await client.prompt.delete("id")
93
132
  */
94
133
  delete(id: string, requestOptions?: Prompt.RequestOptions): Promise<unknown>;
95
134
  /**
@@ -107,26 +146,11 @@ export declare class Prompt {
107
146
  * @throws {@link Scorecard.UnprocessableEntityError}
108
147
  *
109
148
  * @example
110
- * await scorecard.prompt.update("id", {
149
+ * await client.prompt.update("id", {
111
150
  * isProd: true
112
151
  * })
113
152
  */
114
153
  update(id: string, request?: Scorecard.PromptUpdateParams, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
115
- /**
116
- * Retrieve a prod prompt by name
117
- *
118
- * @param {string} name - Name of the prompt.
119
- * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
120
- *
121
- * @throws {@link Scorecard.UnauthorizedError}
122
- * @throws {@link Scorecard.ForbiddenError}
123
- * @throws {@link Scorecard.NotFoundError}
124
- * @throws {@link Scorecard.UnprocessableEntityError}
125
- *
126
- * @example
127
- * await scorecard.prompt.getByName("name")
128
- */
129
- getByName(name: string, requestOptions?: Prompt.RequestOptions): Promise<Scorecard.Prompt>;
130
154
  protected _getCustomAuthorizationHeaders(): Promise<{
131
155
  "X-API-Key": string;
132
156
  }>;