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
package/telemetry.d.ts CHANGED
@@ -1,6 +1 @@
1
- declare const trace: any;
2
- declare const OTLPTraceExporter: any;
3
- declare const Resource: any;
4
- declare const BatchSpanProcessor: any, ConsoleSpanExporter: any, NodeTracerProvider: any;
5
- declare const SEMRESATTRS_SERVICE_NAME: any;
6
1
  declare function checkInstalled(...modules: string[]): boolean;
package/telemetry.js CHANGED
@@ -8,11 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- const { trace } = require('@opentelemetry/api');
12
- const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
13
- const { Resource } = require('@opentelemetry/resources');
14
- const { BatchSpanProcessor, ConsoleSpanExporter, NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
15
- const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
16
11
  function checkInstalled(...modules) {
17
12
  for (let i = 0; i < modules.length; i++) {
18
13
  let module = modules[i];
@@ -27,6 +22,23 @@ function checkInstalled(...modules) {
27
22
  }
28
23
  module.exports = {
29
24
  setup(name, scorecardConfig, debug = false) {
25
+ const required = [
26
+ '@opentelemetry/api',
27
+ '@opentelemetry/core',
28
+ '@opentelemetry/exporter-trace-otlp-http',
29
+ '@opentelemetry/resources',
30
+ '@opentelemetry/sdk-trace-node',
31
+ '@opentelemetry/semantic-conventions'
32
+ ];
33
+ if (!checkInstalled(...required)) {
34
+ throw new Error(`Required OpenTelemetry packages not installed. Please ensure that all necessary peerDependencies are installed:\n${required.map(module => `- ${module}`).join('\n')}`);
35
+ }
36
+ const { propagation, trace } = require('@opentelemetry/api');
37
+ const { CompositePropagator, W3CBaggagePropagator, W3CTraceContextPropagator } = require('@opentelemetry/core');
38
+ const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
39
+ const { Resource } = require('@opentelemetry/resources');
40
+ const { BatchSpanProcessor, ConsoleSpanExporter, NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
41
+ const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
30
42
  const resource = Resource.default().merge(new Resource({
31
43
  [SEMRESATTRS_SERVICE_NAME]: name,
32
44
  }));
@@ -38,6 +50,12 @@ module.exports = {
38
50
  const processor = new BatchSpanProcessor(consoleExporter);
39
51
  provider.addSpanProcessor(processor);
40
52
  }
53
+ propagation.setGlobalPropagator(new CompositePropagator({
54
+ propagators: [
55
+ new W3CTraceContextPropagator(),
56
+ new W3CBaggagePropagator()
57
+ ]
58
+ }));
41
59
  const url = scorecardConfig.telemetryUrl ? scorecardConfig.telemetryUrl : 'https://telemetry.getscorecard.ai';
42
60
  const otlpExporter = new OTLPTraceExporter({
43
61
  url: `${url}/v1/traces`,
@@ -48,11 +66,11 @@ module.exports = {
48
66
  const processor = new BatchSpanProcessor(otlpExporter);
49
67
  provider.addSpanProcessor(processor);
50
68
  provider.register();
51
- if (checkInstalled('@langchain/core')) {
69
+ if (checkInstalled('@langchain/core', '@arizeai/openinference-instrumentation-langchain', '@opentelemetry/instrumentation')) {
52
70
  const { LangChainInstrumentation } = require('@arizeai/openinference-instrumentation-langchain');
53
71
  new LangChainInstrumentation().manuallyInstrument(require('@langchain/core/callbacks/manager'));
54
72
  }
55
- if (checkInstalled('openai')) {
73
+ if (checkInstalled('openai', '@arizeai/openinference-instrumentation-openai', '@opentelemetry/instrumentation')) {
56
74
  const { OpenAIInstrumentation } = require('@arizeai/openinference-instrumentation-openai');
57
75
  new OpenAIInstrumentation().manuallyInstrument(require('openai'));
58
76
  }
@@ -1,5 +1,7 @@
1
1
  import { ScorecardClient as FernClient } from "../Client";
2
2
  export declare namespace ScorecardClient {
3
+ interface Options extends Omit<FernClient.Options, "fetcher"> {
4
+ }
3
5
  interface RequestOptions extends FernClient.RequestOptions {
4
6
  }
5
7
  interface RunTestArgs {
@@ -18,6 +20,7 @@ export declare namespace ScorecardClient {
18
20
  }
19
21
  }
20
22
  export declare class ScorecardClient extends FernClient {
23
+ constructor(options: ScorecardClient.Options);
21
24
  /**
22
25
  * Runs all tests within a testset
23
26
  */
@@ -33,9 +33,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.ScorecardClient = void 0;
36
+ const api_1 = require("@opentelemetry/api");
36
37
  const Client_1 = require("../Client");
38
+ const core_1 = require("../core");
37
39
  const errors = __importStar(require("../errors"));
38
40
  class ScorecardClient extends Client_1.ScorecardClient {
41
+ constructor(options) {
42
+ const fetcher = (args) => {
43
+ var _a;
44
+ args.headers = (_a = args.headers) !== null && _a !== void 0 ? _a : {};
45
+ api_1.propagation.inject(api_1.context.active(), args.headers);
46
+ return (0, core_1.fetcher)(args);
47
+ };
48
+ super(Object.assign(Object.assign({}, options), { fetcher }));
49
+ }
39
50
  /**
40
51
  * Runs all tests within a testset
41
52
  */
@@ -1,40 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "../../../../environments";
5
- import * as core from "../../../../core";
6
- import * as Scorecard from "../../../index";
7
- export declare namespace Traces {
8
- interface Options {
9
- environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
- apiKey: core.Supplier<string>;
11
- fetcher?: core.FetchFunction;
12
- }
13
- interface RequestOptions {
14
- timeoutInSeconds?: number;
15
- maxRetries?: number;
16
- abortSignal?: AbortSignal;
17
- }
18
- }
19
- export declare class Traces {
20
- protected readonly _options: Traces.Options;
21
- constructor(_options: Traces.Options);
22
- /**
23
- * Retrieve trace spans
24
- *
25
- * @param {string} traceId - The ID of the trace to retrieve spans from.
26
- * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
27
- *
28
- * @throws {@link Scorecard.UnauthorizedError}
29
- * @throws {@link Scorecard.ForbiddenError}
30
- * @throws {@link Scorecard.NotFoundError}
31
- * @throws {@link Scorecard.UnprocessableEntityError}
32
- *
33
- * @example
34
- * await scorecard.traces.get("trace_id")
35
- */
36
- get(traceId: string, requestOptions?: Traces.RequestOptions): Promise<Scorecard.Span[]>;
37
- protected _getCustomAuthorizationHeaders(): Promise<{
38
- "X-API-Key": string;
39
- }>;
40
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- export interface TestCaseCreate {
5
- testsetId: number;
6
- userQuery: string;
7
- context?: string;
8
- response?: string;
9
- ideal?: string;
10
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "../../../../environments";
5
- import * as core from "../../../../core";
6
- import * as Scorecard from "../../../index";
7
- export declare namespace Traces {
8
- interface Options {
9
- environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
- apiKey: core.Supplier<string>;
11
- fetcher?: core.FetchFunction;
12
- }
13
- interface RequestOptions {
14
- timeoutInSeconds?: number;
15
- maxRetries?: number;
16
- abortSignal?: AbortSignal;
17
- }
18
- }
19
- export declare class Traces {
20
- protected readonly _options: Traces.Options;
21
- constructor(_options: Traces.Options);
22
- /**
23
- * Retrieve trace spans
24
- *
25
- * @param {string} traceId - The ID of the trace to retrieve spans from.
26
- * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
27
- *
28
- * @throws {@link Scorecard.UnauthorizedError}
29
- * @throws {@link Scorecard.ForbiddenError}
30
- * @throws {@link Scorecard.NotFoundError}
31
- * @throws {@link Scorecard.UnprocessableEntityError}
32
- *
33
- * @example
34
- * await scorecard.traces.get("trace_id")
35
- */
36
- get(traceId: string, requestOptions?: Traces.RequestOptions): Promise<Scorecard.Span[]>;
37
- protected _getCustomAuthorizationHeaders(): Promise<{
38
- "X-API-Key": string;
39
- }>;
40
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- export interface TestCaseCreate {
5
- testsetId: number;
6
- userQuery: string;
7
- context?: string;
8
- response?: string;
9
- ideal?: string;
10
- }
@@ -1 +0,0 @@
1
- export * as get from "./get";
@@ -1,16 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as serializers from "../index";
5
- import * as Scorecard from "../../api/index";
6
- import * as core from "../../core";
7
- export declare const TestCaseCreate: core.serialization.ObjectSchema<serializers.TestCaseCreate.Raw, Scorecard.TestCaseCreate>;
8
- export declare namespace TestCaseCreate {
9
- interface Raw {
10
- testset_id: number;
11
- user_query: string;
12
- context?: string | null;
13
- response?: string | null;
14
- ideal?: string | null;
15
- }
16
- }
@@ -1 +0,0 @@
1
- export * as get from "./get";
@@ -1,16 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as serializers from "../index";
5
- import * as Scorecard from "../../api/index";
6
- import * as core from "../../core";
7
- export declare const TestCaseCreate: core.serialization.ObjectSchema<serializers.TestCaseCreate.Raw, Scorecard.TestCaseCreate>;
8
- export declare namespace TestCaseCreate {
9
- interface Raw {
10
- testset_id: number;
11
- user_query: string;
12
- context?: string | null;
13
- response?: string | null;
14
- ideal?: string | null;
15
- }
16
- }