scorecard-ai 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/Client.d.ts +9 -3
  2. package/Client.js +8 -3
  3. package/api/resources/index.d.ts +3 -1
  4. package/api/resources/index.js +4 -2
  5. package/api/resources/prompt/client/Client.d.ts +27 -22
  6. package/api/resources/prompt/client/Client.js +110 -99
  7. package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
  8. package/api/resources/prompt/client/requests/index.d.ts +1 -0
  9. package/api/resources/run/client/Client.d.ts +6 -3
  10. package/api/resources/run/client/Client.js +26 -23
  11. package/api/resources/run/client/requests/RunCreateParams.d.ts +1 -0
  12. package/api/resources/runMetric/client/Client.d.ts +4 -1
  13. package/api/resources/runMetric/client/Client.js +8 -7
  14. package/api/resources/score/client/Client.d.ts +5 -2
  15. package/api/resources/score/client/Client.js +18 -16
  16. package/api/resources/score/client/requests/ScoreCreateParams.d.ts +3 -0
  17. package/api/resources/score/client/requests/ScoreUpdateParams.d.ts +3 -0
  18. package/api/resources/scoringConfig/client/Client.d.ts +62 -0
  19. package/{dist/api/resources/traces → api/resources/scoringConfig}/client/Client.js +114 -16
  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 +16 -0
  23. package/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
  24. package/api/resources/testcase/client/Client.d.ts +55 -3
  25. package/api/resources/testcase/client/Client.js +308 -22
  26. package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
  27. package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
  28. package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
  29. package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
  30. package/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +2 -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 +9 -0
  43. package/api/resources/testset/client/Client.d.ts +24 -5
  44. package/api/resources/testset/client/Client.js +135 -36
  45. package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
  46. package/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  47. package/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
  48. package/api/resources/testset/client/requests/index.d.ts +1 -0
  49. package/api/resources/tracing/client/Client.d.ts +72 -0
  50. package/api/resources/tracing/client/Client.js +327 -0
  51. package/api/types/Grade.d.ts +11 -0
  52. package/api/types/IngestionMethod.d.ts +8 -0
  53. package/api/types/IngestionMethod.js +10 -0
  54. package/api/types/PaginatedTestcaseResponse.d.ts +2 -0
  55. package/api/types/Prompt.d.ts +2 -0
  56. package/api/types/Run.d.ts +14 -0
  57. package/api/types/ScoringConfig.d.ts +16 -0
  58. package/api/types/ScoringConfig.js +5 -0
  59. package/api/types/TestCase.d.ts +4 -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 +14 -0
  63. package/api/types/Testset.d.ts +11 -0
  64. package/api/types/Trace.d.ts +2 -0
  65. package/api/types/index.d.ts +6 -4
  66. package/api/types/index.js +6 -4
  67. package/core/fetcher/Fetcher.d.ts +4 -1
  68. package/core/fetcher/Fetcher.js +19 -176
  69. package/core/fetcher/createRequestUrl.d.ts +1 -0
  70. package/core/fetcher/createRequestUrl.js +13 -0
  71. package/core/fetcher/getFetchFn.d.ts +4 -0
  72. package/core/fetcher/getFetchFn.js +59 -0
  73. package/core/fetcher/getRequestBody.d.ts +7 -0
  74. package/core/fetcher/getRequestBody.js +23 -0
  75. package/core/fetcher/getResponseBody.d.ts +1 -0
  76. package/core/fetcher/getResponseBody.js +52 -0
  77. package/core/fetcher/makeRequest.d.ts +1 -0
  78. package/core/fetcher/makeRequest.js +42 -0
  79. package/core/fetcher/requestWithRetries.d.ts +1 -0
  80. package/core/fetcher/requestWithRetries.js +32 -0
  81. package/core/fetcher/signals.d.ts +12 -0
  82. package/core/fetcher/signals.js +37 -0
  83. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
  84. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
  85. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  86. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  87. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  88. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
  89. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  90. package/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
  91. package/core/runtime/runtime.d.ts +2 -1
  92. package/core/runtime/runtime.js +12 -1
  93. package/core/schemas/Schema.d.ts +7 -4
  94. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  95. package/core/schemas/builders/lazy/lazy.js +8 -19
  96. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  97. package/core/schemas/builders/list/list.js +31 -44
  98. package/core/schemas/builders/object/object.js +90 -111
  99. package/core/schemas/builders/object/types.d.ts +2 -2
  100. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  101. package/core/schemas/builders/record/record.js +49 -60
  102. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  103. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  104. package/core/schemas/builders/set/set.js +6 -15
  105. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  106. package/core/schemas/builders/union/union.js +51 -62
  107. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  108. package/dist/Client.d.ts +9 -3
  109. package/dist/Client.js +8 -3
  110. package/dist/api/resources/index.d.ts +3 -1
  111. package/dist/api/resources/index.js +4 -2
  112. package/dist/api/resources/prompt/client/Client.d.ts +27 -22
  113. package/dist/api/resources/prompt/client/Client.js +110 -99
  114. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
  115. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
  116. package/dist/api/resources/prompt/client/requests/index.d.ts +1 -0
  117. package/dist/api/resources/run/client/Client.d.ts +6 -3
  118. package/dist/api/resources/run/client/Client.js +26 -23
  119. package/dist/api/resources/run/client/requests/RunCreateParams.d.ts +1 -0
  120. package/dist/api/resources/runMetric/client/Client.d.ts +4 -1
  121. package/dist/api/resources/runMetric/client/Client.js +8 -7
  122. package/dist/api/resources/score/client/Client.d.ts +5 -2
  123. package/dist/api/resources/score/client/Client.js +18 -16
  124. package/dist/api/resources/score/client/requests/ScoreCreateParams.d.ts +3 -0
  125. package/dist/api/resources/score/client/requests/ScoreUpdateParams.d.ts +3 -0
  126. package/dist/api/resources/scoringConfig/client/Client.d.ts +62 -0
  127. package/{api/resources/traces → dist/api/resources/scoringConfig}/client/Client.js +114 -16
  128. package/dist/api/resources/scoringConfig/client/index.d.ts +1 -0
  129. package/dist/api/resources/scoringConfig/client/index.js +17 -0
  130. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
  131. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
  132. package/dist/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
  133. package/dist/api/resources/scoringConfig/client/requests/index.js +2 -0
  134. package/dist/api/resources/testcase/client/Client.d.ts +55 -3
  135. package/dist/api/resources/testcase/client/Client.js +308 -22
  136. package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
  137. package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
  138. package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
  139. package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
  140. package/dist/api/resources/testcase/client/requests/TestcaseCreateParams.d.ts +2 -0
  141. package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  142. package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
  143. package/dist/api/resources/testcase/client/requests/index.d.ts +3 -0
  144. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
  145. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
  146. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
  147. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
  148. package/dist/api/resources/testcase/types/index.d.ts +2 -0
  149. package/dist/api/resources/testcase/types/index.js +2 -0
  150. package/dist/api/resources/testrecord/client/Client.d.ts +5 -2
  151. package/dist/api/resources/testrecord/client/Client.js +17 -15
  152. package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +9 -0
  153. package/dist/api/resources/testset/client/Client.d.ts +24 -5
  154. package/dist/api/resources/testset/client/Client.js +135 -36
  155. package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +8 -0
  156. package/dist/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  157. package/dist/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
  158. package/dist/api/resources/testset/client/requests/index.d.ts +1 -0
  159. package/dist/api/resources/tracing/client/Client.d.ts +72 -0
  160. package/dist/api/resources/tracing/client/Client.js +327 -0
  161. package/dist/api/resources/tracing/client/index.js +2 -0
  162. package/dist/api/types/Grade.d.ts +11 -0
  163. package/dist/api/types/IngestionMethod.d.ts +8 -0
  164. package/dist/api/types/IngestionMethod.js +10 -0
  165. package/dist/api/types/PaginatedTestcaseResponse.d.ts +2 -0
  166. package/dist/api/types/Prompt.d.ts +2 -0
  167. package/dist/api/types/Run.d.ts +14 -0
  168. package/dist/api/types/ScoringConfig.d.ts +16 -0
  169. package/dist/api/types/ScoringConfig.js +5 -0
  170. package/dist/api/types/TestCase.d.ts +4 -0
  171. package/dist/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
  172. package/dist/api/types/TestcaseBatchDeletionResponse.js +5 -0
  173. package/dist/api/types/Testrecord.d.ts +14 -0
  174. package/dist/api/types/Testset.d.ts +11 -0
  175. package/dist/api/types/Trace.d.ts +2 -0
  176. package/dist/api/types/index.d.ts +6 -4
  177. package/dist/api/types/index.js +6 -4
  178. package/dist/core/fetcher/Fetcher.d.ts +4 -1
  179. package/dist/core/fetcher/Fetcher.js +19 -176
  180. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  181. package/dist/core/fetcher/createRequestUrl.js +13 -0
  182. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  183. package/dist/core/fetcher/getFetchFn.js +59 -0
  184. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  185. package/dist/core/fetcher/getRequestBody.js +23 -0
  186. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  187. package/dist/core/fetcher/getResponseBody.js +52 -0
  188. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  189. package/dist/core/fetcher/makeRequest.js +42 -0
  190. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  191. package/dist/core/fetcher/requestWithRetries.js +32 -0
  192. package/dist/core/fetcher/signals.d.ts +12 -0
  193. package/dist/core/fetcher/signals.js +37 -0
  194. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
  195. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
  196. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  197. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  198. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  199. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
  200. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  201. package/dist/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
  202. package/dist/core/runtime/runtime.d.ts +2 -1
  203. package/dist/core/runtime/runtime.js +12 -1
  204. package/dist/core/schemas/Schema.d.ts +7 -4
  205. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  206. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  207. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  208. package/dist/core/schemas/builders/list/list.js +31 -44
  209. package/dist/core/schemas/builders/object/object.js +90 -111
  210. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  211. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  212. package/dist/core/schemas/builders/record/record.js +49 -60
  213. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  214. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  215. package/dist/core/schemas/builders/set/set.js +6 -15
  216. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  217. package/dist/core/schemas/builders/union/union.js +51 -62
  218. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  219. package/dist/serialization/resources/index.d.ts +3 -1
  220. package/dist/serialization/resources/index.js +4 -2
  221. package/dist/serialization/resources/scoringConfig/client/index.d.ts +1 -0
  222. package/dist/serialization/resources/scoringConfig/client/index.js +17 -0
  223. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
  224. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
  225. package/dist/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
  226. package/dist/serialization/resources/scoringConfig/client/requests/index.js +5 -0
  227. package/dist/serialization/resources/scoringConfig/index.d.ts +1 -0
  228. package/dist/serialization/resources/scoringConfig/index.js +17 -0
  229. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
  230. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
  231. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
  232. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
  233. package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  234. package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
  235. package/dist/serialization/resources/testcase/client/requests/index.d.ts +3 -0
  236. package/dist/serialization/resources/testcase/client/requests/index.js +7 -1
  237. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
  238. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
  239. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
  240. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
  241. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
  242. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
  243. package/dist/serialization/resources/testcase/types/index.d.ts +2 -0
  244. package/dist/serialization/resources/testcase/types/index.js +2 -0
  245. package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
  246. package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
  247. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
  248. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
  249. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
  250. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
  251. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
  252. package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  253. package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
  254. package/dist/serialization/resources/testset/client/requests/index.d.ts +1 -0
  255. package/dist/serialization/resources/testset/client/requests/index.js +3 -1
  256. package/dist/serialization/resources/tracing/client/index.d.ts +1 -0
  257. package/{serialization/resources/traces → dist/serialization/resources/tracing}/client/index.js +2 -2
  258. package/dist/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
  259. package/dist/serialization/resources/tracing/client/traces.js +32 -0
  260. package/dist/serialization/resources/tracing/index.d.ts +1 -0
  261. package/dist/serialization/resources/tracing/index.js +17 -0
  262. package/dist/serialization/types/IngestionMethod.d.ts +10 -0
  263. package/dist/serialization/types/IngestionMethod.js +31 -0
  264. package/dist/serialization/types/JsonObject.js +2 -10
  265. package/dist/serialization/types/JsonObjectInputValue.js +3 -11
  266. package/dist/serialization/types/JsonObjectOutputValue.js +3 -11
  267. package/dist/serialization/types/ScoringConfig.d.ts +20 -0
  268. package/dist/serialization/types/ScoringConfig.js +41 -0
  269. package/dist/serialization/types/Span.js +2 -10
  270. package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -10
  271. package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -10
  272. package/dist/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
  273. package/dist/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
  274. package/dist/serialization/types/Testrecord.d.ts +1 -0
  275. package/dist/serialization/types/Testrecord.js +1 -0
  276. package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -10
  277. package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -10
  278. package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -10
  279. package/dist/serialization/types/Trace.d.ts +1 -0
  280. package/dist/serialization/types/Trace.js +2 -0
  281. package/dist/serialization/types/index.d.ts +6 -4
  282. package/dist/serialization/types/index.js +6 -4
  283. package/dist/telemetry.d.ts +0 -5
  284. package/dist/telemetry.js +25 -7
  285. package/dist/wrapper/ScorecardClient.d.ts +3 -0
  286. package/dist/wrapper/ScorecardClient.js +11 -0
  287. package/package.json +13 -2
  288. package/reference.md +657 -569
  289. package/serialization/resources/index.d.ts +3 -1
  290. package/serialization/resources/index.js +4 -2
  291. package/serialization/resources/scoringConfig/client/index.d.ts +1 -0
  292. package/serialization/resources/scoringConfig/client/index.js +17 -0
  293. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
  294. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
  295. package/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
  296. package/serialization/resources/scoringConfig/client/requests/index.js +5 -0
  297. package/serialization/resources/scoringConfig/index.d.ts +1 -0
  298. package/serialization/resources/scoringConfig/index.js +17 -0
  299. package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
  300. package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
  301. package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
  302. package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
  303. package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  304. package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
  305. package/serialization/resources/testcase/client/requests/index.d.ts +3 -0
  306. package/serialization/resources/testcase/client/requests/index.js +7 -1
  307. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
  308. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
  309. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
  310. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
  311. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
  312. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
  313. package/serialization/resources/testcase/types/index.d.ts +2 -0
  314. package/serialization/resources/testcase/types/index.js +2 -0
  315. package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
  316. package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
  317. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
  318. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
  319. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
  320. package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
  321. package/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
  322. package/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  323. package/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
  324. package/serialization/resources/testset/client/requests/index.d.ts +1 -0
  325. package/serialization/resources/testset/client/requests/index.js +3 -1
  326. package/serialization/resources/tracing/client/index.d.ts +1 -0
  327. package/{dist/serialization/resources/traces → serialization/resources/tracing}/client/index.js +2 -2
  328. package/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
  329. package/serialization/resources/tracing/client/traces.js +32 -0
  330. package/serialization/resources/tracing/index.d.ts +1 -0
  331. package/serialization/resources/tracing/index.js +17 -0
  332. package/serialization/types/IngestionMethod.d.ts +10 -0
  333. package/serialization/types/IngestionMethod.js +31 -0
  334. package/serialization/types/JsonObject.js +2 -10
  335. package/serialization/types/JsonObjectInputValue.js +3 -11
  336. package/serialization/types/JsonObjectOutputValue.js +3 -11
  337. package/serialization/types/ScoringConfig.d.ts +20 -0
  338. package/serialization/types/ScoringConfig.js +41 -0
  339. package/serialization/types/Span.js +2 -10
  340. package/serialization/types/TestCaseCustomInputsValue.js +2 -10
  341. package/serialization/types/TestCaseCustomLabelsValue.js +2 -10
  342. package/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
  343. package/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
  344. package/serialization/types/Testrecord.d.ts +1 -0
  345. package/serialization/types/Testrecord.js +1 -0
  346. package/serialization/types/TestrecordCustomInputsValue.js +2 -10
  347. package/serialization/types/TestrecordCustomLabelsValue.js +2 -10
  348. package/serialization/types/TestrecordCustomOutputsValue.js +2 -10
  349. package/serialization/types/Trace.d.ts +1 -0
  350. package/serialization/types/Trace.js +2 -0
  351. package/serialization/types/index.d.ts +6 -4
  352. package/serialization/types/index.js +6 -4
  353. package/telemetry.d.ts +0 -5
  354. package/telemetry.js +25 -7
  355. package/wrapper/ScorecardClient.d.ts +3 -0
  356. package/wrapper/ScorecardClient.js +11 -0
  357. package/api/resources/traces/client/Client.d.ts +0 -40
  358. package/api/types/TestCaseCreate.d.ts +0 -10
  359. package/dist/api/resources/traces/client/Client.d.ts +0 -40
  360. package/dist/api/types/TestCaseCreate.d.ts +0 -10
  361. package/dist/serialization/resources/traces/client/index.d.ts +0 -1
  362. package/dist/serialization/types/TestCaseCreate.d.ts +0 -16
  363. package/serialization/resources/traces/client/index.d.ts +0 -1
  364. package/serialization/types/TestCaseCreate.d.ts +0 -16
  365. /package/api/{types/TestCaseCreate.js → resources/prompt/client/requests/PromptGetByNameRequest.js} +0 -0
  366. /package/{dist/api/types/TestCaseCreate.js → api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js} +0 -0
  367. /package/api/resources/{traces/client → scoringConfig/client/requests}/index.js +0 -0
  368. /package/api/resources/{traces → scoringConfig}/index.d.ts +0 -0
  369. /package/api/resources/{traces → scoringConfig}/index.js +0 -0
  370. /package/api/resources/{traces → tracing}/client/index.d.ts +0 -0
  371. /package/{dist/api/resources/traces → api/resources/tracing}/client/index.js +0 -0
  372. /package/{dist/api/resources/traces → api/resources/tracing}/index.d.ts +0 -0
  373. /package/{dist/api/resources/traces → api/resources/tracing}/index.js +0 -0
  374. /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.d.ts +0 -0
  375. /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.js +0 -0
  376. /package/dist/api/resources/{traces → tracing}/client/index.d.ts +0 -0
  377. /package/{serialization/resources/traces → dist/api/resources/tracing}/index.d.ts +0 -0
  378. /package/{serialization/resources/traces → dist/api/resources/tracing}/index.js +0 -0
@@ -42,21 +42,17 @@ exports.Prompt = void 0;
42
42
  const environments = __importStar(require("../../../../environments"));
43
43
  const core = __importStar(require("../../../../core"));
44
44
  const Scorecard = __importStar(require("../../../index"));
45
- const serializers = __importStar(require("../../../../serialization/index"));
46
45
  const url_join_1 = __importDefault(require("url-join"));
46
+ const serializers = __importStar(require("../../../../serialization/index"));
47
47
  const errors = __importStar(require("../../../../errors/index"));
48
48
  class Prompt {
49
49
  constructor(_options) {
50
50
  this._options = _options;
51
51
  }
52
52
  /**
53
- * Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
54
- *
55
- * A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
56
- *
57
- * 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.
53
+ * Retrieve a prod prompt by name
58
54
  *
59
- * @param {Scorecard.PromptCreateParams} request
55
+ * @param {Scorecard.PromptGetByNameRequest} request
60
56
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
61
57
  *
62
58
  * @throws {@link Scorecard.UnauthorizedError}
@@ -65,47 +61,29 @@ class Prompt {
65
61
  * @throws {@link Scorecard.UnprocessableEntityError}
66
62
  *
67
63
  * @example
68
- * await scorecard.prompt.create({
69
- * 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>",
70
- * name: "Prompt Name",
71
- * description: "Description of the prompt",
72
- * modelParams: {
73
- * "param1": "value1",
74
- * "param2": 0.1,
75
- * "param3": 100,
76
- * "param4": true
77
- * }
78
- * })
79
- *
80
- * @example
81
- * await scorecard.prompt.create({
82
- * 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>",
83
- * parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
84
- * description: "Description of the prompt",
85
- * modelParams: {
86
- * "param1": "value1",
87
- * "param2": 0.1,
88
- * "param3": 100,
89
- * "param4": true
90
- * },
91
- * isProd: true
64
+ * await client.prompt.getByName({
65
+ * name: "name"
92
66
  * })
93
67
  */
94
- create(request, requestOptions) {
68
+ getByName(request, requestOptions) {
95
69
  var _a, _b;
96
70
  return __awaiter(this, void 0, void 0, function* () {
71
+ const { name } = request;
72
+ const _queryParams = {};
73
+ _queryParams["name"] = name;
97
74
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
98
75
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt"),
99
- method: "POST",
100
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
76
+ method: "GET",
77
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
101
78
  contentType: "application/json",
102
- body: yield serializers.PromptCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
79
+ queryParameters: _queryParams,
80
+ requestType: "json",
103
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
104
82
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
105
83
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
106
84
  });
107
85
  if (_response.ok) {
108
- return yield serializers.Prompt.parseOrThrow(_response.body, {
86
+ return serializers.Prompt.parseOrThrow(_response.body, {
109
87
  unrecognizedObjectKeys: "passthrough",
110
88
  allowUnrecognizedUnionMembers: true,
111
89
  allowUnrecognizedEnumValues: true,
@@ -116,7 +94,7 @@ class Prompt {
116
94
  if (_response.error.reason === "status-code") {
117
95
  switch (_response.error.statusCode) {
118
96
  case 401:
119
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
97
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
120
98
  unrecognizedObjectKeys: "passthrough",
121
99
  allowUnrecognizedUnionMembers: true,
122
100
  allowUnrecognizedEnumValues: true,
@@ -124,7 +102,7 @@ class Prompt {
124
102
  breadcrumbsPrefix: ["response"],
125
103
  }));
126
104
  case 403:
127
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
105
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
128
106
  unrecognizedObjectKeys: "passthrough",
129
107
  allowUnrecognizedUnionMembers: true,
130
108
  allowUnrecognizedEnumValues: true,
@@ -132,7 +110,7 @@ class Prompt {
132
110
  breadcrumbsPrefix: ["response"],
133
111
  }));
134
112
  case 404:
135
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
113
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
136
114
  unrecognizedObjectKeys: "passthrough",
137
115
  allowUnrecognizedUnionMembers: true,
138
116
  allowUnrecognizedEnumValues: true,
@@ -140,7 +118,7 @@ class Prompt {
140
118
  breadcrumbsPrefix: ["response"],
141
119
  }));
142
120
  case 422:
143
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
121
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
144
122
  unrecognizedObjectKeys: "passthrough",
145
123
  allowUnrecognizedUnionMembers: true,
146
124
  allowUnrecognizedEnumValues: true,
@@ -170,9 +148,13 @@ class Prompt {
170
148
  });
171
149
  }
172
150
  /**
173
- * Retrieve a prompt by id
151
+ * Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in app).
174
152
  *
175
- * @param {string} id - The id of the prompt to get.
153
+ * A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
154
+ *
155
+ * A child prompt can be created by providing the `parent_id` param. Note that the `name` param in this case will be ignored as all descendents from a root prompt would share the root's name. `is_prod` can also be provided to configure whether a child should be tagged as prod.
156
+ *
157
+ * @param {Scorecard.PromptCreateParams} request
176
158
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
177
159
  *
178
160
  * @throws {@link Scorecard.UnauthorizedError}
@@ -181,22 +163,48 @@ class Prompt {
181
163
  * @throws {@link Scorecard.UnprocessableEntityError}
182
164
  *
183
165
  * @example
184
- * await scorecard.prompt.get("id")
166
+ * await client.prompt.create({
167
+ * 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>",
168
+ * name: "Prompt Name",
169
+ * description: "Description of the prompt",
170
+ * modelParams: {
171
+ * "param1": "value1",
172
+ * "param2": 0.1,
173
+ * "param3": 100,
174
+ * "param4": true
175
+ * }
176
+ * })
177
+ *
178
+ * @example
179
+ * await client.prompt.create({
180
+ * 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>",
181
+ * parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
182
+ * description: "Description of the prompt",
183
+ * modelParams: {
184
+ * "param1": "value1",
185
+ * "param2": 0.1,
186
+ * "param3": 100,
187
+ * "param4": true
188
+ * },
189
+ * isProd: true
190
+ * })
185
191
  */
186
- get(id, requestOptions) {
192
+ create(request, requestOptions) {
187
193
  var _a, _b;
188
194
  return __awaiter(this, void 0, void 0, function* () {
189
195
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
190
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
191
- method: "GET",
192
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
196
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt"),
197
+ method: "POST",
198
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
193
199
  contentType: "application/json",
200
+ requestType: "json",
201
+ body: serializers.PromptCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
194
202
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
195
203
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
196
204
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
197
205
  });
198
206
  if (_response.ok) {
199
- return yield serializers.Prompt.parseOrThrow(_response.body, {
207
+ return serializers.Prompt.parseOrThrow(_response.body, {
200
208
  unrecognizedObjectKeys: "passthrough",
201
209
  allowUnrecognizedUnionMembers: true,
202
210
  allowUnrecognizedEnumValues: true,
@@ -207,7 +215,7 @@ class Prompt {
207
215
  if (_response.error.reason === "status-code") {
208
216
  switch (_response.error.statusCode) {
209
217
  case 401:
210
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
218
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
211
219
  unrecognizedObjectKeys: "passthrough",
212
220
  allowUnrecognizedUnionMembers: true,
213
221
  allowUnrecognizedEnumValues: true,
@@ -215,7 +223,7 @@ class Prompt {
215
223
  breadcrumbsPrefix: ["response"],
216
224
  }));
217
225
  case 403:
218
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
226
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
219
227
  unrecognizedObjectKeys: "passthrough",
220
228
  allowUnrecognizedUnionMembers: true,
221
229
  allowUnrecognizedEnumValues: true,
@@ -223,7 +231,7 @@ class Prompt {
223
231
  breadcrumbsPrefix: ["response"],
224
232
  }));
225
233
  case 404:
226
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
234
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
227
235
  unrecognizedObjectKeys: "passthrough",
228
236
  allowUnrecognizedUnionMembers: true,
229
237
  allowUnrecognizedEnumValues: true,
@@ -231,7 +239,7 @@ class Prompt {
231
239
  breadcrumbsPrefix: ["response"],
232
240
  }));
233
241
  case 422:
234
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
242
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
235
243
  unrecognizedObjectKeys: "passthrough",
236
244
  allowUnrecognizedUnionMembers: true,
237
245
  allowUnrecognizedEnumValues: true,
@@ -261,9 +269,9 @@ class Prompt {
261
269
  });
262
270
  }
263
271
  /**
264
- * Delete a root prompt and all of its children.
272
+ * Retrieve a prompt by id
265
273
  *
266
- * @param {string} id - The id of the root prompt to delete.
274
+ * @param {string} id - The id of the prompt to get.
267
275
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
268
276
  *
269
277
  * @throws {@link Scorecard.UnauthorizedError}
@@ -272,27 +280,34 @@ class Prompt {
272
280
  * @throws {@link Scorecard.UnprocessableEntityError}
273
281
  *
274
282
  * @example
275
- * await scorecard.prompt.delete("id")
283
+ * await client.prompt.get("id")
276
284
  */
277
- delete(id, requestOptions) {
285
+ get(id, requestOptions) {
278
286
  var _a, _b;
279
287
  return __awaiter(this, void 0, void 0, function* () {
280
288
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
281
289
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
282
- method: "DELETE",
283
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
290
+ method: "GET",
291
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
284
292
  contentType: "application/json",
293
+ requestType: "json",
285
294
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
286
295
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
287
296
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
288
297
  });
289
298
  if (_response.ok) {
290
- return _response.body;
299
+ return serializers.Prompt.parseOrThrow(_response.body, {
300
+ unrecognizedObjectKeys: "passthrough",
301
+ allowUnrecognizedUnionMembers: true,
302
+ allowUnrecognizedEnumValues: true,
303
+ skipValidation: true,
304
+ breadcrumbsPrefix: ["response"],
305
+ });
291
306
  }
292
307
  if (_response.error.reason === "status-code") {
293
308
  switch (_response.error.statusCode) {
294
309
  case 401:
295
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
310
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
296
311
  unrecognizedObjectKeys: "passthrough",
297
312
  allowUnrecognizedUnionMembers: true,
298
313
  allowUnrecognizedEnumValues: true,
@@ -300,7 +315,7 @@ class Prompt {
300
315
  breadcrumbsPrefix: ["response"],
301
316
  }));
302
317
  case 403:
303
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
318
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
304
319
  unrecognizedObjectKeys: "passthrough",
305
320
  allowUnrecognizedUnionMembers: true,
306
321
  allowUnrecognizedEnumValues: true,
@@ -308,7 +323,7 @@ class Prompt {
308
323
  breadcrumbsPrefix: ["response"],
309
324
  }));
310
325
  case 404:
311
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
326
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
312
327
  unrecognizedObjectKeys: "passthrough",
313
328
  allowUnrecognizedUnionMembers: true,
314
329
  allowUnrecognizedEnumValues: true,
@@ -316,7 +331,7 @@ class Prompt {
316
331
  breadcrumbsPrefix: ["response"],
317
332
  }));
318
333
  case 422:
319
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
334
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
320
335
  unrecognizedObjectKeys: "passthrough",
321
336
  allowUnrecognizedUnionMembers: true,
322
337
  allowUnrecognizedEnumValues: true,
@@ -346,12 +361,9 @@ class Prompt {
346
361
  });
347
362
  }
348
363
  /**
349
- * Update a prompt.
350
- *
351
- * `is_prod` tags the provided prompt as the production prompt within the prompt graph.
364
+ * Delete a scoring config.
352
365
  *
353
- * @param {string} id - The id of the prompt to update.
354
- * @param {Scorecard.PromptUpdateParams} request
366
+ * @param {string} id - The id of the scoring config to delete.
355
367
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
356
368
  *
357
369
  * @throws {@link Scorecard.UnauthorizedError}
@@ -360,36 +372,28 @@ class Prompt {
360
372
  * @throws {@link Scorecard.UnprocessableEntityError}
361
373
  *
362
374
  * @example
363
- * await scorecard.prompt.update("id", {
364
- * isProd: true
365
- * })
375
+ * await client.prompt.delete("id")
366
376
  */
367
- update(id, request = {}, requestOptions) {
377
+ delete(id, requestOptions) {
368
378
  var _a, _b;
369
379
  return __awaiter(this, void 0, void 0, function* () {
370
380
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
371
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
372
- method: "PATCH",
373
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
381
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/scoring_config/${encodeURIComponent(id)}`),
382
+ method: "DELETE",
383
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
374
384
  contentType: "application/json",
375
- body: yield serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
385
+ requestType: "json",
376
386
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
377
387
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
378
388
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
379
389
  });
380
390
  if (_response.ok) {
381
- return yield serializers.Prompt.parseOrThrow(_response.body, {
382
- unrecognizedObjectKeys: "passthrough",
383
- allowUnrecognizedUnionMembers: true,
384
- allowUnrecognizedEnumValues: true,
385
- skipValidation: true,
386
- breadcrumbsPrefix: ["response"],
387
- });
391
+ return _response.body;
388
392
  }
389
393
  if (_response.error.reason === "status-code") {
390
394
  switch (_response.error.statusCode) {
391
395
  case 401:
392
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
396
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
393
397
  unrecognizedObjectKeys: "passthrough",
394
398
  allowUnrecognizedUnionMembers: true,
395
399
  allowUnrecognizedEnumValues: true,
@@ -397,7 +401,7 @@ class Prompt {
397
401
  breadcrumbsPrefix: ["response"],
398
402
  }));
399
403
  case 403:
400
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
404
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
401
405
  unrecognizedObjectKeys: "passthrough",
402
406
  allowUnrecognizedUnionMembers: true,
403
407
  allowUnrecognizedEnumValues: true,
@@ -405,7 +409,7 @@ class Prompt {
405
409
  breadcrumbsPrefix: ["response"],
406
410
  }));
407
411
  case 404:
408
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
412
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
409
413
  unrecognizedObjectKeys: "passthrough",
410
414
  allowUnrecognizedUnionMembers: true,
411
415
  allowUnrecognizedEnumValues: true,
@@ -413,7 +417,7 @@ class Prompt {
413
417
  breadcrumbsPrefix: ["response"],
414
418
  }));
415
419
  case 422:
416
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
420
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
417
421
  unrecognizedObjectKeys: "passthrough",
418
422
  allowUnrecognizedUnionMembers: true,
419
423
  allowUnrecognizedEnumValues: true,
@@ -443,9 +447,12 @@ class Prompt {
443
447
  });
444
448
  }
445
449
  /**
446
- * Retrieve a prod prompt by name
450
+ * Update a prompt.
447
451
  *
448
- * @param {string} name - Name of the prompt.
452
+ * `is_prod` tags the provided prompt as the production prompt within the prompt graph.
453
+ *
454
+ * @param {string} id - The id of the prompt to update.
455
+ * @param {Scorecard.PromptUpdateParams} request
449
456
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
450
457
  *
451
458
  * @throws {@link Scorecard.UnauthorizedError}
@@ -454,22 +461,26 @@ class Prompt {
454
461
  * @throws {@link Scorecard.UnprocessableEntityError}
455
462
  *
456
463
  * @example
457
- * await scorecard.prompt.getByName("name")
464
+ * await client.prompt.update("id", {
465
+ * isProd: true
466
+ * })
458
467
  */
459
- getByName(name, requestOptions) {
468
+ update(id, request = {}, requestOptions) {
460
469
  var _a, _b;
461
470
  return __awaiter(this, void 0, void 0, function* () {
462
471
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
463
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/name/${encodeURIComponent(name)}`),
464
- method: "GET",
465
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
472
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
473
+ method: "PATCH",
474
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
466
475
  contentType: "application/json",
476
+ requestType: "json",
477
+ body: serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
467
478
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
468
479
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
469
480
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
470
481
  });
471
482
  if (_response.ok) {
472
- return yield serializers.Prompt.parseOrThrow(_response.body, {
483
+ return serializers.Prompt.parseOrThrow(_response.body, {
473
484
  unrecognizedObjectKeys: "passthrough",
474
485
  allowUnrecognizedUnionMembers: true,
475
486
  allowUnrecognizedEnumValues: true,
@@ -480,7 +491,7 @@ class Prompt {
480
491
  if (_response.error.reason === "status-code") {
481
492
  switch (_response.error.statusCode) {
482
493
  case 401:
483
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
494
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
484
495
  unrecognizedObjectKeys: "passthrough",
485
496
  allowUnrecognizedUnionMembers: true,
486
497
  allowUnrecognizedEnumValues: true,
@@ -488,7 +499,7 @@ class Prompt {
488
499
  breadcrumbsPrefix: ["response"],
489
500
  }));
490
501
  case 403:
491
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
502
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
492
503
  unrecognizedObjectKeys: "passthrough",
493
504
  allowUnrecognizedUnionMembers: true,
494
505
  allowUnrecognizedEnumValues: true,
@@ -496,7 +507,7 @@ class Prompt {
496
507
  breadcrumbsPrefix: ["response"],
497
508
  }));
498
509
  case 404:
499
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
510
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
500
511
  unrecognizedObjectKeys: "passthrough",
501
512
  allowUnrecognizedUnionMembers: true,
502
513
  allowUnrecognizedEnumValues: true,
@@ -504,7 +515,7 @@ class Prompt {
504
515
  breadcrumbsPrefix: ["response"],
505
516
  }));
506
517
  case 422:
507
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
518
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
508
519
  unrecognizedObjectKeys: "passthrough",
509
520
  allowUnrecognizedUnionMembers: true,
510
521
  allowUnrecognizedEnumValues: true,
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * name: "name"
8
+ * }
9
+ */
10
+ export interface PromptGetByNameRequest {
11
+ /**
12
+ * Name of the prompt.
13
+ */
14
+ name: string;
15
+ }
@@ -1,2 +1,3 @@
1
+ export { type PromptGetByNameRequest } from "./PromptGetByNameRequest";
1
2
  export { type PromptCreateParams } from "./PromptCreateParams";
2
3
  export { type PromptUpdateParams } from "./PromptUpdateParams";
@@ -11,8 +11,11 @@ export declare namespace Run {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -31,7 +34,7 @@ export declare class Run {
31
34
  * @throws {@link Scorecard.UnprocessableEntityError}
32
35
  *
33
36
  * @example
34
- * await scorecard.run.create()
37
+ * await client.run.create()
35
38
  */
36
39
  create(request?: Scorecard.RunCreateParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
37
40
  /**
@@ -46,7 +49,7 @@ export declare class Run {
46
49
  * @throws {@link Scorecard.UnprocessableEntityError}
47
50
  *
48
51
  * @example
49
- * await scorecard.run.get(1)
52
+ * await client.run.get(1)
50
53
  */
51
54
  get(runId: number, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
52
55
  /**
@@ -62,7 +65,7 @@ export declare class Run {
62
65
  * @throws {@link Scorecard.UnprocessableEntityError}
63
66
  *
64
67
  * @example
65
- * await scorecard.run.updateStatus(1)
68
+ * await client.run.updateStatus(1)
66
69
  */
67
70
  updateStatus(runId: number, request?: Scorecard.UpdateStatusParams, requestOptions?: Run.RequestOptions): Promise<Scorecard.Run>;
68
71
  protected _getCustomAuthorizationHeaders(): Promise<{