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
@@ -42,19 +42,120 @@ 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).
53
+ * Retrieve a prompt by name, defaulting to the production prompt, unless a tag to select the prompt by is specified
54
+ *
55
+ * @param {Scorecard.PromptGetByNameRequest} request
56
+ * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link Scorecard.UnauthorizedError}
59
+ * @throws {@link Scorecard.ForbiddenError}
60
+ * @throws {@link Scorecard.NotFoundError}
61
+ * @throws {@link Scorecard.UnprocessableEntityError}
62
+ *
63
+ * @example
64
+ * await client.prompt.getByName({
65
+ * name: "name"
66
+ * })
67
+ */
68
+ getByName(request, requestOptions) {
69
+ var _a, _b;
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const { name, tag } = request;
72
+ const _queryParams = {};
73
+ _queryParams["name"] = name;
74
+ if (tag != null) {
75
+ _queryParams["tag"] = tag;
76
+ }
77
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
78
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt"),
79
+ method: "GET",
80
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
81
+ contentType: "application/json",
82
+ queryParameters: _queryParams,
83
+ requestType: "json",
84
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
85
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
86
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
87
+ });
88
+ if (_response.ok) {
89
+ return serializers.Prompt.parseOrThrow(_response.body, {
90
+ unrecognizedObjectKeys: "passthrough",
91
+ allowUnrecognizedUnionMembers: true,
92
+ allowUnrecognizedEnumValues: true,
93
+ skipValidation: true,
94
+ breadcrumbsPrefix: ["response"],
95
+ });
96
+ }
97
+ if (_response.error.reason === "status-code") {
98
+ switch (_response.error.statusCode) {
99
+ case 401:
100
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
101
+ unrecognizedObjectKeys: "passthrough",
102
+ allowUnrecognizedUnionMembers: true,
103
+ allowUnrecognizedEnumValues: true,
104
+ skipValidation: true,
105
+ breadcrumbsPrefix: ["response"],
106
+ }));
107
+ case 403:
108
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
109
+ unrecognizedObjectKeys: "passthrough",
110
+ allowUnrecognizedUnionMembers: true,
111
+ allowUnrecognizedEnumValues: true,
112
+ skipValidation: true,
113
+ breadcrumbsPrefix: ["response"],
114
+ }));
115
+ case 404:
116
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
117
+ unrecognizedObjectKeys: "passthrough",
118
+ allowUnrecognizedUnionMembers: true,
119
+ allowUnrecognizedEnumValues: true,
120
+ skipValidation: true,
121
+ breadcrumbsPrefix: ["response"],
122
+ }));
123
+ case 422:
124
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
125
+ unrecognizedObjectKeys: "passthrough",
126
+ allowUnrecognizedUnionMembers: true,
127
+ allowUnrecognizedEnumValues: true,
128
+ skipValidation: true,
129
+ breadcrumbsPrefix: ["response"],
130
+ }));
131
+ default:
132
+ throw new errors.ScorecardError({
133
+ statusCode: _response.error.statusCode,
134
+ body: _response.error.body,
135
+ });
136
+ }
137
+ }
138
+ switch (_response.error.reason) {
139
+ case "non-json":
140
+ throw new errors.ScorecardError({
141
+ statusCode: _response.error.statusCode,
142
+ body: _response.error.rawBody,
143
+ });
144
+ case "timeout":
145
+ throw new errors.ScorecardTimeoutError();
146
+ case "unknown":
147
+ throw new errors.ScorecardError({
148
+ message: _response.error.errorMessage,
149
+ });
150
+ }
151
+ });
152
+ }
153
+ /**
154
+ * Two types of prompts can be created - a root prompt or a child prompt (aka Prompt Version in the app).
54
155
  *
55
- * A root prompt can be created by providing the `name` param, and it will always be tagged as prod.
156
+ * A root prompt can be created by providing the `name` param, and it will always be tagged as production.
56
157
  *
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.
158
+ * 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.
58
159
  *
59
160
  * @param {Scorecard.PromptCreateParams} request
60
161
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
@@ -65,7 +166,7 @@ class Prompt {
65
166
  * @throws {@link Scorecard.UnprocessableEntityError}
66
167
  *
67
168
  * @example
68
- * await scorecard.prompt.create({
169
+ * await client.prompt.create({
69
170
  * 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
171
  * name: "Prompt Name",
71
172
  * description: "Description of the prompt",
@@ -74,11 +175,13 @@ class Prompt {
74
175
  * "param2": 0.1,
75
176
  * "param3": 100,
76
177
  * "param4": true
77
- * }
178
+ * },
179
+ * tag: "1.0",
180
+ * projectId: 1
78
181
  * })
79
182
  *
80
183
  * @example
81
- * await scorecard.prompt.create({
184
+ * await client.prompt.create({
82
185
  * 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
186
  * parentId: "7ac3cbd5-3b99-4e72-97f3-9cd2e749cace",
84
187
  * description: "Description of the prompt",
@@ -88,7 +191,9 @@ class Prompt {
88
191
  * "param3": 100,
89
192
  * "param4": true
90
193
  * },
91
- * isProd: true
194
+ * tag: "v1.1",
195
+ * isProd: true,
196
+ * projectId: 1
92
197
  * })
93
198
  */
94
199
  create(request, requestOptions) {
@@ -97,15 +202,16 @@ class Prompt {
97
202
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
98
203
  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
204
  method: "POST",
100
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
205
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
101
206
  contentType: "application/json",
102
- body: yield serializers.PromptCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
207
+ requestType: "json",
208
+ body: serializers.PromptCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
103
209
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
104
210
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
105
211
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
106
212
  });
107
213
  if (_response.ok) {
108
- return yield serializers.Prompt.parseOrThrow(_response.body, {
214
+ return serializers.Prompt.parseOrThrow(_response.body, {
109
215
  unrecognizedObjectKeys: "passthrough",
110
216
  allowUnrecognizedUnionMembers: true,
111
217
  allowUnrecognizedEnumValues: true,
@@ -116,7 +222,7 @@ class Prompt {
116
222
  if (_response.error.reason === "status-code") {
117
223
  switch (_response.error.statusCode) {
118
224
  case 401:
119
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
225
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
120
226
  unrecognizedObjectKeys: "passthrough",
121
227
  allowUnrecognizedUnionMembers: true,
122
228
  allowUnrecognizedEnumValues: true,
@@ -124,7 +230,7 @@ class Prompt {
124
230
  breadcrumbsPrefix: ["response"],
125
231
  }));
126
232
  case 403:
127
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
233
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
128
234
  unrecognizedObjectKeys: "passthrough",
129
235
  allowUnrecognizedUnionMembers: true,
130
236
  allowUnrecognizedEnumValues: true,
@@ -132,7 +238,7 @@ class Prompt {
132
238
  breadcrumbsPrefix: ["response"],
133
239
  }));
134
240
  case 404:
135
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
241
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
136
242
  unrecognizedObjectKeys: "passthrough",
137
243
  allowUnrecognizedUnionMembers: true,
138
244
  allowUnrecognizedEnumValues: true,
@@ -140,7 +246,7 @@ class Prompt {
140
246
  breadcrumbsPrefix: ["response"],
141
247
  }));
142
248
  case 422:
143
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
249
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
144
250
  unrecognizedObjectKeys: "passthrough",
145
251
  allowUnrecognizedUnionMembers: true,
146
252
  allowUnrecognizedEnumValues: true,
@@ -170,9 +276,9 @@ class Prompt {
170
276
  });
171
277
  }
172
278
  /**
173
- * Retrieve a prompt by id
279
+ * List all prompts with cursor-based pagination
174
280
  *
175
- * @param {string} id - The id of the prompt to get.
281
+ * @param {Scorecard.PromptListPromptsRequest} request
176
282
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
177
283
  *
178
284
  * @throws {@link Scorecard.UnauthorizedError}
@@ -181,22 +287,35 @@ class Prompt {
181
287
  * @throws {@link Scorecard.UnprocessableEntityError}
182
288
  *
183
289
  * @example
184
- * await scorecard.prompt.get("id")
290
+ * await client.prompt.listPrompts()
185
291
  */
186
- get(id, requestOptions) {
292
+ listPrompts(request = {}, requestOptions) {
187
293
  var _a, _b;
188
294
  return __awaiter(this, void 0, void 0, function* () {
295
+ const { projectId, cursor, size } = request;
296
+ const _queryParams = {};
297
+ if (projectId != null) {
298
+ _queryParams["project_id"] = projectId;
299
+ }
300
+ if (cursor != null) {
301
+ _queryParams["cursor"] = cursor;
302
+ }
303
+ if (size != null) {
304
+ _queryParams["size"] = size.toString();
305
+ }
189
306
  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)}`),
307
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt/list"),
191
308
  method: "GET",
192
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
309
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
193
310
  contentType: "application/json",
311
+ queryParameters: _queryParams,
312
+ requestType: "json",
194
313
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
195
314
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
196
315
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
197
316
  });
198
317
  if (_response.ok) {
199
- return yield serializers.Prompt.parseOrThrow(_response.body, {
318
+ return serializers.PromptCursorPage.parseOrThrow(_response.body, {
200
319
  unrecognizedObjectKeys: "passthrough",
201
320
  allowUnrecognizedUnionMembers: true,
202
321
  allowUnrecognizedEnumValues: true,
@@ -207,7 +326,7 @@ class Prompt {
207
326
  if (_response.error.reason === "status-code") {
208
327
  switch (_response.error.statusCode) {
209
328
  case 401:
210
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
329
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
211
330
  unrecognizedObjectKeys: "passthrough",
212
331
  allowUnrecognizedUnionMembers: true,
213
332
  allowUnrecognizedEnumValues: true,
@@ -215,7 +334,7 @@ class Prompt {
215
334
  breadcrumbsPrefix: ["response"],
216
335
  }));
217
336
  case 403:
218
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
337
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
219
338
  unrecognizedObjectKeys: "passthrough",
220
339
  allowUnrecognizedUnionMembers: true,
221
340
  allowUnrecognizedEnumValues: true,
@@ -223,7 +342,7 @@ class Prompt {
223
342
  breadcrumbsPrefix: ["response"],
224
343
  }));
225
344
  case 404:
226
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
345
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
227
346
  unrecognizedObjectKeys: "passthrough",
228
347
  allowUnrecognizedUnionMembers: true,
229
348
  allowUnrecognizedEnumValues: true,
@@ -231,7 +350,7 @@ class Prompt {
231
350
  breadcrumbsPrefix: ["response"],
232
351
  }));
233
352
  case 422:
234
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
353
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
235
354
  unrecognizedObjectKeys: "passthrough",
236
355
  allowUnrecognizedUnionMembers: true,
237
356
  allowUnrecognizedEnumValues: true,
@@ -261,9 +380,9 @@ class Prompt {
261
380
  });
262
381
  }
263
382
  /**
264
- * Delete a root prompt and all of its children.
383
+ * Retrieve a prompt by id
265
384
  *
266
- * @param {string} id - The id of the root prompt to delete.
385
+ * @param {string} id - The id of the prompt to get.
267
386
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
268
387
  *
269
388
  * @throws {@link Scorecard.UnauthorizedError}
@@ -272,27 +391,34 @@ class Prompt {
272
391
  * @throws {@link Scorecard.UnprocessableEntityError}
273
392
  *
274
393
  * @example
275
- * await scorecard.prompt.delete("id")
394
+ * await client.prompt.get("id")
276
395
  */
277
- delete(id, requestOptions) {
396
+ get(id, requestOptions) {
278
397
  var _a, _b;
279
398
  return __awaiter(this, void 0, void 0, function* () {
280
399
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
281
400
  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.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
401
+ method: "GET",
402
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
284
403
  contentType: "application/json",
404
+ requestType: "json",
285
405
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
286
406
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
287
407
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
288
408
  });
289
409
  if (_response.ok) {
290
- return _response.body;
410
+ return serializers.Prompt.parseOrThrow(_response.body, {
411
+ unrecognizedObjectKeys: "passthrough",
412
+ allowUnrecognizedUnionMembers: true,
413
+ allowUnrecognizedEnumValues: true,
414
+ skipValidation: true,
415
+ breadcrumbsPrefix: ["response"],
416
+ });
291
417
  }
292
418
  if (_response.error.reason === "status-code") {
293
419
  switch (_response.error.statusCode) {
294
420
  case 401:
295
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
421
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
296
422
  unrecognizedObjectKeys: "passthrough",
297
423
  allowUnrecognizedUnionMembers: true,
298
424
  allowUnrecognizedEnumValues: true,
@@ -300,7 +426,7 @@ class Prompt {
300
426
  breadcrumbsPrefix: ["response"],
301
427
  }));
302
428
  case 403:
303
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
429
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
304
430
  unrecognizedObjectKeys: "passthrough",
305
431
  allowUnrecognizedUnionMembers: true,
306
432
  allowUnrecognizedEnumValues: true,
@@ -308,7 +434,7 @@ class Prompt {
308
434
  breadcrumbsPrefix: ["response"],
309
435
  }));
310
436
  case 404:
311
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
437
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
312
438
  unrecognizedObjectKeys: "passthrough",
313
439
  allowUnrecognizedUnionMembers: true,
314
440
  allowUnrecognizedEnumValues: true,
@@ -316,7 +442,7 @@ class Prompt {
316
442
  breadcrumbsPrefix: ["response"],
317
443
  }));
318
444
  case 422:
319
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
445
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
320
446
  unrecognizedObjectKeys: "passthrough",
321
447
  allowUnrecognizedUnionMembers: true,
322
448
  allowUnrecognizedEnumValues: true,
@@ -346,12 +472,9 @@ class Prompt {
346
472
  });
347
473
  }
348
474
  /**
349
- * Update a prompt.
350
- *
351
- * `is_prod` tags the provided prompt as the production prompt within the prompt graph.
475
+ * Delete a root prompt and all of its children.
352
476
  *
353
- * @param {string} id - The id of the prompt to update.
354
- * @param {Scorecard.PromptUpdateParams} request
477
+ * @param {string} id - The id of the root prompt to delete.
355
478
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
356
479
  *
357
480
  * @throws {@link Scorecard.UnauthorizedError}
@@ -360,36 +483,28 @@ class Prompt {
360
483
  * @throws {@link Scorecard.UnprocessableEntityError}
361
484
  *
362
485
  * @example
363
- * await scorecard.prompt.update("id", {
364
- * isProd: true
365
- * })
486
+ * await client.prompt.delete("id")
366
487
  */
367
- update(id, request = {}, requestOptions) {
488
+ delete(id, requestOptions) {
368
489
  var _a, _b;
369
490
  return __awaiter(this, void 0, void 0, function* () {
370
491
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
371
492
  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.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
493
+ method: "DELETE",
494
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
374
495
  contentType: "application/json",
375
- body: yield serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
496
+ requestType: "json",
376
497
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
377
498
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
378
499
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
379
500
  });
380
501
  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
- });
502
+ return _response.body;
388
503
  }
389
504
  if (_response.error.reason === "status-code") {
390
505
  switch (_response.error.statusCode) {
391
506
  case 401:
392
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
507
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
393
508
  unrecognizedObjectKeys: "passthrough",
394
509
  allowUnrecognizedUnionMembers: true,
395
510
  allowUnrecognizedEnumValues: true,
@@ -397,7 +512,7 @@ class Prompt {
397
512
  breadcrumbsPrefix: ["response"],
398
513
  }));
399
514
  case 403:
400
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
515
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
401
516
  unrecognizedObjectKeys: "passthrough",
402
517
  allowUnrecognizedUnionMembers: true,
403
518
  allowUnrecognizedEnumValues: true,
@@ -405,7 +520,7 @@ class Prompt {
405
520
  breadcrumbsPrefix: ["response"],
406
521
  }));
407
522
  case 404:
408
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
523
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
409
524
  unrecognizedObjectKeys: "passthrough",
410
525
  allowUnrecognizedUnionMembers: true,
411
526
  allowUnrecognizedEnumValues: true,
@@ -413,7 +528,7 @@ class Prompt {
413
528
  breadcrumbsPrefix: ["response"],
414
529
  }));
415
530
  case 422:
416
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
531
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
417
532
  unrecognizedObjectKeys: "passthrough",
418
533
  allowUnrecognizedUnionMembers: true,
419
534
  allowUnrecognizedEnumValues: true,
@@ -443,9 +558,12 @@ class Prompt {
443
558
  });
444
559
  }
445
560
  /**
446
- * Retrieve a prod prompt by name
561
+ * Update a prompt.
562
+ *
563
+ * `is_prod` tags the provided prompt as the production prompt within the prompt graph.
447
564
  *
448
- * @param {string} name - Name of the prompt.
565
+ * @param {string} id - The id of the prompt to update.
566
+ * @param {Scorecard.PromptUpdateParams} request
449
567
  * @param {Prompt.RequestOptions} requestOptions - Request-specific configuration.
450
568
  *
451
569
  * @throws {@link Scorecard.UnauthorizedError}
@@ -454,22 +572,26 @@ class Prompt {
454
572
  * @throws {@link Scorecard.UnprocessableEntityError}
455
573
  *
456
574
  * @example
457
- * await scorecard.prompt.getByName("name")
575
+ * await client.prompt.update("id", {
576
+ * isProd: true
577
+ * })
458
578
  */
459
- getByName(name, requestOptions) {
579
+ update(id, request = {}, requestOptions) {
460
580
  var _a, _b;
461
581
  return __awaiter(this, void 0, void 0, function* () {
462
582
  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.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
583
+ 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)}`),
584
+ method: "PATCH",
585
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.1", "User-Agent": "scorecard-ai/0.6.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
466
586
  contentType: "application/json",
587
+ requestType: "json",
588
+ body: serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
467
589
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
468
590
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
469
591
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
470
592
  });
471
593
  if (_response.ok) {
472
- return yield serializers.Prompt.parseOrThrow(_response.body, {
594
+ return serializers.Prompt.parseOrThrow(_response.body, {
473
595
  unrecognizedObjectKeys: "passthrough",
474
596
  allowUnrecognizedUnionMembers: true,
475
597
  allowUnrecognizedEnumValues: true,
@@ -480,7 +602,7 @@ class Prompt {
480
602
  if (_response.error.reason === "status-code") {
481
603
  switch (_response.error.statusCode) {
482
604
  case 401:
483
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
605
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
484
606
  unrecognizedObjectKeys: "passthrough",
485
607
  allowUnrecognizedUnionMembers: true,
486
608
  allowUnrecognizedEnumValues: true,
@@ -488,7 +610,7 @@ class Prompt {
488
610
  breadcrumbsPrefix: ["response"],
489
611
  }));
490
612
  case 403:
491
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
613
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
492
614
  unrecognizedObjectKeys: "passthrough",
493
615
  allowUnrecognizedUnionMembers: true,
494
616
  allowUnrecognizedEnumValues: true,
@@ -496,7 +618,7 @@ class Prompt {
496
618
  breadcrumbsPrefix: ["response"],
497
619
  }));
498
620
  case 404:
499
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
621
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
500
622
  unrecognizedObjectKeys: "passthrough",
501
623
  allowUnrecognizedUnionMembers: true,
502
624
  allowUnrecognizedEnumValues: true,
@@ -504,7 +626,7 @@ class Prompt {
504
626
  breadcrumbsPrefix: ["response"],
505
627
  }));
506
628
  case 422:
507
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
629
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
508
630
  unrecognizedObjectKeys: "passthrough",
509
631
  allowUnrecognizedUnionMembers: true,
510
632
  allowUnrecognizedEnumValues: true,
@@ -13,7 +13,9 @@ import * as Scorecard from "../../../../index";
13
13
  * "param2": 0.1,
14
14
  * "param3": 100,
15
15
  * "param4": true
16
- * }
16
+ * },
17
+ * tag: "1.0",
18
+ * projectId: 1
17
19
  * }
18
20
  *
19
21
  * @example
@@ -27,7 +29,9 @@ import * as Scorecard from "../../../../index";
27
29
  * "param3": 100,
28
30
  * "param4": true
29
31
  * },
30
- * isProd: true
32
+ * tag: "v1.1",
33
+ * isProd: true,
34
+ * projectId: 1
31
35
  * }
32
36
  */
33
37
  export interface PromptCreateParams {
@@ -36,5 +40,7 @@ export interface PromptCreateParams {
36
40
  parentId?: string;
37
41
  description?: string;
38
42
  modelParams?: Record<string, Scorecard.PromptCreateParamsModelParamsValue | undefined>;
43
+ tag?: string;
39
44
  isProd?: boolean;
45
+ projectId?: number;
40
46
  }
@@ -0,0 +1,19 @@
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
+ /**
16
+ * Tag to select by. Defaults to selecting the production version
17
+ */
18
+ tag?: string;
19
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface PromptListPromptsRequest {
9
+ /**
10
+ * ID of Project to filter by.
11
+ */
12
+ projectId?: string;
13
+ /**
14
+ * Cursor for the next page
15
+ */
16
+ cursor?: string;
17
+ /**
18
+ * Page size
19
+ */
20
+ size?: number;
21
+ }
@@ -1,2 +1,4 @@
1
+ export { type PromptGetByNameRequest } from "./PromptGetByNameRequest";
1
2
  export { type PromptCreateParams } from "./PromptCreateParams";
3
+ export { type PromptListPromptsRequest } from "./PromptListPromptsRequest";
2
4
  export { type PromptUpdateParams } from "./PromptUpdateParams";