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
@@ -25,22 +25,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  __setModuleDefault(result, mod);
26
26
  return result;
27
27
  };
28
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
28
  Object.defineProperty(exports, "__esModule", { value: true });
38
29
  exports.TestCaseCustomLabelsValue = void 0;
30
+ const serializers = __importStar(require("../index"));
39
31
  const core = __importStar(require("../../core"));
40
32
  const FileUrl_1 = require("./FileUrl");
41
33
  exports.TestCaseCustomLabelsValue = core.serialization.undiscriminatedUnion([
42
34
  FileUrl_1.FileUrl,
43
- core.serialization.lazyObject(() => __awaiter(void 0, void 0, void 0, function* () { return (yield Promise.resolve().then(() => __importStar(require("..")))).JsonObject; })),
35
+ core.serialization.lazyObject(() => serializers.JsonObject),
44
36
  core.serialization.string(),
45
37
  core.serialization.number(),
46
38
  core.serialization.number(),
@@ -0,0 +1,13 @@
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 TestcaseBatchDeletionResponse: core.serialization.ObjectSchema<serializers.TestcaseBatchDeletionResponse.Raw, Scorecard.TestcaseBatchDeletionResponse>;
8
+ export declare namespace TestcaseBatchDeletionResponse {
9
+ interface Raw {
10
+ ids: number[];
11
+ detail: string;
12
+ }
13
+ }
@@ -26,12 +26,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  return result;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.TestCaseCreate = void 0;
29
+ exports.TestcaseBatchDeletionResponse = void 0;
30
30
  const core = __importStar(require("../../core"));
31
- exports.TestCaseCreate = core.serialization.object({
32
- testsetId: core.serialization.property("testset_id", core.serialization.number()),
33
- userQuery: core.serialization.property("user_query", core.serialization.string()),
34
- context: core.serialization.string().optional(),
35
- response: core.serialization.string().optional(),
36
- ideal: core.serialization.string().optional(),
31
+ exports.TestcaseBatchDeletionResponse = core.serialization.object({
32
+ ids: core.serialization.list(core.serialization.number()),
33
+ detail: core.serialization.string(),
37
34
  });
@@ -28,5 +28,6 @@ export declare namespace Testrecord {
28
28
  prompt?: string | null;
29
29
  model_params?: Record<string, TestrecordModelParamsValue.Raw | null | undefined> | null;
30
30
  model_debug_info?: Record<string, TestrecordModelDebugInfoValue.Raw | null | undefined> | null;
31
+ error_message?: string | null;
31
32
  }
32
33
  }
@@ -50,4 +50,5 @@ exports.Testrecord = core.serialization.object({
50
50
  prompt: core.serialization.string().optional(),
51
51
  modelParams: core.serialization.property("model_params", core.serialization.record(core.serialization.string(), TestrecordModelParamsValue_1.TestrecordModelParamsValue.optional()).optional()),
52
52
  modelDebugInfo: core.serialization.property("model_debug_info", core.serialization.record(core.serialization.string(), TestrecordModelDebugInfoValue_1.TestrecordModelDebugInfoValue.optional()).optional()),
53
+ errorMessage: core.serialization.property("error_message", core.serialization.string().optional()),
53
54
  });
@@ -25,21 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  __setModuleDefault(result, mod);
26
26
  return result;
27
27
  };
28
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
28
  Object.defineProperty(exports, "__esModule", { value: true });
38
29
  exports.TestrecordCustomInputsValue = void 0;
30
+ const serializers = __importStar(require("../index"));
39
31
  const core = __importStar(require("../../core"));
40
32
  const FileUrl_1 = require("./FileUrl");
41
33
  exports.TestrecordCustomInputsValue = core.serialization.undiscriminatedUnion([
42
34
  core.serialization.string(),
43
35
  FileUrl_1.FileUrl,
44
- core.serialization.lazyObject(() => __awaiter(void 0, void 0, void 0, function* () { return (yield Promise.resolve().then(() => __importStar(require("..")))).JsonObject; })),
36
+ core.serialization.lazyObject(() => serializers.JsonObject),
45
37
  ]);
@@ -25,21 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  __setModuleDefault(result, mod);
26
26
  return result;
27
27
  };
28
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
28
  Object.defineProperty(exports, "__esModule", { value: true });
38
29
  exports.TestrecordCustomLabelsValue = void 0;
30
+ const serializers = __importStar(require("../index"));
39
31
  const core = __importStar(require("../../core"));
40
32
  const FileUrl_1 = require("./FileUrl");
41
33
  exports.TestrecordCustomLabelsValue = core.serialization.undiscriminatedUnion([
42
34
  core.serialization.string(),
43
35
  FileUrl_1.FileUrl,
44
- core.serialization.lazyObject(() => __awaiter(void 0, void 0, void 0, function* () { return (yield Promise.resolve().then(() => __importStar(require("..")))).JsonObject; })),
36
+ core.serialization.lazyObject(() => serializers.JsonObject),
45
37
  ]);
@@ -25,21 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  __setModuleDefault(result, mod);
26
26
  return result;
27
27
  };
28
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
28
  Object.defineProperty(exports, "__esModule", { value: true });
38
29
  exports.TestrecordCustomOutputsValue = void 0;
30
+ const serializers = __importStar(require("../index"));
39
31
  const core = __importStar(require("../../core"));
40
32
  const FileUrl_1 = require("./FileUrl");
41
33
  exports.TestrecordCustomOutputsValue = core.serialization.undiscriminatedUnion([
42
34
  core.serialization.string(),
43
35
  FileUrl_1.FileUrl,
44
- core.serialization.lazyObject(() => __awaiter(void 0, void 0, void 0, function* () { return (yield Promise.resolve().then(() => __importStar(require("..")))).JsonObject; })),
36
+ core.serialization.lazyObject(() => serializers.JsonObject),
45
37
  ]);
@@ -10,5 +10,6 @@ export declare namespace Trace {
10
10
  TraceId: string;
11
11
  Start: string;
12
12
  End: string;
13
+ Spans?: serializers.Span.Raw[] | null;
13
14
  }
14
15
  }
@@ -27,9 +27,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Trace = void 0;
30
+ const serializers = __importStar(require("../index"));
30
31
  const core = __importStar(require("../../core"));
31
32
  exports.Trace = core.serialization.object({
32
33
  traceId: core.serialization.property("TraceId", core.serialization.string()),
33
34
  start: core.serialization.property("Start", core.serialization.date()),
34
35
  end: core.serialization.property("End", core.serialization.date()),
36
+ spans: core.serialization.property("Spans", core.serialization.list(core.serialization.lazyObject(() => serializers.Span)).optional()),
35
37
  });
@@ -1,10 +1,10 @@
1
- export * from "./CreateRunParams";
2
1
  export * from "./CustomSchema";
3
2
  export * from "./CustomVariable";
4
3
  export * from "./DataTypeEnum";
5
4
  export * from "./FileUrl";
6
5
  export * from "./Grade";
7
6
  export * from "./HttpValidationError";
7
+ export * from "./IngestionMethod";
8
8
  export * from "./JsonObjectInputValue";
9
9
  export * from "./JsonObject";
10
10
  export * from "./JsonObjectOutputValue";
@@ -17,13 +17,12 @@ export * from "./Run";
17
17
  export * from "./RunMetric";
18
18
  export * from "./RunStatus";
19
19
  export * from "./ScoreStatus";
20
+ export * from "./ScoringConfig";
20
21
  export * from "./Span";
21
22
  export * from "./TestCaseCustomInputsValue";
22
23
  export * from "./TestCaseCustomLabelsValue";
23
24
  export * from "./TestCase";
24
- export * from "./TestCaseCreate";
25
- export * from "./TestRecordCreate";
26
- export * from "./TestSetCreate";
25
+ export * from "./TestcaseBatchDeletionResponse";
27
26
  export * from "./TestcaseDeletionResponse";
28
27
  export * from "./TestrecordCustomInputsValue";
29
28
  export * from "./TestrecordCustomLabelsValue";
@@ -38,3 +37,6 @@ export * from "./UnauthorizedErrorBody";
38
37
  export * from "./ValidationErrorLocItem";
39
38
  export * from "./ValidationError";
40
39
  export * from "./CreateGithubWorkflowParams";
40
+ export * from "./CreateRunParams";
41
+ export * from "./TestRecordCreate";
42
+ export * from "./TestSetCreate";
@@ -14,13 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./CreateRunParams"), exports);
18
17
  __exportStar(require("./CustomSchema"), exports);
19
18
  __exportStar(require("./CustomVariable"), exports);
20
19
  __exportStar(require("./DataTypeEnum"), exports);
21
20
  __exportStar(require("./FileUrl"), exports);
22
21
  __exportStar(require("./Grade"), exports);
23
22
  __exportStar(require("./HttpValidationError"), exports);
23
+ __exportStar(require("./IngestionMethod"), exports);
24
24
  __exportStar(require("./JsonObjectInputValue"), exports);
25
25
  __exportStar(require("./JsonObject"), exports);
26
26
  __exportStar(require("./JsonObjectOutputValue"), exports);
@@ -33,13 +33,12 @@ __exportStar(require("./Run"), exports);
33
33
  __exportStar(require("./RunMetric"), exports);
34
34
  __exportStar(require("./RunStatus"), exports);
35
35
  __exportStar(require("./ScoreStatus"), exports);
36
+ __exportStar(require("./ScoringConfig"), exports);
36
37
  __exportStar(require("./Span"), exports);
37
38
  __exportStar(require("./TestCaseCustomInputsValue"), exports);
38
39
  __exportStar(require("./TestCaseCustomLabelsValue"), exports);
39
40
  __exportStar(require("./TestCase"), exports);
40
- __exportStar(require("./TestCaseCreate"), exports);
41
- __exportStar(require("./TestRecordCreate"), exports);
42
- __exportStar(require("./TestSetCreate"), exports);
41
+ __exportStar(require("./TestcaseBatchDeletionResponse"), exports);
43
42
  __exportStar(require("./TestcaseDeletionResponse"), exports);
44
43
  __exportStar(require("./TestrecordCustomInputsValue"), exports);
45
44
  __exportStar(require("./TestrecordCustomLabelsValue"), exports);
@@ -54,3 +53,6 @@ __exportStar(require("./UnauthorizedErrorBody"), exports);
54
53
  __exportStar(require("./ValidationErrorLocItem"), exports);
55
54
  __exportStar(require("./ValidationError"), exports);
56
55
  __exportStar(require("./CreateGithubWorkflowParams"), exports);
56
+ __exportStar(require("./CreateRunParams"), exports);
57
+ __exportStar(require("./TestRecordCreate"), exports);
58
+ __exportStar(require("./TestSetCreate"), exports);
@@ -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/dist/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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scorecard-ai",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/scorecard-ai/scorecard-node",
6
6
  "license": "See LICENSE",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "url-join": "4.0.1",
17
- "form-data": "4.0.0",
17
+ "form-data": "^4.0.0",
18
18
  "formdata-node": "^6.0.3",
19
19
  "node-fetch": "2.7.0",
20
20
  "qs": "6.11.2"
@@ -24,6 +24,7 @@
24
24
  "@arizeai/openinference-instrumentation-openai": "^0.2.0",
25
25
  "@langchain/core": "^0.1.63",
26
26
  "@opentelemetry/api": "*",
27
+ "@opentelemetry/core": "*",
27
28
  "@opentelemetry/exporter-trace-otlp-http": "*",
28
29
  "@opentelemetry/instrumentation": ">=0.40.0",
29
30
  "@opentelemetry/resources": "*",
@@ -44,6 +45,9 @@
44
45
  "@opentelemetry/api": {
45
46
  "optional": false
46
47
  },
48
+ "@opentelemetry/core": {
49
+ "optional": false
50
+ },
47
51
  "@opentelemetry/exporter-trace-otlp-http": {
48
52
  "optional": false
49
53
  },
@@ -67,6 +71,7 @@
67
71
  "@types/url-join": "4.0.1",
68
72
  "@types/qs": "6.9.8",
69
73
  "@types/node-fetch": "2.6.9",
74
+ "fetch-mock-jest": "^1.5.1",
70
75
  "jest": "29.7.0",
71
76
  "@types/jest": "29.5.5",
72
77
  "ts-jest": "29.1.1",
@@ -78,11 +83,17 @@
78
83
  "@arizeai/openinference-instrumentation-openai": "^0.2.0",
79
84
  "@langchain/core": "^0.1.63",
80
85
  "@opentelemetry/api": "latest",
86
+ "@opentelemetry/core": "latest",
81
87
  "@opentelemetry/exporter-trace-otlp-http": "latest",
82
88
  "@opentelemetry/instrumentation": "latest",
83
89
  "@opentelemetry/resources": "latest",
84
90
  "@opentelemetry/sdk-trace-node": "latest",
85
91
  "@opentelemetry/semantic-conventions": "latest",
86
92
  "openai": "^4.47.1"
93
+ },
94
+ "browser": {
95
+ "fs": false,
96
+ "os": false,
97
+ "path": false
87
98
  }
88
99
  }