@nocobase/plugin-ai 1.9.33 → 1.9.35

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 (990) hide show
  1. package/dist/externalVersion.js +6 -6
  2. package/dist/node_modules/@langchain/core/dist/caches/base.cjs +28 -5
  3. package/dist/node_modules/@langchain/core/dist/caches/base.d.ts +13 -1
  4. package/dist/node_modules/@langchain/core/dist/caches/base.js +25 -2
  5. package/dist/node_modules/@langchain/core/dist/callbacks/base.cjs +19 -9
  6. package/dist/node_modules/@langchain/core/dist/callbacks/base.d.ts +37 -22
  7. package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/index.cjs +1 -2
  8. package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/web.cjs +1 -2
  9. package/dist/node_modules/@langchain/core/dist/callbacks/manager.cjs +15 -10
  10. package/dist/node_modules/@langchain/core/dist/callbacks/manager.d.ts +3 -3
  11. package/dist/node_modules/@langchain/core/dist/callbacks/manager.js +11 -6
  12. package/dist/node_modules/@langchain/core/dist/embeddings.d.ts +6 -6
  13. package/dist/node_modules/@langchain/core/dist/errors/index.cjs +1 -2
  14. package/dist/node_modules/@langchain/core/dist/example_selectors/conditional.cjs +3 -3
  15. package/dist/node_modules/@langchain/core/dist/index.cjs +3 -0
  16. package/dist/node_modules/@langchain/core/dist/index.d.ts +3 -0
  17. package/dist/node_modules/@langchain/core/dist/index.js +3 -0
  18. package/dist/node_modules/@langchain/core/dist/indexing/base.cjs +19 -7
  19. package/dist/node_modules/@langchain/core/dist/indexing/base.d.ts +3 -0
  20. package/dist/node_modules/@langchain/core/dist/indexing/base.js +14 -2
  21. package/dist/node_modules/@langchain/core/dist/language_models/base.cjs +31 -7
  22. package/dist/node_modules/@langchain/core/dist/language_models/base.d.ts +40 -9
  23. package/dist/node_modules/@langchain/core/dist/language_models/base.js +29 -5
  24. package/dist/node_modules/@langchain/core/dist/language_models/chat_models.cjs +37 -10
  25. package/dist/node_modules/@langchain/core/dist/language_models/chat_models.d.ts +9 -3
  26. package/dist/node_modules/@langchain/core/dist/language_models/chat_models.js +36 -9
  27. package/dist/node_modules/@langchain/core/dist/load/import_map.cjs +17 -7
  28. package/dist/node_modules/@langchain/core/dist/load/index.cjs +18 -9
  29. package/dist/node_modules/@langchain/core/dist/load/map_keys.cjs +3 -4
  30. package/dist/node_modules/@langchain/core/dist/load/serializable.cjs +2 -2
  31. package/dist/node_modules/@langchain/core/dist/memory.cjs +2 -2
  32. package/dist/node_modules/@langchain/core/dist/messages/ai.cjs +46 -12
  33. package/dist/node_modules/@langchain/core/dist/messages/ai.d.ts +26 -10
  34. package/dist/node_modules/@langchain/core/dist/messages/ai.js +43 -9
  35. package/dist/node_modules/@langchain/core/dist/messages/base.cjs +74 -20
  36. package/dist/node_modules/@langchain/core/dist/messages/base.d.ts +5 -6
  37. package/dist/node_modules/@langchain/core/dist/messages/base.js +64 -10
  38. package/dist/node_modules/@langchain/core/dist/messages/chat.cjs +3 -3
  39. package/dist/node_modules/@langchain/core/dist/messages/content_blocks.cjs +165 -0
  40. package/dist/node_modules/@langchain/core/dist/messages/content_blocks.d.ts +151 -0
  41. package/dist/node_modules/@langchain/core/dist/messages/content_blocks.js +154 -0
  42. package/dist/node_modules/@langchain/core/dist/messages/function.cjs +3 -3
  43. package/dist/node_modules/@langchain/core/dist/messages/human.cjs +13 -3
  44. package/dist/node_modules/@langchain/core/dist/messages/human.d.ts +13 -1
  45. package/dist/node_modules/@langchain/core/dist/messages/human.js +10 -0
  46. package/dist/node_modules/@langchain/core/dist/messages/index.cjs +1 -0
  47. package/dist/node_modules/@langchain/core/dist/messages/index.d.ts +1 -0
  48. package/dist/node_modules/@langchain/core/dist/messages/index.js +1 -0
  49. package/dist/node_modules/@langchain/core/dist/messages/system.cjs +13 -3
  50. package/dist/node_modules/@langchain/core/dist/messages/system.d.ts +13 -1
  51. package/dist/node_modules/@langchain/core/dist/messages/system.js +10 -0
  52. package/dist/node_modules/@langchain/core/dist/messages/tool.cjs +12 -5
  53. package/dist/node_modules/@langchain/core/dist/messages/tool.d.ts +13 -5
  54. package/dist/node_modules/@langchain/core/dist/messages/tool.js +7 -0
  55. package/dist/node_modules/@langchain/core/dist/messages/transformers.cjs +5 -6
  56. package/dist/node_modules/@langchain/core/dist/messages/transformers.js +1 -1
  57. package/dist/node_modules/@langchain/core/dist/messages/utils.cjs +10 -7
  58. package/dist/node_modules/@langchain/core/dist/messages/utils.js +4 -0
  59. package/dist/node_modules/@langchain/core/dist/output_parsers/json.cjs +7 -0
  60. package/dist/node_modules/@langchain/core/dist/output_parsers/json.d.ts +2 -0
  61. package/dist/node_modules/@langchain/core/dist/output_parsers/json.js +7 -0
  62. package/dist/node_modules/@langchain/core/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +1 -1
  63. package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs +7 -6
  64. package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +19 -5
  65. package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.js +3 -2
  66. package/dist/node_modules/@langchain/core/dist/output_parsers/string.cjs +1 -1
  67. package/dist/node_modules/@langchain/core/dist/output_parsers/string.d.ts +1 -1
  68. package/dist/node_modules/@langchain/core/dist/output_parsers/string.js +1 -1
  69. package/dist/node_modules/@langchain/core/dist/output_parsers/structured.cjs +17 -11
  70. package/dist/node_modules/@langchain/core/dist/output_parsers/structured.d.ts +10 -9
  71. package/dist/node_modules/@langchain/core/dist/output_parsers/structured.js +15 -9
  72. package/dist/node_modules/@langchain/core/dist/output_parsers/xml.cjs +2 -2
  73. package/dist/node_modules/@langchain/core/dist/prompts/base.cjs +36 -3
  74. package/dist/node_modules/@langchain/core/dist/prompts/chat.cjs +72 -24
  75. package/dist/node_modules/@langchain/core/dist/prompts/chat.d.ts +5 -4
  76. package/dist/node_modules/@langchain/core/dist/prompts/chat.js +72 -24
  77. package/dist/node_modules/@langchain/core/dist/prompts/dict.cjs +114 -0
  78. package/dist/node_modules/@langchain/core/dist/prompts/dict.d.ts +18 -0
  79. package/dist/node_modules/@langchain/core/dist/prompts/dict.js +110 -0
  80. package/dist/node_modules/@langchain/core/dist/prompts/index.cjs +1 -0
  81. package/dist/node_modules/@langchain/core/dist/prompts/index.d.ts +1 -0
  82. package/dist/node_modules/@langchain/core/dist/prompts/index.js +1 -0
  83. package/dist/node_modules/@langchain/core/dist/prompts/structured.cjs +16 -6
  84. package/dist/node_modules/@langchain/core/dist/prompts/structured.d.ts +3 -1
  85. package/dist/node_modules/@langchain/core/dist/prompts/structured.js +16 -6
  86. package/dist/node_modules/@langchain/core/dist/prompts/template.cjs +24 -13
  87. package/dist/node_modules/@langchain/core/dist/prompts/template.js +24 -13
  88. package/dist/node_modules/@langchain/core/dist/runnables/base.cjs +81 -38
  89. package/dist/node_modules/@langchain/core/dist/runnables/base.d.ts +44 -18
  90. package/dist/node_modules/@langchain/core/dist/runnables/base.js +74 -31
  91. package/dist/node_modules/@langchain/core/dist/runnables/config.cjs +6 -6
  92. package/dist/node_modules/@langchain/core/dist/runnables/graph.cjs +2 -2
  93. package/dist/node_modules/@langchain/core/dist/runnables/graph.js +2 -2
  94. package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.cjs +29 -6
  95. package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.d.ts +25 -1
  96. package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.js +26 -3
  97. package/dist/node_modules/@langchain/core/dist/runnables/iter.cjs +5 -5
  98. package/dist/node_modules/@langchain/core/dist/runnables/iter.d.ts +1 -1
  99. package/dist/node_modules/@langchain/core/dist/runnables/passthrough.cjs +1 -1
  100. package/dist/node_modules/@langchain/core/dist/runnables/passthrough.d.ts +1 -1
  101. package/dist/node_modules/@langchain/core/dist/runnables/passthrough.js +1 -1
  102. package/dist/node_modules/@langchain/core/dist/runnables/remote.cjs +2 -0
  103. package/dist/node_modules/@langchain/core/dist/runnables/remote.d.ts +2 -0
  104. package/dist/node_modules/@langchain/core/dist/runnables/remote.js +2 -0
  105. package/dist/node_modules/@langchain/core/dist/runnables/types.d.ts +2 -2
  106. package/dist/node_modules/@langchain/core/dist/runnables/utils.cjs +2 -2
  107. package/dist/node_modules/@langchain/core/dist/runnables/wrappers.cjs +1 -2
  108. package/dist/node_modules/@langchain/core/dist/runnables/wrappers.d.ts +1 -1
  109. package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/context.cjs +3 -3
  110. package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/index.cjs +1 -1
  111. package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/index.js +1 -1
  112. package/dist/node_modules/@langchain/core/dist/singletons/callbacks.cjs +10 -6
  113. package/dist/node_modules/@langchain/core/dist/singletons/callbacks.d.ts +1 -1
  114. package/dist/node_modules/@langchain/core/dist/singletons/callbacks.js +7 -2
  115. package/dist/node_modules/@langchain/core/dist/structured_query/utils.cjs +7 -8
  116. package/dist/node_modules/@langchain/core/dist/tools/index.cjs +99 -45
  117. package/dist/node_modules/@langchain/core/dist/tools/index.d.ts +51 -151
  118. package/dist/node_modules/@langchain/core/dist/tools/index.js +94 -44
  119. package/dist/node_modules/@langchain/core/dist/tools/types.cjs +64 -0
  120. package/dist/node_modules/@langchain/core/dist/tools/types.d.ts +272 -0
  121. package/dist/node_modules/@langchain/core/dist/tools/types.js +58 -0
  122. package/dist/node_modules/@langchain/core/dist/tools/utils.cjs +12 -2
  123. package/dist/node_modules/@langchain/core/dist/tools/utils.d.ts +5 -0
  124. package/dist/node_modules/@langchain/core/dist/tools/utils.js +9 -0
  125. package/dist/node_modules/@langchain/core/dist/tracers/base.cjs +96 -32
  126. package/dist/node_modules/@langchain/core/dist/tracers/base.d.ts +104 -84
  127. package/dist/node_modules/@langchain/core/dist/tracers/base.js +94 -30
  128. package/dist/node_modules/@langchain/core/dist/tracers/initialize.cjs +2 -3
  129. package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.cjs +39 -75
  130. package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.d.ts +6 -4
  131. package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.js +39 -75
  132. package/dist/node_modules/@langchain/core/dist/utils/async_caller.cjs +9 -9
  133. package/dist/node_modules/@langchain/core/dist/utils/async_caller.js +9 -9
  134. package/dist/node_modules/@langchain/core/dist/utils/env.cjs +11 -6
  135. package/dist/node_modules/@langchain/core/dist/utils/env.d.ts +4 -0
  136. package/dist/node_modules/@langchain/core/dist/utils/env.js +7 -3
  137. package/dist/node_modules/@langchain/core/dist/utils/event_source_parse.cjs +5 -5
  138. package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/index.cjs +17 -7
  139. package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/index.d.ts +4 -4
  140. package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.cjs +8 -8
  141. package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/duplex.cjs +4 -5
  142. package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.cjs +10 -10
  143. package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.d.ts +3 -3
  144. package/dist/node_modules/@langchain/core/dist/utils/function_calling.cjs +20 -72
  145. package/dist/node_modules/@langchain/core/dist/utils/function_calling.d.ts +8 -38
  146. package/dist/node_modules/@langchain/core/dist/utils/function_calling.js +12 -64
  147. package/dist/node_modules/@langchain/core/dist/utils/hash.cjs +3 -1
  148. package/dist/node_modules/@langchain/core/dist/utils/hash.d.ts +7 -0
  149. package/dist/node_modules/@langchain/core/dist/utils/hash.js +1 -0
  150. package/dist/node_modules/@langchain/core/dist/utils/js-sha1/hash.cjs +17 -0
  151. package/dist/node_modules/@langchain/core/dist/utils/js-sha1/hash.d.ts +4 -0
  152. package/dist/node_modules/@langchain/core/dist/utils/js-sha1/hash.js +17 -0
  153. package/dist/node_modules/@langchain/core/dist/utils/js-sha256/hash.cjs +448 -0
  154. package/dist/node_modules/@langchain/core/dist/utils/js-sha256/hash.d.ts +1 -0
  155. package/dist/node_modules/@langchain/core/dist/utils/js-sha256/hash.js +445 -0
  156. package/dist/node_modules/@langchain/core/dist/utils/json.cjs +19 -7
  157. package/dist/node_modules/@langchain/core/dist/utils/json.js +17 -4
  158. package/dist/node_modules/@langchain/core/dist/utils/json_schema.cjs +95 -3
  159. package/dist/node_modules/@langchain/core/dist/utils/json_schema.d.ts +18 -0
  160. package/dist/node_modules/@langchain/core/dist/utils/json_schema.js +90 -0
  161. package/dist/node_modules/@langchain/core/dist/utils/math.cjs +6 -7
  162. package/dist/node_modules/@langchain/core/dist/utils/ml-distance/distances.cjs +1 -2
  163. package/dist/node_modules/@langchain/core/dist/utils/ml-distance/similarities.cjs +1 -2
  164. package/dist/node_modules/@langchain/core/dist/utils/ml-distance-euclidean/euclidean.cjs +2 -3
  165. package/dist/node_modules/@langchain/core/dist/utils/sax-js/sax.cjs +35 -35
  166. package/dist/node_modules/@langchain/core/dist/utils/sax-js/sax.js +35 -35
  167. package/dist/node_modules/@langchain/core/dist/utils/signal.cjs +1 -2
  168. package/dist/node_modules/@langchain/core/dist/utils/stream.cjs +4 -4
  169. package/dist/node_modules/@langchain/core/dist/utils/testing/helpers.cjs +7 -0
  170. package/dist/node_modules/@langchain/core/dist/utils/testing/helpers.d.ts +3 -0
  171. package/dist/node_modules/@langchain/core/dist/utils/testing/helpers.js +3 -0
  172. package/dist/node_modules/@langchain/core/dist/utils/testing/index.cjs +109 -24
  173. package/dist/node_modules/@langchain/core/dist/utils/testing/index.d.ts +43 -16
  174. package/dist/node_modules/@langchain/core/dist/utils/testing/index.js +109 -24
  175. package/dist/node_modules/@langchain/core/dist/utils/tiktoken.cjs +2 -3
  176. package/dist/node_modules/@langchain/core/dist/utils/types/index.cjs +1 -1
  177. package/dist/node_modules/@langchain/core/dist/utils/types/index.d.ts +1 -1
  178. package/dist/node_modules/@langchain/core/dist/utils/types/index.js +1 -1
  179. package/dist/node_modules/@langchain/core/dist/utils/types/zod.cjs +619 -0
  180. package/dist/node_modules/@langchain/core/dist/utils/types/zod.d.ts +212 -0
  181. package/dist/node_modules/@langchain/core/dist/utils/types/zod.js +595 -0
  182. package/dist/node_modules/@langchain/core/index.cjs +1 -1
  183. package/dist/node_modules/@langchain/core/index.d.cts +3 -0
  184. package/dist/node_modules/@langchain/core/index.d.ts +3 -0
  185. package/dist/node_modules/@langchain/core/index.js +3 -0
  186. package/dist/node_modules/@langchain/core/node_modules/langsmith/README.md +1 -0
  187. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/anonymizer/index.cjs +1 -2
  188. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.cjs +1153 -542
  189. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.d.ts +157 -18
  190. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.js +1136 -535
  191. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_random_name.cjs +1 -2
  192. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_runner.cjs +6 -3
  193. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_runner.js +5 -2
  194. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.cjs +7 -3
  195. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.ts +1 -0
  196. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.js +6 -1
  197. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluator.cjs +8 -4
  198. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluator.js +6 -2
  199. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/langchain.cjs +1 -2
  200. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/constants.cjs +60 -0
  201. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/constants.d.ts +49 -0
  202. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/constants.js +57 -0
  203. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/exporter.cjs +222 -0
  204. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/exporter.d.ts +60 -0
  205. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/exporter.js +185 -0
  206. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/processor.cjs +90 -0
  207. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/processor.d.ts +13 -0
  208. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/processor.js +85 -0
  209. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/setup.cjs +93 -0
  210. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/setup.d.ts +64 -0
  211. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/setup.js +89 -0
  212. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/translator.cjs +447 -0
  213. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/translator.d.ts +22 -0
  214. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/translator.js +410 -0
  215. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/types.cjs +5 -0
  216. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/types.d.ts +29 -0
  217. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/types.js +4 -0
  218. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/utils.cjs +23 -0
  219. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/utils.d.ts +12 -0
  220. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/utils.js +19 -0
  221. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/index.cjs +439 -0
  222. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/index.d.ts +240 -0
  223. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/index.js +435 -0
  224. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/middleware.cjs +235 -0
  225. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/middleware.d.ts +27 -0
  226. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/middleware.js +232 -0
  227. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/utils.cjs +170 -0
  228. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/utils.d.ts +4 -0
  229. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/utils.js +165 -0
  230. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.cjs +4 -2
  231. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.d.ts +2 -1
  232. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.js +2 -1
  233. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.cjs +70 -3
  234. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.d.ts +182 -60
  235. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.js +70 -4
  236. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.cjs +6 -2
  237. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.d.ts +1 -0
  238. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.js +4 -0
  239. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.cjs +350 -63
  240. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.d.ts +35 -8
  241. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.js +324 -47
  242. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/schemas.d.ts +32 -5
  243. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.cjs +30 -4
  244. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.d.ts +2 -0
  245. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.js +27 -3
  246. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/otel.cjs +155 -0
  247. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/otel.d.ts +63 -0
  248. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/otel.js +147 -0
  249. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.cjs +8 -19
  250. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.d.ts +7 -5
  251. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.js +4 -15
  252. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.cjs +1 -0
  253. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.d.ts +4 -0
  254. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.js +1 -1
  255. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.cjs +250 -64
  256. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.d.ts +21 -18
  257. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.js +249 -63
  258. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.cjs +6 -27
  259. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.js +5 -2
  260. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/asserts.cjs +3 -3
  261. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/asserts.d.ts +3 -3
  262. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.cjs +16 -28
  263. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.d.ts +1 -1
  264. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.js +16 -28
  265. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/atee.cjs +1 -2
  266. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.cjs +48 -62
  267. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.d.ts +8 -18
  268. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.js +39 -53
  269. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.cjs +68 -10
  270. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.d.ts +7 -1
  271. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.js +63 -7
  272. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs +54 -6
  273. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.d.ts +1 -1
  274. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js +53 -4
  275. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/globals.cjs +3 -3
  276. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/globals.d.ts +2 -1
  277. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.cjs +170 -70
  278. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.d.ts +79 -67
  279. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.js +148 -58
  280. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/matchers.cjs +3 -4
  281. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/reporter.cjs +18 -9
  282. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/types.d.ts +19 -4
  283. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/chain.cjs +1 -2
  284. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/chain.d.ts +0 -1
  285. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/evaluatedBy.cjs +13 -7
  286. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/evaluatedBy.js +12 -5
  287. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/messages.cjs +2 -3
  288. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/project.cjs +10 -0
  289. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/project.d.ts +1 -0
  290. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/project.js +6 -0
  291. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/prompts.cjs +2 -3
  292. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/shuffle.cjs +1 -2
  293. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/vercel.cjs +155 -0
  294. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/vercel.d.ts +10 -0
  295. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/vercel.js +150 -0
  296. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/warn.cjs +1 -2
  297. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.cjs +277 -84
  298. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.d.ts +17 -5
  299. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.js +275 -83
  300. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.cjs +11 -9
  301. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.d.mts +392 -0
  302. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.d.ts +73 -116
  303. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.js +8 -7
  304. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.mjs +324 -0
  305. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.cjs +2 -17
  306. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.d.mts +5 -0
  307. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.js +2 -17
  308. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.mjs +12 -0
  309. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/esm.d.mts +8 -0
  310. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/esm.mjs +38 -0
  311. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/reporter.cjs +25 -0
  312. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/reporter.d.ts +1 -0
  313. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/reporter.js +21 -0
  314. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/wrapper.cjs +63 -0
  315. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/wrapper.d.ts +167 -0
  316. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/wrapper.js +59 -0
  317. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.cjs +162 -90
  318. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.d.ts +10 -11
  319. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.js +163 -91
  320. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.cjs +1 -0
  321. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.d.ts +1 -0
  322. package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.js +1 -0
  323. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/exporter.cjs +1 -0
  324. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/exporter.d.cts +1 -0
  325. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/exporter.d.ts +1 -0
  326. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/exporter.js +1 -0
  327. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/processor.cjs +1 -0
  328. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/processor.d.cts +1 -0
  329. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/processor.d.ts +1 -0
  330. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/processor.js +1 -0
  331. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/setup.cjs +1 -0
  332. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/setup.d.cts +1 -0
  333. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/setup.d.ts +1 -0
  334. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/setup.js +1 -0
  335. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/vercel.cjs +1 -0
  336. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/vercel.d.cts +1 -0
  337. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/vercel.d.ts +1 -0
  338. package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/vercel.js +1 -0
  339. package/dist/node_modules/@langchain/core/node_modules/langsmith/package.json +84 -14
  340. package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest/reporter.d.ts +1 -1
  341. package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest/reporter.js +1 -1
  342. package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest.d.ts +1 -1
  343. package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest.js +1 -1
  344. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/index.js +22 -0
  345. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/package.json +3 -0
  346. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/ZodError.js +137 -0
  347. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/datetime.js +54 -0
  348. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/discriminatedUnion.js +79 -0
  349. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/index.js +59 -0
  350. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/ipv4.js +54 -0
  351. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/object.js +70 -0
  352. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/primitives.js +159 -0
  353. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/realworld.js +56 -0
  354. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/string.js +55 -0
  355. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/union.js +79 -0
  356. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/errors.js +17 -0
  357. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/external.js +22 -0
  358. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/enumUtil.js +2 -0
  359. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/errorUtil.js +9 -0
  360. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/parseUtil.js +124 -0
  361. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/partialUtil.js +2 -0
  362. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/typeAliases.js +2 -0
  363. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/util.js +137 -0
  364. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/index.js +33 -0
  365. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/locales/en.js +109 -0
  366. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/standard-schema.js +2 -0
  367. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/tests/Mocker.js +57 -0
  368. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/types.js +3773 -0
  369. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/checks.js +32 -0
  370. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/coerce.js +47 -0
  371. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/compat.js +63 -0
  372. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/errors.js +67 -0
  373. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/external.js +69 -0
  374. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/index.js +33 -0
  375. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/iso.js +60 -0
  376. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/parse.js +32 -0
  377. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/schemas.js +1100 -0
  378. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/api.js +1021 -0
  379. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/checks.js +580 -0
  380. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/config.js +10 -0
  381. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/core.js +63 -0
  382. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/doc.js +39 -0
  383. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/errors.js +222 -0
  384. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/function.js +102 -0
  385. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/index.js +44 -0
  386. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/json-schema.js +2 -0
  387. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/parse.js +87 -0
  388. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/regexes.js +103 -0
  389. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/registries.js +47 -0
  390. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/schemas.js +1719 -0
  391. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/standard-schema.js +2 -0
  392. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/to-json-schema.js +833 -0
  393. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/util.js +537 -0
  394. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/versions.js +8 -0
  395. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/zsf.js +172 -0
  396. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/index.js +22 -0
  397. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ar.js +142 -0
  398. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/az.js +141 -0
  399. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/be.js +190 -0
  400. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ca.js +144 -0
  401. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/cs.js +161 -0
  402. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/de.js +142 -0
  403. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/en.js +145 -0
  404. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/es.js +143 -0
  405. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/fa.js +148 -0
  406. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/fi.js +148 -0
  407. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/fr-CA.js +143 -0
  408. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/fr.js +142 -0
  409. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/he.js +143 -0
  410. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/hu.js +143 -0
  411. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/id.js +142 -0
  412. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/index.js +82 -0
  413. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/it.js +143 -0
  414. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ja.js +141 -0
  415. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/kh.js +143 -0
  416. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ko.js +147 -0
  417. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/mk.js +144 -0
  418. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ms.js +142 -0
  419. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/nl.js +143 -0
  420. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/no.js +142 -0
  421. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ota.js +143 -0
  422. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/pl.js +143 -0
  423. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ps.js +148 -0
  424. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/pt.js +142 -0
  425. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ru.js +190 -0
  426. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/sl.js +143 -0
  427. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/sv.js +144 -0
  428. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ta.js +143 -0
  429. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/th.js +143 -0
  430. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/tr.js +143 -0
  431. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ua.js +143 -0
  432. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ur.js +143 -0
  433. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/vi.js +142 -0
  434. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/zh-CN.js +142 -0
  435. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/zh-TW.js +143 -0
  436. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/checks.js +34 -0
  437. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/coerce.js +47 -0
  438. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/external.js +61 -0
  439. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/index.js +32 -0
  440. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/iso.js +60 -0
  441. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/parse.js +8 -0
  442. package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/schemas.js +831 -0
  443. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/index.js +3 -0
  444. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/package.json +3 -0
  445. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/ZodError.js +132 -0
  446. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/datetime.js +49 -0
  447. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/discriminatedUnion.js +74 -0
  448. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/index.js +54 -0
  449. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/ipv4.js +49 -0
  450. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/object.js +65 -0
  451. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/primitives.js +154 -0
  452. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/realworld.js +51 -0
  453. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/string.js +50 -0
  454. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/union.js +74 -0
  455. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/errors.js +9 -0
  456. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/external.js +6 -0
  457. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/enumUtil.js +1 -0
  458. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/errorUtil.js +6 -0
  459. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/parseUtil.js +109 -0
  460. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/partialUtil.js +1 -0
  461. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/typeAliases.js +1 -0
  462. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/util.js +133 -0
  463. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/index.js +4 -0
  464. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/locales/en.js +107 -0
  465. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/standard-schema.js +1 -0
  466. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/tests/Mocker.js +53 -0
  467. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/types.js +3691 -0
  468. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/checks.js +1 -0
  469. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/coerce.js +17 -0
  470. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/compat.js +33 -0
  471. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/errors.js +41 -0
  472. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/external.js +18 -0
  473. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/index.js +4 -0
  474. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/iso.js +30 -0
  475. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/parse.js +6 -0
  476. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/schemas.js +998 -0
  477. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/api.js +889 -0
  478. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/checks.js +554 -0
  479. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/config.js +6 -0
  480. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/core.js +57 -0
  481. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/doc.js +35 -0
  482. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/errors.js +191 -0
  483. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/function.js +75 -0
  484. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/index.js +15 -0
  485. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/json-schema.js +1 -0
  486. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/parse.js +57 -0
  487. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/regexes.js +95 -0
  488. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/registries.js +42 -0
  489. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/schemas.js +1688 -0
  490. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/standard-schema.js +1 -0
  491. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/to-json-schema.js +828 -0
  492. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/util.js +491 -0
  493. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/versions.js +5 -0
  494. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/zsf.js +171 -0
  495. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/index.js +3 -0
  496. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ar.js +116 -0
  497. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/az.js +115 -0
  498. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/be.js +164 -0
  499. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ca.js +118 -0
  500. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/cs.js +135 -0
  501. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/de.js +116 -0
  502. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/en.js +117 -0
  503. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/es.js +117 -0
  504. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/fa.js +122 -0
  505. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/fi.js +122 -0
  506. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/fr-CA.js +117 -0
  507. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/fr.js +116 -0
  508. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/he.js +117 -0
  509. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/hu.js +117 -0
  510. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/id.js +116 -0
  511. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/index.js +38 -0
  512. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/it.js +117 -0
  513. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ja.js +115 -0
  514. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/kh.js +117 -0
  515. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ko.js +121 -0
  516. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/mk.js +118 -0
  517. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ms.js +116 -0
  518. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/nl.js +117 -0
  519. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/no.js +116 -0
  520. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ota.js +117 -0
  521. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/pl.js +117 -0
  522. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ps.js +122 -0
  523. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/pt.js +116 -0
  524. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ru.js +164 -0
  525. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/sl.js +117 -0
  526. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/sv.js +118 -0
  527. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ta.js +117 -0
  528. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/th.js +117 -0
  529. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/tr.js +115 -0
  530. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ua.js +117 -0
  531. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ur.js +117 -0
  532. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/vi.js +116 -0
  533. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/zh-CN.js +116 -0
  534. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/zh-TW.js +117 -0
  535. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/checks.js +1 -0
  536. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/coerce.js +17 -0
  537. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/external.js +13 -0
  538. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/index.js +3 -0
  539. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/iso.js +30 -0
  540. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/parse.js +1 -0
  541. package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/schemas.js +725 -0
  542. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/index.d.ts +3 -0
  543. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/package.json +3 -0
  544. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/ZodError.d.ts +164 -0
  545. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/datetime.d.ts +5 -0
  546. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/discriminatedUnion.d.ts +5 -0
  547. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/index.d.ts +1 -0
  548. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/ipv4.d.ts +5 -0
  549. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/object.d.ts +5 -0
  550. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/primitives.d.ts +5 -0
  551. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/realworld.d.ts +5 -0
  552. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/string.d.ts +5 -0
  553. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/union.d.ts +5 -0
  554. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/errors.d.ts +5 -0
  555. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/external.d.ts +6 -0
  556. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/enumUtil.d.ts +8 -0
  557. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/errorUtil.d.ts +9 -0
  558. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/parseUtil.d.ts +78 -0
  559. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/partialUtil.d.ts +8 -0
  560. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/typeAliases.d.ts +2 -0
  561. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/util.d.ts +85 -0
  562. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/index.d.ts +4 -0
  563. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/locales/en.d.ts +3 -0
  564. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/standard-schema.d.ts +102 -0
  565. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/tests/Mocker.d.ts +17 -0
  566. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/types.d.ts +1031 -0
  567. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/checks.d.ts +1 -0
  568. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/coerce.d.ts +17 -0
  569. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/compat.d.ts +48 -0
  570. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/errors.d.ts +30 -0
  571. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/external.d.ts +13 -0
  572. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/index.d.ts +4 -0
  573. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/iso.d.ts +22 -0
  574. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/parse.d.ts +23 -0
  575. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/schemas.d.ts +624 -0
  576. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/api.d.ts +281 -0
  577. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/checks.d.ts +277 -0
  578. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/config.d.ts +9 -0
  579. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/core.d.ts +47 -0
  580. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/doc.d.ts +14 -0
  581. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/errors.d.ts +204 -0
  582. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/function.d.ts +52 -0
  583. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/index.d.ts +15 -0
  584. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/json-schema.d.ts +87 -0
  585. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/parse.d.ts +25 -0
  586. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/regexes.d.ts +62 -0
  587. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/registries.d.ts +39 -0
  588. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/schemas.d.ts +1005 -0
  589. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/standard-schema.d.ts +55 -0
  590. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/to-json-schema.d.ts +84 -0
  591. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/util.d.ts +183 -0
  592. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/versions.d.ts +5 -0
  593. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/zsf.d.ts +91 -0
  594. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/index.d.ts +3 -0
  595. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ar.d.ts +4 -0
  596. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/az.d.ts +4 -0
  597. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/be.d.ts +4 -0
  598. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ca.d.ts +4 -0
  599. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/cs.d.ts +4 -0
  600. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/de.d.ts +4 -0
  601. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/en.d.ts +5 -0
  602. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/es.d.ts +4 -0
  603. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/fa.d.ts +4 -0
  604. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/fi.d.ts +4 -0
  605. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/fr-CA.d.ts +4 -0
  606. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/fr.d.ts +4 -0
  607. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/he.d.ts +4 -0
  608. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/hu.d.ts +4 -0
  609. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/id.d.ts +4 -0
  610. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/index.d.ts +38 -0
  611. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/it.d.ts +4 -0
  612. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ja.d.ts +4 -0
  613. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/kh.d.ts +4 -0
  614. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ko.d.ts +4 -0
  615. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/mk.d.ts +4 -0
  616. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ms.d.ts +4 -0
  617. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/nl.d.ts +4 -0
  618. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/no.d.ts +4 -0
  619. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ota.d.ts +4 -0
  620. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/pl.d.ts +4 -0
  621. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ps.d.ts +4 -0
  622. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/pt.d.ts +4 -0
  623. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ru.d.ts +4 -0
  624. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/sl.d.ts +4 -0
  625. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/sv.d.ts +4 -0
  626. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ta.d.ts +4 -0
  627. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/th.d.ts +4 -0
  628. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/tr.d.ts +5 -0
  629. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ua.d.ts +4 -0
  630. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ur.d.ts +4 -0
  631. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/vi.d.ts +4 -0
  632. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/zh-CN.d.ts +4 -0
  633. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/zh-TW.d.ts +4 -0
  634. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/checks.d.ts +1 -0
  635. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/coerce.d.ts +7 -0
  636. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/external.d.ts +11 -0
  637. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/index.d.ts +3 -0
  638. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/iso.d.ts +22 -0
  639. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/parse.d.ts +1 -0
  640. package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/schemas.d.ts +351 -0
  641. package/dist/node_modules/@langchain/core/node_modules/zod/v3/index.d.ts +3 -0
  642. package/dist/node_modules/@langchain/core/node_modules/zod/v3/index.js +1 -0
  643. package/dist/node_modules/@langchain/core/node_modules/zod/v4/core/index.d.ts +1 -0
  644. package/dist/node_modules/@langchain/core/node_modules/zod/v4/core/index.js +1 -0
  645. package/dist/node_modules/@langchain/core/node_modules/zod/v4/index.d.ts +3 -0
  646. package/dist/node_modules/@langchain/core/node_modules/zod/v4/index.js +1 -0
  647. package/dist/node_modules/@langchain/core/node_modules/zod/v4/locales/en.d.ts +2 -0
  648. package/dist/node_modules/@langchain/core/node_modules/zod/v4/locales/en.js +2 -0
  649. package/dist/node_modules/@langchain/core/node_modules/zod/v4/locales/index.d.ts +1 -0
  650. package/dist/node_modules/@langchain/core/node_modules/zod/v4/locales/index.js +1 -0
  651. package/dist/node_modules/@langchain/core/node_modules/zod/v4-mini/index.d.ts +1 -0
  652. package/dist/node_modules/@langchain/core/node_modules/zod/v4-mini/index.js +1 -0
  653. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/LICENSE +21 -0
  654. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/README.md +208 -0
  655. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/index.js +22 -0
  656. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/package.json +3 -0
  657. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/ZodError.js +137 -0
  658. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/datetime.js +54 -0
  659. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/discriminatedUnion.js +79 -0
  660. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/index.js +59 -0
  661. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/ipv4.js +54 -0
  662. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/object.js +70 -0
  663. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/primitives.js +159 -0
  664. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/realworld.js +56 -0
  665. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/string.js +55 -0
  666. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/union.js +79 -0
  667. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/errors.js +17 -0
  668. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/external.js +22 -0
  669. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/enumUtil.js +2 -0
  670. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/errorUtil.js +9 -0
  671. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/parseUtil.js +124 -0
  672. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/partialUtil.js +2 -0
  673. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/typeAliases.js +2 -0
  674. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/util.js +137 -0
  675. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/index.js +33 -0
  676. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/locales/en.js +109 -0
  677. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/standard-schema.js +2 -0
  678. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/tests/Mocker.js +57 -0
  679. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/types.js +3773 -0
  680. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/checks.js +32 -0
  681. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/coerce.js +47 -0
  682. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/compat.js +63 -0
  683. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/errors.js +67 -0
  684. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/external.js +69 -0
  685. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/index.js +33 -0
  686. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/iso.js +60 -0
  687. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/parse.js +32 -0
  688. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/schemas.js +1100 -0
  689. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/api.js +1021 -0
  690. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/checks.js +580 -0
  691. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/config.js +10 -0
  692. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/core.js +63 -0
  693. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/doc.js +39 -0
  694. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/errors.js +222 -0
  695. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/function.js +102 -0
  696. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/index.js +44 -0
  697. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/json-schema.js +2 -0
  698. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/parse.js +87 -0
  699. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/regexes.js +103 -0
  700. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/registries.js +47 -0
  701. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/schemas.js +1719 -0
  702. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/standard-schema.js +2 -0
  703. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/to-json-schema.js +833 -0
  704. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/util.js +537 -0
  705. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/versions.js +8 -0
  706. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/zsf.js +172 -0
  707. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/index.js +22 -0
  708. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ar.js +142 -0
  709. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/az.js +141 -0
  710. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/be.js +190 -0
  711. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ca.js +144 -0
  712. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/cs.js +161 -0
  713. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/de.js +142 -0
  714. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/en.js +145 -0
  715. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/es.js +143 -0
  716. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/fa.js +148 -0
  717. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/fi.js +148 -0
  718. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/fr-CA.js +143 -0
  719. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/fr.js +142 -0
  720. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/he.js +143 -0
  721. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/hu.js +143 -0
  722. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/id.js +142 -0
  723. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/index.js +82 -0
  724. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/it.js +143 -0
  725. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ja.js +141 -0
  726. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/kh.js +143 -0
  727. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ko.js +147 -0
  728. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/mk.js +144 -0
  729. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ms.js +142 -0
  730. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/nl.js +143 -0
  731. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/no.js +142 -0
  732. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ota.js +143 -0
  733. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/pl.js +143 -0
  734. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ps.js +148 -0
  735. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/pt.js +142 -0
  736. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ru.js +190 -0
  737. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/sl.js +143 -0
  738. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/sv.js +144 -0
  739. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ta.js +143 -0
  740. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/th.js +143 -0
  741. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/tr.js +143 -0
  742. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ua.js +143 -0
  743. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ur.js +143 -0
  744. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/vi.js +142 -0
  745. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/zh-CN.js +142 -0
  746. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/zh-TW.js +143 -0
  747. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/checks.js +34 -0
  748. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/coerce.js +47 -0
  749. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/external.js +61 -0
  750. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/index.js +32 -0
  751. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/iso.js +60 -0
  752. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/parse.js +8 -0
  753. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/schemas.js +831 -0
  754. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/index.js +3 -0
  755. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/package.json +3 -0
  756. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/ZodError.js +132 -0
  757. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/datetime.js +49 -0
  758. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/discriminatedUnion.js +74 -0
  759. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/index.js +54 -0
  760. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/ipv4.js +49 -0
  761. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/object.js +65 -0
  762. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/primitives.js +154 -0
  763. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/realworld.js +51 -0
  764. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/string.js +50 -0
  765. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/union.js +74 -0
  766. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/errors.js +9 -0
  767. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/external.js +6 -0
  768. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/enumUtil.js +1 -0
  769. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/errorUtil.js +6 -0
  770. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/parseUtil.js +109 -0
  771. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/partialUtil.js +1 -0
  772. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/typeAliases.js +1 -0
  773. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/util.js +133 -0
  774. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/index.js +4 -0
  775. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/locales/en.js +107 -0
  776. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/standard-schema.js +1 -0
  777. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/tests/Mocker.js +53 -0
  778. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/types.js +3691 -0
  779. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/checks.js +1 -0
  780. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/coerce.js +17 -0
  781. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/compat.js +33 -0
  782. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/errors.js +41 -0
  783. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/external.js +18 -0
  784. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/index.js +4 -0
  785. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/iso.js +30 -0
  786. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/parse.js +6 -0
  787. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/schemas.js +998 -0
  788. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/api.js +889 -0
  789. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/checks.js +554 -0
  790. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/config.js +6 -0
  791. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/core.js +57 -0
  792. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/doc.js +35 -0
  793. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/errors.js +191 -0
  794. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/function.js +75 -0
  795. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/index.js +15 -0
  796. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/json-schema.js +1 -0
  797. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/parse.js +57 -0
  798. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/regexes.js +95 -0
  799. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/registries.js +42 -0
  800. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/schemas.js +1688 -0
  801. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/standard-schema.js +1 -0
  802. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/to-json-schema.js +828 -0
  803. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/util.js +491 -0
  804. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/versions.js +5 -0
  805. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/zsf.js +171 -0
  806. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/index.js +3 -0
  807. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ar.js +116 -0
  808. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/az.js +115 -0
  809. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/be.js +164 -0
  810. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ca.js +118 -0
  811. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/cs.js +135 -0
  812. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/de.js +116 -0
  813. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/en.js +117 -0
  814. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/es.js +117 -0
  815. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/fa.js +122 -0
  816. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/fi.js +122 -0
  817. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/fr-CA.js +117 -0
  818. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/fr.js +116 -0
  819. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/he.js +117 -0
  820. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/hu.js +117 -0
  821. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/id.js +116 -0
  822. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/index.js +38 -0
  823. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/it.js +117 -0
  824. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ja.js +115 -0
  825. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/kh.js +117 -0
  826. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ko.js +121 -0
  827. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/mk.js +118 -0
  828. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ms.js +116 -0
  829. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/nl.js +117 -0
  830. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/no.js +116 -0
  831. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ota.js +117 -0
  832. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/pl.js +117 -0
  833. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ps.js +122 -0
  834. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/pt.js +116 -0
  835. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ru.js +164 -0
  836. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/sl.js +117 -0
  837. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/sv.js +118 -0
  838. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ta.js +117 -0
  839. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/th.js +117 -0
  840. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/tr.js +115 -0
  841. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ua.js +117 -0
  842. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ur.js +117 -0
  843. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/vi.js +116 -0
  844. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/zh-CN.js +116 -0
  845. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/zh-TW.js +117 -0
  846. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/checks.js +1 -0
  847. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/coerce.js +17 -0
  848. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/external.js +13 -0
  849. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/index.js +3 -0
  850. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/iso.js +30 -0
  851. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/parse.js +1 -0
  852. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/schemas.js +725 -0
  853. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/index.d.ts +3 -0
  854. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/package.json +3 -0
  855. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/ZodError.d.ts +164 -0
  856. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/datetime.d.ts +5 -0
  857. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/discriminatedUnion.d.ts +5 -0
  858. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/index.d.ts +1 -0
  859. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/ipv4.d.ts +5 -0
  860. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/object.d.ts +5 -0
  861. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/primitives.d.ts +5 -0
  862. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/realworld.d.ts +5 -0
  863. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/string.d.ts +5 -0
  864. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/union.d.ts +5 -0
  865. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/errors.d.ts +5 -0
  866. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/external.d.ts +6 -0
  867. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/enumUtil.d.ts +8 -0
  868. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/errorUtil.d.ts +9 -0
  869. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/parseUtil.d.ts +78 -0
  870. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/partialUtil.d.ts +8 -0
  871. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/typeAliases.d.ts +2 -0
  872. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/util.d.ts +85 -0
  873. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/index.d.ts +4 -0
  874. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/locales/en.d.ts +3 -0
  875. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/standard-schema.d.ts +102 -0
  876. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/tests/Mocker.d.ts +17 -0
  877. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/types.d.ts +1031 -0
  878. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/checks.d.ts +1 -0
  879. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/coerce.d.ts +17 -0
  880. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/compat.d.ts +48 -0
  881. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/errors.d.ts +30 -0
  882. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/external.d.ts +13 -0
  883. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/index.d.ts +4 -0
  884. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/iso.d.ts +22 -0
  885. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/parse.d.ts +23 -0
  886. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/schemas.d.ts +624 -0
  887. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/api.d.ts +281 -0
  888. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/checks.d.ts +277 -0
  889. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/config.d.ts +9 -0
  890. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/core.d.ts +47 -0
  891. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/doc.d.ts +14 -0
  892. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/errors.d.ts +204 -0
  893. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/function.d.ts +52 -0
  894. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/index.d.ts +15 -0
  895. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/json-schema.d.ts +87 -0
  896. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/parse.d.ts +25 -0
  897. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/regexes.d.ts +62 -0
  898. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/registries.d.ts +39 -0
  899. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/schemas.d.ts +1005 -0
  900. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/standard-schema.d.ts +55 -0
  901. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/to-json-schema.d.ts +84 -0
  902. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/util.d.ts +183 -0
  903. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/versions.d.ts +5 -0
  904. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/zsf.d.ts +91 -0
  905. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/index.d.ts +3 -0
  906. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ar.d.ts +4 -0
  907. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/az.d.ts +4 -0
  908. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/be.d.ts +4 -0
  909. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ca.d.ts +4 -0
  910. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/cs.d.ts +4 -0
  911. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/de.d.ts +4 -0
  912. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/en.d.ts +5 -0
  913. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/es.d.ts +4 -0
  914. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/fa.d.ts +4 -0
  915. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/fi.d.ts +4 -0
  916. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/fr-CA.d.ts +4 -0
  917. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/fr.d.ts +4 -0
  918. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/he.d.ts +4 -0
  919. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/hu.d.ts +4 -0
  920. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/id.d.ts +4 -0
  921. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/index.d.ts +38 -0
  922. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/it.d.ts +4 -0
  923. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ja.d.ts +4 -0
  924. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/kh.d.ts +4 -0
  925. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ko.d.ts +4 -0
  926. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/mk.d.ts +4 -0
  927. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ms.d.ts +4 -0
  928. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/nl.d.ts +4 -0
  929. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/no.d.ts +4 -0
  930. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ota.d.ts +4 -0
  931. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/pl.d.ts +4 -0
  932. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ps.d.ts +4 -0
  933. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/pt.d.ts +4 -0
  934. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ru.d.ts +4 -0
  935. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/sl.d.ts +4 -0
  936. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/sv.d.ts +4 -0
  937. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ta.d.ts +4 -0
  938. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/th.d.ts +4 -0
  939. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/tr.d.ts +5 -0
  940. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ua.d.ts +4 -0
  941. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ur.d.ts +4 -0
  942. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/vi.d.ts +4 -0
  943. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/zh-CN.d.ts +4 -0
  944. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/zh-TW.d.ts +4 -0
  945. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/checks.d.ts +1 -0
  946. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/coerce.d.ts +7 -0
  947. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/external.d.ts +11 -0
  948. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/index.d.ts +3 -0
  949. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/iso.d.ts +22 -0
  950. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/parse.d.ts +1 -0
  951. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/schemas.d.ts +351 -0
  952. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/package.json +120 -0
  953. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v3/index.d.ts +3 -0
  954. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v3/index.js +1 -0
  955. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/core/index.d.ts +1 -0
  956. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/core/index.js +1 -0
  957. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/index.d.ts +3 -0
  958. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/index.js +1 -0
  959. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/locales/en.d.ts +2 -0
  960. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/locales/en.js +2 -0
  961. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/locales/index.d.ts +1 -0
  962. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/locales/index.js +1 -0
  963. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4-mini/index.d.ts +1 -0
  964. package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4-mini/index.js +1 -0
  965. package/dist/node_modules/@langchain/core/package.json +1 -1
  966. package/dist/node_modules/@langchain/core/utils/hash/insecure.cjs +1 -0
  967. package/dist/node_modules/@langchain/core/utils/hash/insecure.d.cts +1 -0
  968. package/dist/node_modules/@langchain/core/utils/hash/insecure.d.ts +1 -0
  969. package/dist/node_modules/@langchain/core/utils/hash/insecure.js +1 -0
  970. package/dist/node_modules/@langchain/core/utils/hash/sha256.cjs +1 -0
  971. package/dist/node_modules/@langchain/core/utils/hash/sha256.d.cts +1 -0
  972. package/dist/node_modules/@langchain/core/utils/hash/sha256.d.ts +1 -0
  973. package/dist/node_modules/@langchain/core/utils/hash/sha256.js +1 -0
  974. package/dist/node_modules/@langchain/deepseek/index.cjs +18 -10
  975. package/dist/node_modules/@langchain/deepseek/package.json +1 -1
  976. package/dist/node_modules/@langchain/openai/dist/chat_models.cjs +527 -11
  977. package/dist/node_modules/@langchain/openai/dist/chat_models.d.ts +46 -5
  978. package/dist/node_modules/@langchain/openai/dist/chat_models.js +528 -12
  979. package/dist/node_modules/@langchain/openai/dist/llms.cjs +1 -1
  980. package/dist/node_modules/@langchain/openai/dist/llms.js +1 -1
  981. package/dist/node_modules/@langchain/openai/dist/types.d.ts +1 -1
  982. package/dist/node_modules/@langchain/openai/index.cjs +18 -10
  983. package/dist/node_modules/@langchain/openai/package.json +1 -1
  984. package/package.json +2 -2
  985. package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.cjs +0 -16
  986. package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.d.ts +0 -8
  987. package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.js +0 -12
  988. /package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/{vercel.types.cjs → utils/vercel.types.cjs} +0 -0
  989. /package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/{vercel.types.d.ts → utils/vercel.types.d.ts} +0 -0
  990. /package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/{vercel.types.js → utils/vercel.types.js} +0 -0
@@ -15,16 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Client = exports.DEFAULT_BATCH_SIZE_LIMIT_BYTES = exports.AutoBatchQueue = exports.mergeRuntimeEnvIntoRunCreate = void 0;
36
+ exports.Client = exports.DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES = exports.AutoBatchQueue = void 0;
37
+ exports.mergeRuntimeEnvIntoRun = mergeRuntimeEnvIntoRun;
27
38
  const uuid = __importStar(require("uuid"));
39
+ const translator_js_1 = require("./experimental/otel/translator.cjs");
40
+ const otel_js_1 = require("./singletons/otel.cjs");
28
41
  const async_caller_js_1 = require("./utils/async_caller.cjs");
29
42
  const messages_js_1 = require("./utils/messages.cjs");
30
43
  const env_js_1 = require("./utils/env.cjs");
@@ -35,9 +48,9 @@ const prompts_js_1 = require("./utils/prompts.cjs");
35
48
  const error_js_1 = require("./utils/error.cjs");
36
49
  const fetch_js_1 = require("./singletons/fetch.cjs");
37
50
  const index_js_2 = require("./utils/fast-safe-stringify/index.cjs");
38
- function mergeRuntimeEnvIntoRunCreate(run) {
51
+ function mergeRuntimeEnvIntoRun(run, cachedEnvVars) {
39
52
  const runtimeEnv = (0, env_js_1.getRuntimeEnvironment)();
40
- const envVars = (0, env_js_1.getLangChainEnvVarsMetadata)();
53
+ const envVars = cachedEnvVars ?? (0, env_js_1.getLangSmithEnvVarsMetadata)();
41
54
  const extra = run.extra ?? {};
42
55
  const metadata = extra.metadata;
43
56
  run.extra = {
@@ -48,17 +61,20 @@ function mergeRuntimeEnvIntoRunCreate(run) {
48
61
  },
49
62
  metadata: {
50
63
  ...envVars,
51
- ...(envVars.revision_id || run.revision_id
52
- ? { revision_id: run.revision_id ?? envVars.revision_id }
64
+ ...(envVars.revision_id || ("revision_id" in run && run.revision_id)
65
+ ? {
66
+ revision_id: ("revision_id" in run ? run.revision_id : undefined) ??
67
+ envVars.revision_id,
68
+ }
53
69
  : {}),
54
70
  ...metadata,
55
71
  },
56
72
  };
57
73
  return run;
58
74
  }
59
- exports.mergeRuntimeEnvIntoRunCreate = mergeRuntimeEnvIntoRunCreate;
60
- const getTracingSamplingRate = () => {
61
- const samplingRateStr = (0, env_js_1.getLangSmithEnvironmentVariable)("TRACING_SAMPLING_RATE");
75
+ const getTracingSamplingRate = (configRate) => {
76
+ const samplingRateStr = configRate?.toString() ??
77
+ (0, env_js_1.getLangSmithEnvironmentVariable)("TRACING_SAMPLING_RATE");
62
78
  if (samplingRateStr === undefined) {
63
79
  return undefined;
64
80
  }
@@ -92,7 +108,7 @@ function trimQuotes(str) {
92
108
  }
93
109
  const handle429 = async (response) => {
94
110
  if (response?.status === 429) {
95
- const retryAfter = parseInt(response.headers.get("retry-after") ?? "30", 10) * 1000;
111
+ const retryAfter = parseInt(response.headers.get("retry-after") ?? "10", 10) * 1000;
96
112
  if (retryAfter > 0) {
97
113
  await new Promise((resolve) => setTimeout(resolve, retryAfter));
98
114
  // Return directly after calling this check
@@ -102,6 +118,13 @@ const handle429 = async (response) => {
102
118
  // Fall back to existing status checks
103
119
  return false;
104
120
  };
121
+ function _formatFeedbackScore(score) {
122
+ if (typeof score === "number") {
123
+ // Truncate at 4 decimal places
124
+ return Number(score.toFixed(4));
125
+ }
126
+ return score;
127
+ }
105
128
  class AutoBatchQueue {
106
129
  constructor() {
107
130
  Object.defineProperty(this, "items", {
@@ -127,10 +150,13 @@ class AutoBatchQueue {
127
150
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise
128
151
  itemPromiseResolve = resolve;
129
152
  });
130
- const size = (0, index_js_2.serialize)(item.item).length;
153
+ const size = (0, index_js_2.serialize)(item.item, `Serializing run with id: ${item.item.id}`).length;
131
154
  this.items.push({
132
155
  action: item.action,
133
156
  payload: item.item,
157
+ otelContext: item.otelContext,
158
+ apiKey: item.apiKey,
159
+ apiUrl: item.apiUrl,
134
160
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
135
161
  itemPromiseResolve: itemPromiseResolve,
136
162
  itemPromise,
@@ -139,7 +165,7 @@ class AutoBatchQueue {
139
165
  this.sizeBytes += size;
140
166
  return itemPromise;
141
167
  }
142
- pop(upToSizeBytes) {
168
+ pop({ upToSizeBytes, upToSize, }) {
143
169
  if (upToSizeBytes < 1) {
144
170
  throw new Error("Number of bytes to pop off may not be less than 1.");
145
171
  }
@@ -147,7 +173,8 @@ class AutoBatchQueue {
147
173
  let poppedSizeBytes = 0;
148
174
  // Pop items until we reach or exceed the size limit
149
175
  while (poppedSizeBytes + (this.peek()?.size ?? 0) < upToSizeBytes &&
150
- this.items.length > 0) {
176
+ this.items.length > 0 &&
177
+ popped.length < upToSize) {
151
178
  const item = this.items.shift();
152
179
  if (item) {
153
180
  popped.push(item);
@@ -164,16 +191,27 @@ class AutoBatchQueue {
164
191
  this.sizeBytes -= item.size;
165
192
  }
166
193
  return [
167
- popped.map((it) => ({ action: it.action, item: it.payload })),
194
+ popped.map((it) => ({
195
+ action: it.action,
196
+ item: it.payload,
197
+ otelContext: it.otelContext,
198
+ apiKey: it.apiKey,
199
+ apiUrl: it.apiUrl,
200
+ })),
168
201
  () => popped.forEach((it) => it.itemPromiseResolve()),
169
202
  ];
170
203
  }
171
204
  }
172
205
  exports.AutoBatchQueue = AutoBatchQueue;
173
- // 20 MB
174
- exports.DEFAULT_BATCH_SIZE_LIMIT_BYTES = 20_971_520;
175
- const SERVER_INFO_REQUEST_TIMEOUT = 2500;
206
+ exports.DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES = 24 * 1024 * 1024;
207
+ const SERVER_INFO_REQUEST_TIMEOUT_MS = 10000;
208
+ /** Maximum number of operations to batch in a single request. */
209
+ const DEFAULT_BATCH_SIZE_LIMIT = 100;
210
+ const DEFAULT_API_URL = "https://api.smith.langchain.com";
176
211
  class Client {
212
+ get _fetch() {
213
+ return this.fetchImplementation || (0, fetch_js_1._getFetchImplementation)(this.debug);
214
+ }
177
215
  constructor(config = {}) {
178
216
  Object.defineProperty(this, "apiKey", {
179
217
  enumerable: true,
@@ -193,6 +231,12 @@ class Client {
193
231
  writable: true,
194
232
  value: void 0
195
233
  });
234
+ Object.defineProperty(this, "workspaceId", {
235
+ enumerable: true,
236
+ configurable: true,
237
+ writable: true,
238
+ value: void 0
239
+ });
196
240
  Object.defineProperty(this, "caller", {
197
241
  enumerable: true,
198
242
  configurable: true,
@@ -271,6 +315,12 @@ class Client {
271
315
  writable: true,
272
316
  value: void 0
273
317
  });
318
+ Object.defineProperty(this, "batchSizeLimit", {
319
+ enumerable: true,
320
+ configurable: true,
321
+ writable: true,
322
+ value: void 0
323
+ });
274
324
  Object.defineProperty(this, "fetchOptions", {
275
325
  enumerable: true,
276
326
  configurable: true,
@@ -314,8 +364,38 @@ class Client {
314
364
  writable: true,
315
365
  value: false
316
366
  });
367
+ Object.defineProperty(this, "langSmithToOTELTranslator", {
368
+ enumerable: true,
369
+ configurable: true,
370
+ writable: true,
371
+ value: void 0
372
+ });
373
+ Object.defineProperty(this, "fetchImplementation", {
374
+ enumerable: true,
375
+ configurable: true,
376
+ writable: true,
377
+ value: void 0
378
+ });
379
+ Object.defineProperty(this, "cachedLSEnvVarsForMetadata", {
380
+ enumerable: true,
381
+ configurable: true,
382
+ writable: true,
383
+ value: void 0
384
+ });
385
+ Object.defineProperty(this, "multipartStreamingDisabled", {
386
+ enumerable: true,
387
+ configurable: true,
388
+ writable: true,
389
+ value: false
390
+ });
391
+ Object.defineProperty(this, "debug", {
392
+ enumerable: true,
393
+ configurable: true,
394
+ writable: true,
395
+ value: (0, env_js_1.getEnvironmentVariable)("LANGSMITH_DEBUG") === "true"
396
+ });
317
397
  const defaultConfig = Client.getDefaultClientConfig();
318
- this.tracingSampleRate = getTracingSamplingRate();
398
+ this.tracingSampleRate = getTracingSamplingRate(config.tracingSamplingRate);
319
399
  this.apiUrl = trimQuotes(config.apiUrl ?? defaultConfig.apiUrl) ?? "";
320
400
  if (this.apiUrl.endsWith("/")) {
321
401
  this.apiUrl = this.apiUrl.slice(0, -1);
@@ -325,18 +405,26 @@ class Client {
325
405
  if (this.webUrl?.endsWith("/")) {
326
406
  this.webUrl = this.webUrl.slice(0, -1);
327
407
  }
408
+ this.workspaceId = trimQuotes(config.workspaceId ?? (0, env_js_1.getLangSmithEnvironmentVariable)("WORKSPACE_ID"));
328
409
  this.timeout_ms = config.timeout_ms ?? 90_000;
329
- this.caller = new async_caller_js_1.AsyncCaller(config.callerOptions ?? {});
410
+ this.caller = new async_caller_js_1.AsyncCaller({
411
+ ...(config.callerOptions ?? {}),
412
+ maxRetries: 4,
413
+ debug: config.debug ?? this.debug,
414
+ });
330
415
  this.traceBatchConcurrency =
331
416
  config.traceBatchConcurrency ?? this.traceBatchConcurrency;
332
417
  if (this.traceBatchConcurrency < 1) {
333
418
  throw new Error("Trace batch concurrency must be positive.");
334
419
  }
420
+ this.debug = config.debug ?? this.debug;
421
+ this.fetchImplementation = config.fetchImplementation;
335
422
  this.batchIngestCaller = new async_caller_js_1.AsyncCaller({
336
423
  maxRetries: 2,
337
424
  maxConcurrency: this.traceBatchConcurrency,
338
425
  ...(config.callerOptions ?? {}),
339
426
  onFailedResponseHook: handle429,
427
+ debug: config.debug ?? this.debug,
340
428
  });
341
429
  this.hideInputs =
342
430
  config.hideInputs ?? config.anonymizer ?? defaultConfig.hideInputs;
@@ -346,13 +434,18 @@ class Client {
346
434
  this.blockOnRootRunFinalization =
347
435
  config.blockOnRootRunFinalization ?? this.blockOnRootRunFinalization;
348
436
  this.batchSizeBytesLimit = config.batchSizeBytesLimit;
437
+ this.batchSizeLimit = config.batchSizeLimit;
349
438
  this.fetchOptions = config.fetchOptions || {};
350
439
  this.manualFlushMode = config.manualFlushMode ?? this.manualFlushMode;
440
+ if ((0, env_js_1.getOtelEnabled)()) {
441
+ this.langSmithToOTELTranslator = new translator_js_1.LangSmithToOTELTranslator();
442
+ }
443
+ // Cache metadata env vars once during construction to avoid repeatedly scanning process.env
444
+ this.cachedLSEnvVarsForMetadata = (0, env_js_1.getLangSmithEnvVarsMetadata)();
351
445
  }
352
446
  static getDefaultClientConfig() {
353
447
  const apiKey = (0, env_js_1.getLangSmithEnvironmentVariable)("API_KEY");
354
- const apiUrl = (0, env_js_1.getLangSmithEnvironmentVariable)("ENDPOINT") ??
355
- "https://api.smith.langchain.com";
448
+ const apiUrl = (0, env_js_1.getLangSmithEnvironmentVariable)("ENDPOINT") ?? DEFAULT_API_URL;
356
449
  const hideInputs = (0, env_js_1.getLangSmithEnvironmentVariable)("HIDE_INPUTS") === "true";
357
450
  const hideOutputs = (0, env_js_1.getLangSmithEnvironmentVariable)("HIDE_OUTPUTS") === "true";
358
451
  return {
@@ -404,9 +497,17 @@ class Client {
404
497
  if (this.apiKey) {
405
498
  headers["x-api-key"] = `${this.apiKey}`;
406
499
  }
500
+ if (this.workspaceId) {
501
+ headers["x-tenant-id"] = this.workspaceId;
502
+ }
407
503
  return headers;
408
504
  }
409
- processInputs(inputs) {
505
+ _getPlatformEndpointPath(path) {
506
+ // Check if apiUrl already ends with /v1 or /v1/ to avoid double /v1/v1/ paths
507
+ const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
508
+ return needsV1Prefix ? `/v1/platform/${path}` : `/platform/${path}`;
509
+ }
510
+ async processInputs(inputs) {
410
511
  if (this.hideInputs === false) {
411
512
  return inputs;
412
513
  }
@@ -418,7 +519,7 @@ class Client {
418
519
  }
419
520
  return inputs;
420
521
  }
421
- processOutputs(outputs) {
522
+ async processOutputs(outputs) {
422
523
  if (this.hideOutputs === false) {
423
524
  return outputs;
424
525
  }
@@ -430,26 +531,29 @@ class Client {
430
531
  }
431
532
  return outputs;
432
533
  }
433
- prepareRunCreateOrUpdateInputs(run) {
534
+ async prepareRunCreateOrUpdateInputs(run) {
434
535
  const runParams = { ...run };
435
536
  if (runParams.inputs !== undefined) {
436
- runParams.inputs = this.processInputs(runParams.inputs);
537
+ runParams.inputs = await this.processInputs(runParams.inputs);
437
538
  }
438
539
  if (runParams.outputs !== undefined) {
439
- runParams.outputs = this.processOutputs(runParams.outputs);
540
+ runParams.outputs = await this.processOutputs(runParams.outputs);
440
541
  }
441
542
  return runParams;
442
543
  }
443
544
  async _getResponse(path, queryParams) {
444
545
  const paramsString = queryParams?.toString() ?? "";
445
546
  const url = `${this.apiUrl}${path}?${paramsString}`;
446
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), url, {
447
- method: "GET",
448
- headers: this.headers,
449
- signal: AbortSignal.timeout(this.timeout_ms),
450
- ...this.fetchOptions,
547
+ const response = await this.caller.call(async () => {
548
+ const res = await this._fetch(url, {
549
+ method: "GET",
550
+ headers: this.headers,
551
+ signal: AbortSignal.timeout(this.timeout_ms),
552
+ ...this.fetchOptions,
553
+ });
554
+ await (0, error_js_1.raiseForStatus)(res, `fetch ${path}`);
555
+ return res;
451
556
  });
452
- await (0, error_js_1.raiseForStatus)(response, `Failed to fetch ${path}`);
453
557
  return response;
454
558
  }
455
559
  async _get(path, queryParams) {
@@ -463,13 +567,16 @@ class Client {
463
567
  queryParams.set("offset", String(offset));
464
568
  queryParams.set("limit", String(limit));
465
569
  const url = `${this.apiUrl}${path}?${queryParams}`;
466
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), url, {
467
- method: "GET",
468
- headers: this.headers,
469
- signal: AbortSignal.timeout(this.timeout_ms),
470
- ...this.fetchOptions,
570
+ const response = await this.caller.call(async () => {
571
+ const res = await this._fetch(url, {
572
+ method: "GET",
573
+ headers: this.headers,
574
+ signal: AbortSignal.timeout(this.timeout_ms),
575
+ ...this.fetchOptions,
576
+ });
577
+ await (0, error_js_1.raiseForStatus)(res, `fetch ${path}`);
578
+ return res;
471
579
  });
472
- await (0, error_js_1.raiseForStatus)(response, `Failed to fetch ${path}`);
473
580
  const items = transform
474
581
  ? transform(await response.json())
475
582
  : await response.json();
@@ -486,12 +593,17 @@ class Client {
486
593
  async *_getCursorPaginatedList(path, body = null, requestMethod = "POST", dataKey = "runs") {
487
594
  const bodyParams = body ? { ...body } : {};
488
595
  while (true) {
489
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}${path}`, {
490
- method: requestMethod,
491
- headers: { ...this.headers, "Content-Type": "application/json" },
492
- signal: AbortSignal.timeout(this.timeout_ms),
493
- ...this.fetchOptions,
494
- body: JSON.stringify(bodyParams),
596
+ const body = JSON.stringify(bodyParams);
597
+ const response = await this.caller.call(async () => {
598
+ const res = await this._fetch(`${this.apiUrl}${path}`, {
599
+ method: requestMethod,
600
+ headers: { ...this.headers, "Content-Type": "application/json" },
601
+ signal: AbortSignal.timeout(this.timeout_ms),
602
+ ...this.fetchOptions,
603
+ body,
604
+ });
605
+ await (0, error_js_1.raiseForStatus)(res, `fetch ${path}`);
606
+ return res;
495
607
  });
496
608
  const responseBody = await response.json();
497
609
  if (!responseBody) {
@@ -511,6 +623,13 @@ class Client {
511
623
  bodyParams.cursor = cursors.next;
512
624
  }
513
625
  }
626
+ // Allows mocking for tests
627
+ _shouldSample() {
628
+ if (this.tracingSampleRate === undefined) {
629
+ return true;
630
+ }
631
+ return Math.random() < this.tracingSampleRate;
632
+ }
514
633
  _filterForSampling(runs, patch = false) {
515
634
  if (this.tracingSampleRate === undefined) {
516
635
  return runs;
@@ -518,25 +637,36 @@ class Client {
518
637
  if (patch) {
519
638
  const sampled = [];
520
639
  for (const run of runs) {
521
- if (!this.filteredPostUuids.has(run.id)) {
640
+ if (!this.filteredPostUuids.has(run.trace_id)) {
522
641
  sampled.push(run);
523
642
  }
524
- else {
525
- this.filteredPostUuids.delete(run.id);
643
+ else if (run.id === run.trace_id) {
644
+ this.filteredPostUuids.delete(run.trace_id);
526
645
  }
527
646
  }
528
647
  return sampled;
529
648
  }
530
649
  else {
650
+ // For new runs, sample at trace level to maintain consistency
531
651
  const sampled = [];
532
652
  for (const run of runs) {
533
- if ((run.id !== run.trace_id &&
534
- !this.filteredPostUuids.has(run.trace_id)) ||
535
- Math.random() < this.tracingSampleRate) {
536
- sampled.push(run);
653
+ const traceId = run.trace_id ?? run.id;
654
+ // If we've already made a decision about this trace, follow it
655
+ if (this.filteredPostUuids.has(traceId)) {
656
+ continue;
657
+ }
658
+ // For new traces, apply sampling
659
+ if (run.id === traceId) {
660
+ if (this._shouldSample()) {
661
+ sampled.push(run);
662
+ }
663
+ else {
664
+ this.filteredPostUuids.add(traceId);
665
+ }
537
666
  }
538
667
  else {
539
- this.filteredPostUuids.add(run.id);
668
+ // Child runs follow their trace's sampling decision
669
+ sampled.push(run);
540
670
  }
541
671
  }
542
672
  return sampled;
@@ -546,83 +676,163 @@ class Client {
546
676
  const serverInfo = await this._ensureServerInfo();
547
677
  return (this.batchSizeBytesLimit ??
548
678
  serverInfo.batch_ingest_config?.size_limit_bytes ??
549
- exports.DEFAULT_BATCH_SIZE_LIMIT_BYTES);
679
+ exports.DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES);
680
+ }
681
+ /**
682
+ * Get the maximum number of operations to batch in a single request.
683
+ */
684
+ async _getBatchSizeLimit() {
685
+ const serverInfo = await this._ensureServerInfo();
686
+ return (this.batchSizeLimit ??
687
+ serverInfo.batch_ingest_config?.size_limit ??
688
+ DEFAULT_BATCH_SIZE_LIMIT);
550
689
  }
551
- async _getMultiPartSupport() {
690
+ async _getDatasetExamplesMultiPartSupport() {
552
691
  const serverInfo = await this._ensureServerInfo();
553
692
  return (serverInfo.instance_flags?.dataset_examples_multipart_enabled ?? false);
554
693
  }
555
- drainAutoBatchQueue(batchSizeLimit) {
694
+ drainAutoBatchQueue({ batchSizeLimitBytes, batchSizeLimit, }) {
556
695
  const promises = [];
557
696
  while (this.autoBatchQueue.items.length > 0) {
558
- const [batch, done] = this.autoBatchQueue.pop(batchSizeLimit);
697
+ const [batch, done] = this.autoBatchQueue.pop({
698
+ upToSizeBytes: batchSizeLimitBytes,
699
+ upToSize: batchSizeLimit,
700
+ });
559
701
  if (!batch.length) {
560
702
  done();
561
703
  break;
562
704
  }
563
- const batchPromise = this._processBatch(batch, done).catch(console.error);
564
- promises.push(batchPromise);
705
+ const batchesByDestination = batch.reduce((acc, item) => {
706
+ const apiUrl = item.apiUrl ?? this.apiUrl;
707
+ const apiKey = item.apiKey ?? this.apiKey;
708
+ const isDefault = item.apiKey === this.apiKey && item.apiUrl === this.apiUrl;
709
+ const batchKey = isDefault ? "default" : `${apiUrl}|${apiKey}`;
710
+ if (!acc[batchKey]) {
711
+ acc[batchKey] = [];
712
+ }
713
+ acc[batchKey].push(item);
714
+ return acc;
715
+ }, {});
716
+ const batchPromises = [];
717
+ for (const [batchKey, batch] of Object.entries(batchesByDestination)) {
718
+ const batchPromise = this._processBatch(batch, {
719
+ apiUrl: batchKey === "default" ? undefined : batchKey.split("|")[0],
720
+ apiKey: batchKey === "default" ? undefined : batchKey.split("|")[1],
721
+ });
722
+ batchPromises.push(batchPromise);
723
+ }
724
+ // Wait for all batches to complete, then call the overall done callback
725
+ const allBatchesPromise = Promise.all(batchPromises).finally(done);
726
+ promises.push(allBatchesPromise);
565
727
  }
566
728
  return Promise.all(promises);
567
729
  }
568
- async _processBatch(batch, done) {
730
+ async _processBatch(batch, options) {
569
731
  if (!batch.length) {
570
- done();
571
732
  return;
572
733
  }
573
734
  try {
574
- const ingestParams = {
575
- runCreates: batch
576
- .filter((item) => item.action === "create")
577
- .map((item) => item.item),
578
- runUpdates: batch
579
- .filter((item) => item.action === "update")
580
- .map((item) => item.item),
581
- };
582
- const serverInfo = await this._ensureServerInfo();
583
- if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
584
- await this.multipartIngestRuns(ingestParams);
735
+ if (this.langSmithToOTELTranslator !== undefined) {
736
+ this._sendBatchToOTELTranslator(batch);
585
737
  }
586
738
  else {
587
- await this.batchIngestRuns(ingestParams);
739
+ const ingestParams = {
740
+ runCreates: batch
741
+ .filter((item) => item.action === "create")
742
+ .map((item) => item.item),
743
+ runUpdates: batch
744
+ .filter((item) => item.action === "update")
745
+ .map((item) => item.item),
746
+ };
747
+ const serverInfo = await this._ensureServerInfo();
748
+ if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
749
+ const useGzip = serverInfo?.instance_flags?.gzip_body_enabled;
750
+ await this.multipartIngestRuns(ingestParams, { ...options, useGzip });
751
+ }
752
+ else {
753
+ await this.batchIngestRuns(ingestParams, options);
754
+ }
588
755
  }
589
756
  }
590
- finally {
591
- done();
757
+ catch (e) {
758
+ console.error("Error exporting batch:", e);
759
+ }
760
+ }
761
+ _sendBatchToOTELTranslator(batch) {
762
+ if (this.langSmithToOTELTranslator !== undefined) {
763
+ const otelContextMap = new Map();
764
+ const operations = [];
765
+ for (const item of batch) {
766
+ if (item.item.id && item.otelContext) {
767
+ otelContextMap.set(item.item.id, item.otelContext);
768
+ if (item.action === "create") {
769
+ operations.push({
770
+ operation: "post",
771
+ id: item.item.id,
772
+ trace_id: item.item.trace_id ?? item.item.id,
773
+ run: item.item,
774
+ });
775
+ }
776
+ else {
777
+ operations.push({
778
+ operation: "patch",
779
+ id: item.item.id,
780
+ trace_id: item.item.trace_id ?? item.item.id,
781
+ run: item.item,
782
+ });
783
+ }
784
+ }
785
+ }
786
+ this.langSmithToOTELTranslator.exportBatch(operations, otelContextMap);
592
787
  }
593
788
  }
594
789
  async processRunOperation(item) {
595
790
  clearTimeout(this.autoBatchTimeout);
596
791
  this.autoBatchTimeout = undefined;
597
- if (item.action === "create") {
598
- item.item = mergeRuntimeEnvIntoRunCreate(item.item);
599
- }
792
+ item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata);
600
793
  const itemPromise = this.autoBatchQueue.push(item);
601
794
  if (this.manualFlushMode) {
602
795
  // Rely on manual flushing in serverless environments
603
796
  return itemPromise;
604
797
  }
605
798
  const sizeLimitBytes = await this._getBatchSizeLimitBytes();
606
- if (this.autoBatchQueue.sizeBytes > sizeLimitBytes) {
607
- void this.drainAutoBatchQueue(sizeLimitBytes);
799
+ const sizeLimit = await this._getBatchSizeLimit();
800
+ if (this.autoBatchQueue.sizeBytes > sizeLimitBytes ||
801
+ this.autoBatchQueue.items.length > sizeLimit) {
802
+ void this.drainAutoBatchQueue({
803
+ batchSizeLimitBytes: sizeLimitBytes,
804
+ batchSizeLimit: sizeLimit,
805
+ });
608
806
  }
609
807
  if (this.autoBatchQueue.items.length > 0) {
610
808
  this.autoBatchTimeout = setTimeout(() => {
611
809
  this.autoBatchTimeout = undefined;
612
- void this.drainAutoBatchQueue(sizeLimitBytes);
810
+ void this.drainAutoBatchQueue({
811
+ batchSizeLimitBytes: sizeLimitBytes,
812
+ batchSizeLimit: sizeLimit,
813
+ });
613
814
  }, this.autoBatchAggregationDelayMs);
614
815
  }
615
816
  return itemPromise;
616
817
  }
617
818
  async _getServerInfo() {
618
- const response = await (0, fetch_js_1._getFetchImplementation)()(`${this.apiUrl}/info`, {
619
- method: "GET",
620
- headers: { Accept: "application/json" },
621
- signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT),
622
- ...this.fetchOptions,
819
+ const response = await this.caller.call(async () => {
820
+ const res = await this._fetch(`${this.apiUrl}/info`, {
821
+ method: "GET",
822
+ headers: { Accept: "application/json" },
823
+ signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT_MS),
824
+ ...this.fetchOptions,
825
+ });
826
+ await (0, error_js_1.raiseForStatus)(res, "get server info");
827
+ return res;
623
828
  });
624
- await (0, error_js_1.raiseForStatus)(response, "get server info");
625
- return response.json();
829
+ const json = await response.json();
830
+ if (this.debug) {
831
+ console.log("\n=== LangSmith Server Configuration ===\n" +
832
+ JSON.stringify(json, null, 2) +
833
+ "\n");
834
+ }
835
+ return json;
626
836
  }
627
837
  async _ensureServerInfo() {
628
838
  if (this._getServerInfoPromise === undefined) {
@@ -632,7 +842,7 @@ class Client {
632
842
  this._serverInfo = await this._getServerInfo();
633
843
  }
634
844
  catch (e) {
635
- console.warn(`[WARNING]: LangSmith failed to fetch info on supported operations. Falling back to batch operations and default limits.`);
845
+ console.warn(`[LANGSMITH]: Failed to fetch info on supported operations. Falling back to batch operations and default limits. Info: ${e.status ?? "Unspecified status code"} ${e.message}`);
636
846
  }
637
847
  }
638
848
  return this._serverInfo ?? {};
@@ -656,16 +866,34 @@ class Client {
656
866
  */
657
867
  async flush() {
658
868
  const sizeLimitBytes = await this._getBatchSizeLimitBytes();
659
- await this.drainAutoBatchQueue(sizeLimitBytes);
869
+ const sizeLimit = await this._getBatchSizeLimit();
870
+ await this.drainAutoBatchQueue({
871
+ batchSizeLimitBytes: sizeLimitBytes,
872
+ batchSizeLimit: sizeLimit,
873
+ });
874
+ }
875
+ _cloneCurrentOTELContext() {
876
+ const otel_trace = (0, otel_js_1.getOTELTrace)();
877
+ const otel_context = (0, otel_js_1.getOTELContext)();
878
+ if (this.langSmithToOTELTranslator !== undefined) {
879
+ const currentSpan = otel_trace.getActiveSpan();
880
+ if (currentSpan) {
881
+ return otel_trace.setSpan(otel_context.active(), currentSpan);
882
+ }
883
+ }
884
+ return undefined;
660
885
  }
661
- async createRun(run) {
886
+ async createRun(run, options) {
662
887
  if (!this._filterForSampling([run]).length) {
663
888
  return;
664
889
  }
665
- const headers = { ...this.headers, "Content-Type": "application/json" };
890
+ const headers = {
891
+ ...this.headers,
892
+ "Content-Type": "application/json",
893
+ };
666
894
  const session_name = run.project_name;
667
895
  delete run.project_name;
668
- const runCreate = this.prepareRunCreateOrUpdateInputs({
896
+ const runCreate = await this.prepareRunCreateOrUpdateInputs({
669
897
  session_name,
670
898
  ...run,
671
899
  start_time: run.start_time ?? Date.now(),
@@ -673,32 +901,46 @@ class Client {
673
901
  if (this.autoBatchTracing &&
674
902
  runCreate.trace_id !== undefined &&
675
903
  runCreate.dotted_order !== undefined) {
904
+ const otelContext = this._cloneCurrentOTELContext();
676
905
  void this.processRunOperation({
677
906
  action: "create",
678
907
  item: runCreate,
908
+ otelContext,
909
+ apiKey: options?.apiKey,
910
+ apiUrl: options?.apiUrl,
679
911
  }).catch(console.error);
680
912
  return;
681
913
  }
682
- const mergedRunCreateParam = mergeRuntimeEnvIntoRunCreate(runCreate);
683
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs`, {
684
- method: "POST",
685
- headers,
686
- body: (0, index_js_2.serialize)(mergedRunCreateParam),
687
- signal: AbortSignal.timeout(this.timeout_ms),
688
- ...this.fetchOptions,
914
+ const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata);
915
+ if (options?.apiKey !== undefined) {
916
+ headers["x-api-key"] = options.apiKey;
917
+ }
918
+ if (options?.workspaceId !== undefined) {
919
+ headers["x-tenant-id"] = options.workspaceId;
920
+ }
921
+ const body = (0, index_js_2.serialize)(mergedRunCreateParam, `Creating run with id: ${mergedRunCreateParam.id}`);
922
+ await this.caller.call(async () => {
923
+ const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs`, {
924
+ method: "POST",
925
+ headers,
926
+ signal: AbortSignal.timeout(this.timeout_ms),
927
+ ...this.fetchOptions,
928
+ body,
929
+ });
930
+ await (0, error_js_1.raiseForStatus)(res, "create run", true);
931
+ return res;
689
932
  });
690
- await (0, error_js_1.raiseForStatus)(response, "create run", true);
691
933
  }
692
934
  /**
693
935
  * Batch ingest/upsert multiple runs in the Langsmith system.
694
936
  * @param runs
695
937
  */
696
- async batchIngestRuns({ runCreates, runUpdates, }) {
938
+ async batchIngestRuns({ runCreates, runUpdates, }, options) {
697
939
  if (runCreates === undefined && runUpdates === undefined) {
698
940
  return;
699
941
  }
700
- let preparedCreateParams = runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? [];
701
- let preparedUpdateParams = runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? [];
942
+ let preparedCreateParams = await Promise.all(runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? []);
943
+ let preparedUpdateParams = await Promise.all(runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? []);
702
944
  if (preparedCreateParams.length > 0 && preparedUpdateParams.length > 0) {
703
945
  const createById = preparedCreateParams.reduce((params, run) => {
704
946
  if (!run.id) {
@@ -723,8 +965,8 @@ class Client {
723
965
  preparedUpdateParams = standaloneUpdates;
724
966
  }
725
967
  const rawBatch = {
726
- post: this._filterForSampling(preparedCreateParams),
727
- patch: this._filterForSampling(preparedUpdateParams, true),
968
+ post: preparedCreateParams,
969
+ patch: preparedUpdateParams,
728
970
  };
729
971
  if (!rawBatch.post.length && !rawBatch.patch.length) {
730
972
  return;
@@ -738,34 +980,45 @@ class Client {
738
980
  const batchItems = rawBatch[key].reverse();
739
981
  let batchItem = batchItems.pop();
740
982
  while (batchItem !== undefined) {
983
+ // Type is wrong but this is a deprecated code path anyway
741
984
  batchChunks[key].push(batchItem);
742
985
  batchItem = batchItems.pop();
743
986
  }
744
987
  }
745
988
  if (batchChunks.post.length > 0 || batchChunks.patch.length > 0) {
746
- await this._postBatchIngestRuns((0, index_js_2.serialize)(batchChunks));
989
+ const runIds = batchChunks.post
990
+ .map((item) => item.id)
991
+ .concat(batchChunks.patch.map((item) => item.id))
992
+ .join(",");
993
+ await this._postBatchIngestRuns((0, index_js_2.serialize)(batchChunks, `Ingesting runs with ids: ${runIds}`), options);
747
994
  }
748
995
  }
749
- async _postBatchIngestRuns(body) {
996
+ async _postBatchIngestRuns(body, options) {
750
997
  const headers = {
751
998
  ...this.headers,
752
999
  "Content-Type": "application/json",
753
1000
  Accept: "application/json",
754
1001
  };
755
- const response = await this.batchIngestCaller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/batch`, {
756
- method: "POST",
757
- headers,
758
- body: body,
759
- signal: AbortSignal.timeout(this.timeout_ms),
760
- ...this.fetchOptions,
1002
+ if (options?.apiKey !== undefined) {
1003
+ headers["x-api-key"] = options.apiKey;
1004
+ }
1005
+ await this.batchIngestCaller.call(async () => {
1006
+ const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/batch`, {
1007
+ method: "POST",
1008
+ headers,
1009
+ signal: AbortSignal.timeout(this.timeout_ms),
1010
+ ...this.fetchOptions,
1011
+ body,
1012
+ });
1013
+ await (0, error_js_1.raiseForStatus)(res, "batch create run", true);
1014
+ return res;
761
1015
  });
762
- await (0, error_js_1.raiseForStatus)(response, "batch create run", true);
763
1016
  }
764
1017
  /**
765
1018
  * Batch ingest/upsert multiple runs in the Langsmith system.
766
1019
  * @param runs
767
1020
  */
768
- async multipartIngestRuns({ runCreates, runUpdates, }) {
1021
+ async multipartIngestRuns({ runCreates, runUpdates, }, options) {
769
1022
  if (runCreates === undefined && runUpdates === undefined) {
770
1023
  return;
771
1024
  }
@@ -773,7 +1026,7 @@ class Client {
773
1026
  const allAttachments = {};
774
1027
  let preparedCreateParams = [];
775
1028
  for (const create of runCreates ?? []) {
776
- const preparedCreate = this.prepareRunCreateOrUpdateInputs(create);
1029
+ const preparedCreate = await this.prepareRunCreateOrUpdateInputs(create);
777
1030
  if (preparedCreate.id !== undefined &&
778
1031
  preparedCreate.attachments !== undefined) {
779
1032
  allAttachments[preparedCreate.id] = preparedCreate.attachments;
@@ -783,7 +1036,7 @@ class Client {
783
1036
  }
784
1037
  let preparedUpdateParams = [];
785
1038
  for (const update of runUpdates ?? []) {
786
- preparedUpdateParams.push(this.prepareRunCreateOrUpdateInputs(update));
1039
+ preparedUpdateParams.push(await this.prepareRunCreateOrUpdateInputs(update));
787
1040
  }
788
1041
  // require trace_id and dotted_order
789
1042
  const invalidRunCreate = preparedCreateParams.find((runCreate) => {
@@ -835,10 +1088,10 @@ class Client {
835
1088
  ]) {
836
1089
  for (const originalPayload of payloads) {
837
1090
  // collect fields to be sent as separate parts
838
- const { inputs, outputs, events, attachments, ...payload } = originalPayload;
839
- const fields = { inputs, outputs, events };
1091
+ const { inputs, outputs, events, extra, error, serialized, attachments, ...payload } = originalPayload;
1092
+ const fields = { inputs, outputs, events, extra, error, serialized };
840
1093
  // encode the main run payload
841
- const stringifiedPayload = (0, index_js_2.serialize)(payload);
1094
+ const stringifiedPayload = (0, index_js_2.serialize)(payload, `Serializing for multipart ingestion of run with id: ${payload.id}`);
842
1095
  accumulatedParts.push({
843
1096
  name: `${method}.${payload.id}`,
844
1097
  payload: new Blob([stringifiedPayload], {
@@ -850,7 +1103,7 @@ class Client {
850
1103
  if (value === undefined) {
851
1104
  continue;
852
1105
  }
853
- const stringifiedValue = (0, index_js_2.serialize)(value);
1106
+ const stringifiedValue = (0, index_js_2.serialize)(value, `Serializing ${key} for multipart ingestion of run with id: ${payload.id}`);
854
1107
  accumulatedParts.push({
855
1108
  name: `${method}.${payload.id}.${key}`,
856
1109
  payload: new Blob([stringifiedValue], {
@@ -892,53 +1145,144 @@ class Client {
892
1145
  accumulatedContext.push(`trace=${payload.trace_id},id=${payload.id}`);
893
1146
  }
894
1147
  }
895
- await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "));
896
- }
897
- async _sendMultipartRequest(parts, context) {
898
- try {
899
- // Create multipart form data manually using Blobs
900
- const boundary = "----LangSmithFormBoundary" + Math.random().toString(36).slice(2);
901
- const chunks = [];
902
- for (const part of parts) {
903
- // Add field boundary
904
- chunks.push(new Blob([`--${boundary}\r\n`]));
905
- chunks.push(new Blob([
906
- `Content-Disposition: form-data; name="${part.name}"\r\n`,
907
- `Content-Type: ${part.payload.type}\r\n\r\n`,
908
- ]));
909
- chunks.push(part.payload);
910
- chunks.push(new Blob(["\r\n"]));
911
- }
912
- // Add final boundary
913
- chunks.push(new Blob([`--${boundary}--\r\n`]));
914
- // Combine all chunks into a single Blob
915
- const body = new Blob(chunks);
916
- // Convert Blob to ArrayBuffer for compatibility
917
- const arrayBuffer = await body.arrayBuffer();
918
- const res = await this.batchIngestCaller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/multipart`, {
919
- method: "POST",
920
- headers: {
1148
+ await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "), options);
1149
+ }
1150
+ async _createNodeFetchBody(parts, boundary) {
1151
+ // Create multipart form data manually using Blobs
1152
+ const chunks = [];
1153
+ for (const part of parts) {
1154
+ // Add field boundary
1155
+ chunks.push(new Blob([`--${boundary}\r\n`]));
1156
+ chunks.push(new Blob([
1157
+ `Content-Disposition: form-data; name="${part.name}"\r\n`,
1158
+ `Content-Type: ${part.payload.type}\r\n\r\n`,
1159
+ ]));
1160
+ chunks.push(part.payload);
1161
+ chunks.push(new Blob(["\r\n"]));
1162
+ }
1163
+ // Add final boundary
1164
+ chunks.push(new Blob([`--${boundary}--\r\n`]));
1165
+ // Combine all chunks into a single Blob
1166
+ const body = new Blob(chunks);
1167
+ // Convert Blob to ArrayBuffer for compatibility
1168
+ const arrayBuffer = await body.arrayBuffer();
1169
+ return arrayBuffer;
1170
+ }
1171
+ async _createMultipartStream(parts, boundary) {
1172
+ const encoder = new TextEncoder();
1173
+ // Create a ReadableStream for streaming the multipart data
1174
+ // Only do special handling if we're using node-fetch
1175
+ const stream = new ReadableStream({
1176
+ async start(controller) {
1177
+ // Helper function to write a chunk to the stream
1178
+ const writeChunk = async (chunk) => {
1179
+ if (typeof chunk === "string") {
1180
+ controller.enqueue(encoder.encode(chunk));
1181
+ }
1182
+ else {
1183
+ controller.enqueue(chunk);
1184
+ }
1185
+ };
1186
+ // Write each part to the stream
1187
+ for (const part of parts) {
1188
+ // Write boundary and headers
1189
+ await writeChunk(`--${boundary}\r\n`);
1190
+ await writeChunk(`Content-Disposition: form-data; name="${part.name}"\r\n`);
1191
+ await writeChunk(`Content-Type: ${part.payload.type}\r\n\r\n`);
1192
+ // Write the payload
1193
+ const payloadStream = part.payload.stream();
1194
+ const reader = payloadStream.getReader();
1195
+ try {
1196
+ let result;
1197
+ while (!(result = await reader.read()).done) {
1198
+ controller.enqueue(result.value);
1199
+ }
1200
+ }
1201
+ finally {
1202
+ reader.releaseLock();
1203
+ }
1204
+ await writeChunk("\r\n");
1205
+ }
1206
+ // Write final boundary
1207
+ await writeChunk(`--${boundary}--\r\n`);
1208
+ controller.close();
1209
+ },
1210
+ });
1211
+ return stream;
1212
+ }
1213
+ async _sendMultipartRequest(parts, context, options) {
1214
+ // Create multipart form data boundary
1215
+ const boundary = "----LangSmithFormBoundary" + Math.random().toString(36).slice(2);
1216
+ const isNodeFetch = (0, fetch_js_1._globalFetchImplementationIsNodeFetch)();
1217
+ const buildBuffered = () => this._createNodeFetchBody(parts, boundary);
1218
+ const buildStream = () => this._createMultipartStream(parts, boundary);
1219
+ const sendWithRetry = async (bodyFactory) => {
1220
+ return this.batchIngestCaller.call(async () => {
1221
+ const body = await bodyFactory();
1222
+ const headers = {
921
1223
  ...this.headers,
922
1224
  "Content-Type": `multipart/form-data; boundary=${boundary}`,
923
- },
924
- body: arrayBuffer,
925
- signal: AbortSignal.timeout(this.timeout_ms),
926
- ...this.fetchOptions,
1225
+ };
1226
+ if (options?.apiKey !== undefined) {
1227
+ headers["x-api-key"] = options.apiKey;
1228
+ }
1229
+ let transformedBody = body;
1230
+ if (options?.useGzip &&
1231
+ typeof body === "object" &&
1232
+ "pipeThrough" in body) {
1233
+ transformedBody = body.pipeThrough(new CompressionStream("gzip"));
1234
+ headers["Content-Encoding"] = "gzip";
1235
+ }
1236
+ const response = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/multipart`, {
1237
+ method: "POST",
1238
+ headers,
1239
+ body: transformedBody,
1240
+ duplex: "half",
1241
+ signal: AbortSignal.timeout(this.timeout_ms),
1242
+ ...this.fetchOptions,
1243
+ });
1244
+ await (0, error_js_1.raiseForStatus)(response, `Failed to send multipart request`, true);
1245
+ return response;
927
1246
  });
928
- await (0, error_js_1.raiseForStatus)(res, "ingest multipart runs", true);
1247
+ };
1248
+ try {
1249
+ let res;
1250
+ let streamedAttempt = false;
1251
+ // attempt stream only if not disabled and not using node-fetch or Bun
1252
+ if (!isNodeFetch &&
1253
+ !this.multipartStreamingDisabled &&
1254
+ (0, env_js_1.getEnv)() !== "bun") {
1255
+ streamedAttempt = true;
1256
+ res = await sendWithRetry(buildStream);
1257
+ }
1258
+ else {
1259
+ res = await sendWithRetry(buildBuffered);
1260
+ }
1261
+ // if stream fails, fallback to buffered body
1262
+ if ((!this.multipartStreamingDisabled || streamedAttempt) &&
1263
+ res.status === 422 &&
1264
+ (options?.apiUrl ?? this.apiUrl) !== DEFAULT_API_URL) {
1265
+ console.warn(`Streaming multipart upload to ${options?.apiUrl ?? this.apiUrl}/runs/multipart failed. ` +
1266
+ `This usually means the host does not support chunked uploads. ` +
1267
+ `Retrying with a buffered upload for operation "${context}".`);
1268
+ // Disable streaming for future requests
1269
+ this.multipartStreamingDisabled = true;
1270
+ // retry with fully-buffered body
1271
+ res = await sendWithRetry(buildBuffered);
1272
+ }
929
1273
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
930
1274
  }
931
1275
  catch (e) {
932
1276
  console.warn(`${e.message.trim()}\n\nContext: ${context}`);
933
1277
  }
934
1278
  }
935
- async updateRun(runId, run) {
1279
+ async updateRun(runId, run, options) {
936
1280
  (0, _uuid_js_1.assertUuid)(runId);
937
1281
  if (run.inputs) {
938
- run.inputs = this.processInputs(run.inputs);
1282
+ run.inputs = await this.processInputs(run.inputs);
939
1283
  }
940
1284
  if (run.outputs) {
941
- run.outputs = this.processOutputs(run.outputs);
1285
+ run.outputs = await this.processOutputs(run.outputs);
942
1286
  }
943
1287
  // TODO: Untangle types
944
1288
  const data = { ...run, id: runId };
@@ -948,34 +1292,60 @@ class Client {
948
1292
  if (this.autoBatchTracing &&
949
1293
  data.trace_id !== undefined &&
950
1294
  data.dotted_order !== undefined) {
1295
+ const otelContext = this._cloneCurrentOTELContext();
951
1296
  if (run.end_time !== undefined &&
952
1297
  data.parent_run_id === undefined &&
953
1298
  this.blockOnRootRunFinalization &&
954
1299
  !this.manualFlushMode) {
955
1300
  // Trigger batches as soon as a root trace ends and wait to ensure trace finishes
956
1301
  // in serverless environments.
957
- await this.processRunOperation({ action: "update", item: data }).catch(console.error);
1302
+ await this.processRunOperation({
1303
+ action: "update",
1304
+ item: data,
1305
+ otelContext,
1306
+ apiKey: options?.apiKey,
1307
+ apiUrl: options?.apiUrl,
1308
+ }).catch(console.error);
958
1309
  return;
959
1310
  }
960
1311
  else {
961
- void this.processRunOperation({ action: "update", item: data }).catch(console.error);
1312
+ void this.processRunOperation({
1313
+ action: "update",
1314
+ item: data,
1315
+ otelContext,
1316
+ apiKey: options?.apiKey,
1317
+ apiUrl: options?.apiUrl,
1318
+ }).catch(console.error);
962
1319
  }
963
1320
  return;
964
1321
  }
965
- const headers = { ...this.headers, "Content-Type": "application/json" };
966
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/${runId}`, {
967
- method: "PATCH",
968
- headers,
969
- body: (0, index_js_2.serialize)(run),
970
- signal: AbortSignal.timeout(this.timeout_ms),
971
- ...this.fetchOptions,
1322
+ const headers = {
1323
+ ...this.headers,
1324
+ "Content-Type": "application/json",
1325
+ };
1326
+ if (options?.apiKey !== undefined) {
1327
+ headers["x-api-key"] = options.apiKey;
1328
+ }
1329
+ if (options?.workspaceId !== undefined) {
1330
+ headers["x-tenant-id"] = options.workspaceId;
1331
+ }
1332
+ const body = (0, index_js_2.serialize)(run, `Serializing payload to update run with id: ${runId}`);
1333
+ await this.caller.call(async () => {
1334
+ const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/${runId}`, {
1335
+ method: "PATCH",
1336
+ headers,
1337
+ signal: AbortSignal.timeout(this.timeout_ms),
1338
+ ...this.fetchOptions,
1339
+ body,
1340
+ });
1341
+ await (0, error_js_1.raiseForStatus)(res, "update run", true);
1342
+ return res;
972
1343
  });
973
- await (0, error_js_1.raiseForStatus)(response, "update run", true);
974
1344
  }
975
1345
  async readRun(runId, { loadChildRuns } = { loadChildRuns: false }) {
976
1346
  (0, _uuid_js_1.assertUuid)(runId);
977
1347
  let run = await this._get(`/runs/${runId}`);
978
- if (loadChildRuns && run.child_run_ids) {
1348
+ if (loadChildRuns) {
979
1349
  run = await this._loadChildRuns(run);
980
1350
  }
981
1351
  return run;
@@ -1014,7 +1384,11 @@ class Client {
1014
1384
  }
1015
1385
  }
1016
1386
  async _loadChildRuns(run) {
1017
- const childRuns = await toArray(this.listRuns({ id: run.child_run_ids }));
1387
+ const childRuns = await toArray(this.listRuns({
1388
+ isRoot: false,
1389
+ projectId: run.session_id,
1390
+ traceId: run.trace_id,
1391
+ }));
1018
1392
  const treemap = {};
1019
1393
  const runs = {};
1020
1394
  // TODO: make dotted order required when the migration finishes
@@ -1024,11 +1398,14 @@ class Client {
1024
1398
  childRun.parent_run_id === undefined) {
1025
1399
  throw new Error(`Child run ${childRun.id} has no parent`);
1026
1400
  }
1027
- if (!(childRun.parent_run_id in treemap)) {
1028
- treemap[childRun.parent_run_id] = [];
1401
+ if (childRun.dotted_order?.startsWith(run.dotted_order ?? "") &&
1402
+ childRun.id !== run.id) {
1403
+ if (!(childRun.parent_run_id in treemap)) {
1404
+ treemap[childRun.parent_run_id] = [];
1405
+ }
1406
+ treemap[childRun.parent_run_id].push(childRun);
1407
+ runs[childRun.id] = childRun;
1029
1408
  }
1030
- treemap[childRun.parent_run_id].push(childRun);
1031
- runs[childRun.id] = childRun;
1032
1409
  }
1033
1410
  run.child_runs = treemap[run.id] || [];
1034
1411
  for (const runId in treemap) {
@@ -1121,7 +1498,7 @@ class Client {
1121
1498
  * });
1122
1499
  */
1123
1500
  async *listRuns(props) {
1124
- const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, } = props;
1501
+ const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, order, } = props;
1125
1502
  let projectIds = [];
1126
1503
  if (projectId) {
1127
1504
  projectIds = Array.isArray(projectId) ? projectId : [projectId];
@@ -1135,7 +1512,6 @@ class Client {
1135
1512
  }
1136
1513
  const default_select = [
1137
1514
  "app_path",
1138
- "child_run_ids",
1139
1515
  "completion_cost",
1140
1516
  "completion_tokens",
1141
1517
  "dotted_order",
@@ -1180,7 +1556,11 @@ class Client {
1180
1556
  trace: traceId,
1181
1557
  select: select ? select : default_select,
1182
1558
  is_root: isRoot,
1559
+ order,
1183
1560
  };
1561
+ if (body.select.includes("child_run_ids")) {
1562
+ (0, warn_js_1.warnOnce)("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");
1563
+ }
1184
1564
  let runsYielded = 0;
1185
1565
  for await (const runs of this._getCursorPaginatedList("/runs/query", body)) {
1186
1566
  if (limit) {
@@ -1200,6 +1580,53 @@ class Client {
1200
1580
  }
1201
1581
  }
1202
1582
  }
1583
+ async *listGroupRuns(props) {
1584
+ const { projectId, projectName, groupBy, filter, startTime, endTime, limit, offset, } = props;
1585
+ const sessionId = projectId || (await this.readProject({ projectName })).id;
1586
+ const baseBody = {
1587
+ session_id: sessionId,
1588
+ group_by: groupBy,
1589
+ filter,
1590
+ start_time: startTime ? startTime.toISOString() : null,
1591
+ end_time: endTime ? endTime.toISOString() : null,
1592
+ limit: Number(limit) || 100,
1593
+ };
1594
+ let currentOffset = Number(offset) || 0;
1595
+ const path = "/runs/group";
1596
+ const url = `${this.apiUrl}${path}`;
1597
+ while (true) {
1598
+ const currentBody = {
1599
+ ...baseBody,
1600
+ offset: currentOffset,
1601
+ };
1602
+ // Remove undefined values from the payload
1603
+ const filteredPayload = Object.fromEntries(Object.entries(currentBody).filter(([_, value]) => value !== undefined));
1604
+ const body = JSON.stringify(filteredPayload);
1605
+ const response = await this.caller.call(async () => {
1606
+ const res = await this._fetch(url, {
1607
+ method: "POST",
1608
+ headers: { ...this.headers, "Content-Type": "application/json" },
1609
+ signal: AbortSignal.timeout(this.timeout_ms),
1610
+ ...this.fetchOptions,
1611
+ body,
1612
+ });
1613
+ await (0, error_js_1.raiseForStatus)(res, `Failed to fetch ${path}`);
1614
+ return res;
1615
+ });
1616
+ const items = await response.json();
1617
+ const { groups, total } = items;
1618
+ if (groups.length === 0) {
1619
+ break;
1620
+ }
1621
+ for (const thread of groups) {
1622
+ yield thread;
1623
+ }
1624
+ currentOffset += groups.length;
1625
+ if (currentOffset >= total) {
1626
+ break;
1627
+ }
1628
+ }
1629
+ }
1203
1630
  async getRunStats({ id, trace, parentRun, runType, projectNames, projectIds, referenceExampleIds, startTime, endTime, error, query, filter, traceFilter, treeFilter, isRoot, dataSourceType, }) {
1204
1631
  let projectIds_ = projectIds || [];
1205
1632
  if (projectNames) {
@@ -1227,12 +1654,17 @@ class Client {
1227
1654
  };
1228
1655
  // Remove undefined values from the payload
1229
1656
  const filteredPayload = Object.fromEntries(Object.entries(payload).filter(([_, value]) => value !== undefined));
1230
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/stats`, {
1231
- method: "POST",
1232
- headers: this.headers,
1233
- body: JSON.stringify(filteredPayload),
1234
- signal: AbortSignal.timeout(this.timeout_ms),
1235
- ...this.fetchOptions,
1657
+ const body = JSON.stringify(filteredPayload);
1658
+ const response = await this.caller.call(async () => {
1659
+ const res = await this._fetch(`${this.apiUrl}/runs/stats`, {
1660
+ method: "POST",
1661
+ headers: { ...this.headers, "Content-Type": "application/json" },
1662
+ signal: AbortSignal.timeout(this.timeout_ms),
1663
+ ...this.fetchOptions,
1664
+ body,
1665
+ });
1666
+ await (0, error_js_1.raiseForStatus)(res, "get run stats");
1667
+ return res;
1236
1668
  });
1237
1669
  const result = await response.json();
1238
1670
  return result;
@@ -1243,12 +1675,17 @@ class Client {
1243
1675
  share_token: shareId || uuid.v4(),
1244
1676
  };
1245
1677
  (0, _uuid_js_1.assertUuid)(runId);
1246
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/${runId}/share`, {
1247
- method: "PUT",
1248
- headers: this.headers,
1249
- body: JSON.stringify(data),
1250
- signal: AbortSignal.timeout(this.timeout_ms),
1251
- ...this.fetchOptions,
1678
+ const body = JSON.stringify(data);
1679
+ const response = await this.caller.call(async () => {
1680
+ const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
1681
+ method: "PUT",
1682
+ headers: this.headers,
1683
+ signal: AbortSignal.timeout(this.timeout_ms),
1684
+ ...this.fetchOptions,
1685
+ body,
1686
+ });
1687
+ await (0, error_js_1.raiseForStatus)(res, "share run");
1688
+ return res;
1252
1689
  });
1253
1690
  const result = await response.json();
1254
1691
  if (result === null || !("share_token" in result)) {
@@ -1258,21 +1695,28 @@ class Client {
1258
1695
  }
1259
1696
  async unshareRun(runId) {
1260
1697
  (0, _uuid_js_1.assertUuid)(runId);
1261
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/${runId}/share`, {
1262
- method: "DELETE",
1263
- headers: this.headers,
1264
- signal: AbortSignal.timeout(this.timeout_ms),
1265
- ...this.fetchOptions,
1698
+ await this.caller.call(async () => {
1699
+ const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
1700
+ method: "DELETE",
1701
+ headers: this.headers,
1702
+ signal: AbortSignal.timeout(this.timeout_ms),
1703
+ ...this.fetchOptions,
1704
+ });
1705
+ await (0, error_js_1.raiseForStatus)(res, "unshare run", true);
1706
+ return res;
1266
1707
  });
1267
- await (0, error_js_1.raiseForStatus)(response, "unshare run", true);
1268
1708
  }
1269
1709
  async readRunSharedLink(runId) {
1270
1710
  (0, _uuid_js_1.assertUuid)(runId);
1271
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/${runId}/share`, {
1272
- method: "GET",
1273
- headers: this.headers,
1274
- signal: AbortSignal.timeout(this.timeout_ms),
1275
- ...this.fetchOptions,
1711
+ const response = await this.caller.call(async () => {
1712
+ const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
1713
+ method: "GET",
1714
+ headers: this.headers,
1715
+ signal: AbortSignal.timeout(this.timeout_ms),
1716
+ ...this.fetchOptions,
1717
+ });
1718
+ await (0, error_js_1.raiseForStatus)(res, "read run shared link");
1719
+ return res;
1276
1720
  });
1277
1721
  const result = await response.json();
1278
1722
  if (result === null || !("share_token" in result)) {
@@ -1290,11 +1734,15 @@ class Client {
1290
1734
  }
1291
1735
  }
1292
1736
  (0, _uuid_js_1.assertUuid)(shareToken);
1293
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/public/${shareToken}/runs${queryParams}`, {
1294
- method: "GET",
1295
- headers: this.headers,
1296
- signal: AbortSignal.timeout(this.timeout_ms),
1297
- ...this.fetchOptions,
1737
+ const response = await this.caller.call(async () => {
1738
+ const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/runs${queryParams}`, {
1739
+ method: "GET",
1740
+ headers: this.headers,
1741
+ signal: AbortSignal.timeout(this.timeout_ms),
1742
+ ...this.fetchOptions,
1743
+ });
1744
+ await (0, error_js_1.raiseForStatus)(res, "list shared runs");
1745
+ return res;
1298
1746
  });
1299
1747
  const runs = await response.json();
1300
1748
  return runs;
@@ -1308,11 +1756,15 @@ class Client {
1308
1756
  datasetId = dataset.id;
1309
1757
  }
1310
1758
  (0, _uuid_js_1.assertUuid)(datasetId);
1311
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId}/share`, {
1312
- method: "GET",
1313
- headers: this.headers,
1314
- signal: AbortSignal.timeout(this.timeout_ms),
1315
- ...this.fetchOptions,
1759
+ const response = await this.caller.call(async () => {
1760
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
1761
+ method: "GET",
1762
+ headers: this.headers,
1763
+ signal: AbortSignal.timeout(this.timeout_ms),
1764
+ ...this.fetchOptions,
1765
+ });
1766
+ await (0, error_js_1.raiseForStatus)(res, "read dataset shared schema");
1767
+ return res;
1316
1768
  });
1317
1769
  const shareSchema = await response.json();
1318
1770
  shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
@@ -1330,12 +1782,17 @@ class Client {
1330
1782
  dataset_id: datasetId,
1331
1783
  };
1332
1784
  (0, _uuid_js_1.assertUuid)(datasetId);
1333
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId}/share`, {
1334
- method: "PUT",
1335
- headers: this.headers,
1336
- body: JSON.stringify(data),
1337
- signal: AbortSignal.timeout(this.timeout_ms),
1338
- ...this.fetchOptions,
1785
+ const body = JSON.stringify(data);
1786
+ const response = await this.caller.call(async () => {
1787
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
1788
+ method: "PUT",
1789
+ headers: this.headers,
1790
+ signal: AbortSignal.timeout(this.timeout_ms),
1791
+ ...this.fetchOptions,
1792
+ body,
1793
+ });
1794
+ await (0, error_js_1.raiseForStatus)(res, "share dataset");
1795
+ return res;
1339
1796
  });
1340
1797
  const shareSchema = await response.json();
1341
1798
  shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
@@ -1343,21 +1800,28 @@ class Client {
1343
1800
  }
1344
1801
  async unshareDataset(datasetId) {
1345
1802
  (0, _uuid_js_1.assertUuid)(datasetId);
1346
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId}/share`, {
1347
- method: "DELETE",
1348
- headers: this.headers,
1349
- signal: AbortSignal.timeout(this.timeout_ms),
1350
- ...this.fetchOptions,
1803
+ await this.caller.call(async () => {
1804
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
1805
+ method: "DELETE",
1806
+ headers: this.headers,
1807
+ signal: AbortSignal.timeout(this.timeout_ms),
1808
+ ...this.fetchOptions,
1809
+ });
1810
+ await (0, error_js_1.raiseForStatus)(res, "unshare dataset", true);
1811
+ return res;
1351
1812
  });
1352
- await (0, error_js_1.raiseForStatus)(response, "unshare dataset", true);
1353
1813
  }
1354
1814
  async readSharedDataset(shareToken) {
1355
1815
  (0, _uuid_js_1.assertUuid)(shareToken);
1356
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/public/${shareToken}/datasets`, {
1357
- method: "GET",
1358
- headers: this.headers,
1359
- signal: AbortSignal.timeout(this.timeout_ms),
1360
- ...this.fetchOptions,
1816
+ const response = await this.caller.call(async () => {
1817
+ const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/datasets`, {
1818
+ method: "GET",
1819
+ headers: this.headers,
1820
+ signal: AbortSignal.timeout(this.timeout_ms),
1821
+ ...this.fetchOptions,
1822
+ });
1823
+ await (0, error_js_1.raiseForStatus)(res, "read shared dataset");
1824
+ return res;
1361
1825
  });
1362
1826
  const dataset = await response.json();
1363
1827
  return dataset;
@@ -1384,16 +1848,22 @@ class Client {
1384
1848
  urlParams.append(key, value);
1385
1849
  }
1386
1850
  });
1387
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/public/${shareToken}/examples?${urlParams.toString()}`, {
1388
- method: "GET",
1389
- headers: this.headers,
1390
- signal: AbortSignal.timeout(this.timeout_ms),
1391
- ...this.fetchOptions,
1851
+ const response = await this.caller.call(async () => {
1852
+ const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/examples?${urlParams.toString()}`, {
1853
+ method: "GET",
1854
+ headers: this.headers,
1855
+ signal: AbortSignal.timeout(this.timeout_ms),
1856
+ ...this.fetchOptions,
1857
+ });
1858
+ await (0, error_js_1.raiseForStatus)(res, "list shared examples");
1859
+ return res;
1392
1860
  });
1393
1861
  const result = await response.json();
1394
1862
  if (!response.ok) {
1395
1863
  if ("detail" in result) {
1396
- throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${result.detail.join("\n")}`);
1864
+ throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${Array.isArray(result.detail)
1865
+ ? result.detail.join("\n")
1866
+ : "Unspecified error"}`);
1397
1867
  }
1398
1868
  throw new Error(`Failed to list shared examples: ${response.status} ${response.statusText}`);
1399
1869
  }
@@ -1417,14 +1887,18 @@ class Client {
1417
1887
  if (referenceDatasetId !== null) {
1418
1888
  body["reference_dataset_id"] = referenceDatasetId;
1419
1889
  }
1420
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), endpoint, {
1421
- method: "POST",
1422
- headers: { ...this.headers, "Content-Type": "application/json" },
1423
- body: JSON.stringify(body),
1424
- signal: AbortSignal.timeout(this.timeout_ms),
1425
- ...this.fetchOptions,
1890
+ const serializedBody = JSON.stringify(body);
1891
+ const response = await this.caller.call(async () => {
1892
+ const res = await this._fetch(endpoint, {
1893
+ method: "POST",
1894
+ headers: { ...this.headers, "Content-Type": "application/json" },
1895
+ signal: AbortSignal.timeout(this.timeout_ms),
1896
+ ...this.fetchOptions,
1897
+ body: serializedBody,
1898
+ });
1899
+ await (0, error_js_1.raiseForStatus)(res, "create project");
1900
+ return res;
1426
1901
  });
1427
- await (0, error_js_1.raiseForStatus)(response, "create project");
1428
1902
  const result = await response.json();
1429
1903
  return result;
1430
1904
  }
@@ -1434,20 +1908,23 @@ class Client {
1434
1908
  if (metadata) {
1435
1909
  extra = { ...(extra || {}), metadata };
1436
1910
  }
1437
- const body = {
1911
+ const body = JSON.stringify({
1438
1912
  name,
1439
1913
  extra,
1440
1914
  description,
1441
1915
  end_time: endTime ? new Date(endTime).toISOString() : null,
1442
- };
1443
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), endpoint, {
1444
- method: "PATCH",
1445
- headers: { ...this.headers, "Content-Type": "application/json" },
1446
- body: JSON.stringify(body),
1447
- signal: AbortSignal.timeout(this.timeout_ms),
1448
- ...this.fetchOptions,
1449
- });
1450
- await (0, error_js_1.raiseForStatus)(response, "update project");
1916
+ });
1917
+ const response = await this.caller.call(async () => {
1918
+ const res = await this._fetch(endpoint, {
1919
+ method: "PATCH",
1920
+ headers: { ...this.headers, "Content-Type": "application/json" },
1921
+ signal: AbortSignal.timeout(this.timeout_ms),
1922
+ ...this.fetchOptions,
1923
+ body,
1924
+ });
1925
+ await (0, error_js_1.raiseForStatus)(res, "update project");
1926
+ return res;
1927
+ });
1451
1928
  const result = await response.json();
1452
1929
  return result;
1453
1930
  }
@@ -1468,11 +1945,15 @@ class Client {
1468
1945
  else {
1469
1946
  throw new Error("Must provide projectName or projectId");
1470
1947
  }
1471
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}${path}?${params}`, {
1472
- method: "GET",
1473
- headers: this.headers,
1474
- signal: AbortSignal.timeout(this.timeout_ms),
1475
- ...this.fetchOptions,
1948
+ const response = await this.caller.call(async () => {
1949
+ const res = await this._fetch(`${this.apiUrl}${path}?${params}`, {
1950
+ method: "GET",
1951
+ headers: this.headers,
1952
+ signal: AbortSignal.timeout(this.timeout_ms),
1953
+ ...this.fetchOptions,
1954
+ });
1955
+ await (0, error_js_1.raiseForStatus)(res, "has project");
1956
+ return res;
1476
1957
  });
1477
1958
  // consume the response body to release the connection
1478
1959
  // https://undici.nodejs.org/#/?id=garbage-collection
@@ -1551,7 +2032,7 @@ class Client {
1551
2032
  }
1552
2033
  throw new Error("No projects found to resolve tenant.");
1553
2034
  }
1554
- async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, referenceFree, metadata, } = {}) {
2035
+ async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, includeStats, datasetVersion, referenceFree, metadata, } = {}) {
1555
2036
  const params = new URLSearchParams();
1556
2037
  if (projectIds !== undefined) {
1557
2038
  for (const projectId of projectIds) {
@@ -1573,6 +2054,12 @@ class Client {
1573
2054
  });
1574
2055
  params.append("reference_dataset", dataset.id);
1575
2056
  }
2057
+ if (includeStats !== undefined) {
2058
+ params.append("include_stats", includeStats.toString());
2059
+ }
2060
+ if (datasetVersion !== undefined) {
2061
+ params.append("dataset_version", datasetVersion);
2062
+ }
1576
2063
  if (referenceFree !== undefined) {
1577
2064
  params.append("reference_free", referenceFree.toString());
1578
2065
  }
@@ -1598,13 +2085,16 @@ class Client {
1598
2085
  projectId_ = projectId;
1599
2086
  }
1600
2087
  (0, _uuid_js_1.assertUuid)(projectId_);
1601
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/sessions/${projectId_}`, {
1602
- method: "DELETE",
1603
- headers: this.headers,
1604
- signal: AbortSignal.timeout(this.timeout_ms),
1605
- ...this.fetchOptions,
2088
+ await this.caller.call(async () => {
2089
+ const res = await this._fetch(`${this.apiUrl}/sessions/${projectId_}`, {
2090
+ method: "DELETE",
2091
+ headers: this.headers,
2092
+ signal: AbortSignal.timeout(this.timeout_ms),
2093
+ ...this.fetchOptions,
2094
+ });
2095
+ await (0, error_js_1.raiseForStatus)(res, `delete session ${projectId_} (${projectName})`, true);
2096
+ return res;
1606
2097
  });
1607
- await (0, error_js_1.raiseForStatus)(response, `delete session ${projectId_} (${projectName})`, true);
1608
2098
  }
1609
2099
  async uploadCsv({ csvFile, fileName, inputKeys, outputKeys, description, dataType, name, }) {
1610
2100
  const url = `${this.apiUrl}/datasets/upload`;
@@ -1625,14 +2115,17 @@ class Client {
1625
2115
  if (name) {
1626
2116
  formData.append("name", name);
1627
2117
  }
1628
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), url, {
1629
- method: "POST",
1630
- headers: this.headers,
1631
- body: formData,
1632
- signal: AbortSignal.timeout(this.timeout_ms),
1633
- ...this.fetchOptions,
2118
+ const response = await this.caller.call(async () => {
2119
+ const res = await this._fetch(url, {
2120
+ method: "POST",
2121
+ headers: this.headers,
2122
+ signal: AbortSignal.timeout(this.timeout_ms),
2123
+ ...this.fetchOptions,
2124
+ body: formData,
2125
+ });
2126
+ await (0, error_js_1.raiseForStatus)(res, "upload CSV");
2127
+ return res;
1634
2128
  });
1635
- await (0, error_js_1.raiseForStatus)(response, "upload CSV");
1636
2129
  const result = await response.json();
1637
2130
  return result;
1638
2131
  }
@@ -1651,14 +2144,18 @@ class Client {
1651
2144
  if (outputsSchema) {
1652
2145
  body.outputs_schema_definition = outputsSchema;
1653
2146
  }
1654
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets`, {
1655
- method: "POST",
1656
- headers: { ...this.headers, "Content-Type": "application/json" },
1657
- body: JSON.stringify(body),
1658
- signal: AbortSignal.timeout(this.timeout_ms),
1659
- ...this.fetchOptions,
2147
+ const serializedBody = JSON.stringify(body);
2148
+ const response = await this.caller.call(async () => {
2149
+ const res = await this._fetch(`${this.apiUrl}/datasets`, {
2150
+ method: "POST",
2151
+ headers: { ...this.headers, "Content-Type": "application/json" },
2152
+ signal: AbortSignal.timeout(this.timeout_ms),
2153
+ ...this.fetchOptions,
2154
+ body: serializedBody,
2155
+ });
2156
+ await (0, error_js_1.raiseForStatus)(res, "create dataset");
2157
+ return res;
1660
2158
  });
1661
- await (0, error_js_1.raiseForStatus)(response, "create dataset");
1662
2159
  const result = await response.json();
1663
2160
  return result;
1664
2161
  }
@@ -1666,14 +2163,14 @@ class Client {
1666
2163
  let path = "/datasets";
1667
2164
  // limit to 1 result
1668
2165
  const params = new URLSearchParams({ limit: "1" });
1669
- if (datasetId !== undefined && datasetName !== undefined) {
2166
+ if (datasetId && datasetName) {
1670
2167
  throw new Error("Must provide either datasetName or datasetId, not both");
1671
2168
  }
1672
- else if (datasetId !== undefined) {
2169
+ else if (datasetId) {
1673
2170
  (0, _uuid_js_1.assertUuid)(datasetId);
1674
2171
  path += `/${datasetId}`;
1675
2172
  }
1676
- else if (datasetName !== undefined) {
2173
+ else if (datasetName) {
1677
2174
  params.append("name", datasetName);
1678
2175
  }
1679
2176
  else {
@@ -1783,14 +2280,18 @@ class Client {
1783
2280
  }
1784
2281
  const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
1785
2282
  (0, _uuid_js_1.assertUuid)(_datasetId);
1786
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${_datasetId}`, {
1787
- method: "PATCH",
1788
- headers: { ...this.headers, "Content-Type": "application/json" },
1789
- body: JSON.stringify(update),
1790
- signal: AbortSignal.timeout(this.timeout_ms),
1791
- ...this.fetchOptions,
1792
- });
1793
- await (0, error_js_1.raiseForStatus)(response, "update dataset");
2283
+ const body = JSON.stringify(update);
2284
+ const response = await this.caller.call(async () => {
2285
+ const res = await this._fetch(`${this.apiUrl}/datasets/${_datasetId}`, {
2286
+ method: "PATCH",
2287
+ headers: { ...this.headers, "Content-Type": "application/json" },
2288
+ signal: AbortSignal.timeout(this.timeout_ms),
2289
+ ...this.fetchOptions,
2290
+ body,
2291
+ });
2292
+ await (0, error_js_1.raiseForStatus)(res, "update dataset");
2293
+ return res;
2294
+ });
1794
2295
  return (await response.json());
1795
2296
  }
1796
2297
  /**
@@ -1815,17 +2316,21 @@ class Client {
1815
2316
  }
1816
2317
  const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
1817
2318
  (0, _uuid_js_1.assertUuid)(_datasetId);
1818
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${_datasetId}/tags`, {
1819
- method: "PUT",
1820
- headers: { ...this.headers, "Content-Type": "application/json" },
1821
- body: JSON.stringify({
1822
- as_of: typeof asOf === "string" ? asOf : asOf.toISOString(),
1823
- tag,
1824
- }),
1825
- signal: AbortSignal.timeout(this.timeout_ms),
1826
- ...this.fetchOptions,
2319
+ const body = JSON.stringify({
2320
+ as_of: typeof asOf === "string" ? asOf : asOf.toISOString(),
2321
+ tag,
2322
+ });
2323
+ await this.caller.call(async () => {
2324
+ const res = await this._fetch(`${this.apiUrl}/datasets/${_datasetId}/tags`, {
2325
+ method: "PUT",
2326
+ headers: { ...this.headers, "Content-Type": "application/json" },
2327
+ signal: AbortSignal.timeout(this.timeout_ms),
2328
+ ...this.fetchOptions,
2329
+ body,
2330
+ });
2331
+ await (0, error_js_1.raiseForStatus)(res, "update dataset tags", true);
2332
+ return res;
1827
2333
  });
1828
- await (0, error_js_1.raiseForStatus)(response, "update dataset tags");
1829
2334
  }
1830
2335
  async deleteDataset({ datasetId, datasetName, }) {
1831
2336
  let path = "/datasets";
@@ -1844,14 +2349,16 @@ class Client {
1844
2349
  else {
1845
2350
  throw new Error("Must provide datasetName or datasetId");
1846
2351
  }
1847
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), this.apiUrl + path, {
1848
- method: "DELETE",
1849
- headers: this.headers,
1850
- signal: AbortSignal.timeout(this.timeout_ms),
1851
- ...this.fetchOptions,
2352
+ await this.caller.call(async () => {
2353
+ const res = await this._fetch(this.apiUrl + path, {
2354
+ method: "DELETE",
2355
+ headers: this.headers,
2356
+ signal: AbortSignal.timeout(this.timeout_ms),
2357
+ ...this.fetchOptions,
2358
+ });
2359
+ await (0, error_js_1.raiseForStatus)(res, `delete ${path}`, true);
2360
+ return res;
1852
2361
  });
1853
- await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
1854
- await response.json();
1855
2362
  }
1856
2363
  async indexDataset({ datasetId, datasetName, tag, }) {
1857
2364
  let datasetId_ = datasetId;
@@ -1869,14 +2376,18 @@ class Client {
1869
2376
  const data = {
1870
2377
  tag: tag,
1871
2378
  };
1872
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId_}/index`, {
1873
- method: "POST",
1874
- headers: { ...this.headers, "Content-Type": "application/json" },
1875
- body: JSON.stringify(data),
1876
- signal: AbortSignal.timeout(this.timeout_ms),
1877
- ...this.fetchOptions,
1878
- });
1879
- await (0, error_js_1.raiseForStatus)(response, "index dataset");
2379
+ const body = JSON.stringify(data);
2380
+ const response = await this.caller.call(async () => {
2381
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId_}/index`, {
2382
+ method: "POST",
2383
+ headers: { ...this.headers, "Content-Type": "application/json" },
2384
+ signal: AbortSignal.timeout(this.timeout_ms),
2385
+ ...this.fetchOptions,
2386
+ body,
2387
+ });
2388
+ await (0, error_js_1.raiseForStatus)(res, "index dataset");
2389
+ return res;
2390
+ });
1880
2391
  await response.json();
1881
2392
  }
1882
2393
  /**
@@ -1918,14 +2429,18 @@ class Client {
1918
2429
  data["filter"] = filter;
1919
2430
  }
1920
2431
  (0, _uuid_js_1.assertUuid)(datasetId);
1921
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId}/search`, {
1922
- method: "POST",
1923
- headers: { ...this.headers, "Content-Type": "application/json" },
1924
- body: JSON.stringify(data),
1925
- signal: AbortSignal.timeout(this.timeout_ms),
1926
- ...this.fetchOptions,
1927
- });
1928
- await (0, error_js_1.raiseForStatus)(response, "fetch similar examples");
2432
+ const body = JSON.stringify(data);
2433
+ const response = await this.caller.call(async () => {
2434
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/search`, {
2435
+ headers: { ...this.headers, "Content-Type": "application/json" },
2436
+ signal: AbortSignal.timeout(this.timeout_ms),
2437
+ ...this.fetchOptions,
2438
+ method: "POST",
2439
+ body,
2440
+ });
2441
+ await (0, error_js_1.raiseForStatus)(res, "fetch similar examples");
2442
+ return res;
2443
+ });
1929
2444
  const result = await response.json();
1930
2445
  return result["examples"];
1931
2446
  }
@@ -2137,14 +2652,16 @@ class Client {
2137
2652
  async deleteExample(exampleId) {
2138
2653
  (0, _uuid_js_1.assertUuid)(exampleId);
2139
2654
  const path = `/examples/${exampleId}`;
2140
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), this.apiUrl + path, {
2141
- method: "DELETE",
2142
- headers: this.headers,
2143
- signal: AbortSignal.timeout(this.timeout_ms),
2144
- ...this.fetchOptions,
2655
+ await this.caller.call(async () => {
2656
+ const res = await this._fetch(this.apiUrl + path, {
2657
+ method: "DELETE",
2658
+ headers: this.headers,
2659
+ signal: AbortSignal.timeout(this.timeout_ms),
2660
+ ...this.fetchOptions,
2661
+ });
2662
+ await (0, error_js_1.raiseForStatus)(res, `delete ${path}`, true);
2663
+ return res;
2145
2664
  });
2146
- await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
2147
- await response.json();
2148
2665
  }
2149
2666
  async updateExample(exampleIdOrUpdate, update) {
2150
2667
  let exampleId;
@@ -2216,13 +2733,16 @@ class Client {
2216
2733
  if (tag !== undefined) {
2217
2734
  params.append("tag", tag);
2218
2735
  }
2219
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${resolvedDatasetId}/version?${params.toString()}`, {
2220
- method: "GET",
2221
- headers: { ...this.headers },
2222
- signal: AbortSignal.timeout(this.timeout_ms),
2223
- ...this.fetchOptions,
2736
+ const response = await this.caller.call(async () => {
2737
+ const res = await this._fetch(`${this.apiUrl}/datasets/${resolvedDatasetId}/version?${params.toString()}`, {
2738
+ method: "GET",
2739
+ headers: { ...this.headers },
2740
+ signal: AbortSignal.timeout(this.timeout_ms),
2741
+ ...this.fetchOptions,
2742
+ });
2743
+ await (0, error_js_1.raiseForStatus)(res, "read dataset version");
2744
+ return res;
2224
2745
  });
2225
- await (0, error_js_1.raiseForStatus)(response, "read dataset version");
2226
2746
  return await response.json();
2227
2747
  }
2228
2748
  async listDatasetSplits({ datasetId, datasetName, asOf, }) {
@@ -2277,14 +2797,18 @@ class Client {
2277
2797
  }),
2278
2798
  remove,
2279
2799
  };
2280
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId_}/splits`, {
2281
- method: "PUT",
2282
- headers: { ...this.headers, "Content-Type": "application/json" },
2283
- body: JSON.stringify(data),
2284
- signal: AbortSignal.timeout(this.timeout_ms),
2285
- ...this.fetchOptions,
2800
+ const body = JSON.stringify(data);
2801
+ await this.caller.call(async () => {
2802
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId_}/splits`, {
2803
+ method: "PUT",
2804
+ headers: { ...this.headers, "Content-Type": "application/json" },
2805
+ signal: AbortSignal.timeout(this.timeout_ms),
2806
+ ...this.fetchOptions,
2807
+ body,
2808
+ });
2809
+ await (0, error_js_1.raiseForStatus)(res, "update dataset splits", true);
2810
+ return res;
2286
2811
  });
2287
- await (0, error_js_1.raiseForStatus)(response, "update dataset splits", true);
2288
2812
  }
2289
2813
  /**
2290
2814
  * @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.
@@ -2333,7 +2857,7 @@ class Client {
2333
2857
  id: feedbackId ?? uuid.v4(),
2334
2858
  run_id: runId,
2335
2859
  key,
2336
- score,
2860
+ score: _formatFeedbackScore(score),
2337
2861
  value,
2338
2862
  correction,
2339
2863
  comment,
@@ -2342,21 +2866,25 @@ class Client {
2342
2866
  feedbackConfig,
2343
2867
  session_id: projectId,
2344
2868
  };
2869
+ const body = JSON.stringify(feedback);
2345
2870
  const url = `${this.apiUrl}/feedback`;
2346
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), url, {
2347
- method: "POST",
2348
- headers: { ...this.headers, "Content-Type": "application/json" },
2349
- body: JSON.stringify(feedback),
2350
- signal: AbortSignal.timeout(this.timeout_ms),
2351
- ...this.fetchOptions,
2352
- });
2353
- await (0, error_js_1.raiseForStatus)(response, "create feedback", true);
2871
+ await this.caller.call(async () => {
2872
+ const res = await this._fetch(url, {
2873
+ method: "POST",
2874
+ headers: { ...this.headers, "Content-Type": "application/json" },
2875
+ signal: AbortSignal.timeout(this.timeout_ms),
2876
+ ...this.fetchOptions,
2877
+ body,
2878
+ });
2879
+ await (0, error_js_1.raiseForStatus)(res, "create feedback", true);
2880
+ return res;
2881
+ });
2354
2882
  return feedback;
2355
2883
  }
2356
2884
  async updateFeedback(feedbackId, { score, value, correction, comment, }) {
2357
2885
  const feedbackUpdate = {};
2358
2886
  if (score !== undefined && score !== null) {
2359
- feedbackUpdate["score"] = score;
2887
+ feedbackUpdate["score"] = _formatFeedbackScore(score);
2360
2888
  }
2361
2889
  if (value !== undefined && value !== null) {
2362
2890
  feedbackUpdate["value"] = value;
@@ -2368,14 +2896,18 @@ class Client {
2368
2896
  feedbackUpdate["comment"] = comment;
2369
2897
  }
2370
2898
  (0, _uuid_js_1.assertUuid)(feedbackId);
2371
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/feedback/${feedbackId}`, {
2372
- method: "PATCH",
2373
- headers: { ...this.headers, "Content-Type": "application/json" },
2374
- body: JSON.stringify(feedbackUpdate),
2375
- signal: AbortSignal.timeout(this.timeout_ms),
2376
- ...this.fetchOptions,
2899
+ const body = JSON.stringify(feedbackUpdate);
2900
+ await this.caller.call(async () => {
2901
+ const res = await this._fetch(`${this.apiUrl}/feedback/${feedbackId}`, {
2902
+ method: "PATCH",
2903
+ headers: { ...this.headers, "Content-Type": "application/json" },
2904
+ signal: AbortSignal.timeout(this.timeout_ms),
2905
+ ...this.fetchOptions,
2906
+ body,
2907
+ });
2908
+ await (0, error_js_1.raiseForStatus)(res, "update feedback", true);
2909
+ return res;
2377
2910
  });
2378
- await (0, error_js_1.raiseForStatus)(response, "update feedback", true);
2379
2911
  }
2380
2912
  async readFeedback(feedbackId) {
2381
2913
  (0, _uuid_js_1.assertUuid)(feedbackId);
@@ -2386,19 +2918,24 @@ class Client {
2386
2918
  async deleteFeedback(feedbackId) {
2387
2919
  (0, _uuid_js_1.assertUuid)(feedbackId);
2388
2920
  const path = `/feedback/${feedbackId}`;
2389
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), this.apiUrl + path, {
2390
- method: "DELETE",
2391
- headers: this.headers,
2392
- signal: AbortSignal.timeout(this.timeout_ms),
2393
- ...this.fetchOptions,
2921
+ await this.caller.call(async () => {
2922
+ const res = await this._fetch(this.apiUrl + path, {
2923
+ method: "DELETE",
2924
+ headers: this.headers,
2925
+ signal: AbortSignal.timeout(this.timeout_ms),
2926
+ ...this.fetchOptions,
2927
+ });
2928
+ await (0, error_js_1.raiseForStatus)(res, `delete ${path}`, true);
2929
+ return res;
2394
2930
  });
2395
- await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
2396
- await response.json();
2397
2931
  }
2398
2932
  async *listFeedback({ runIds, feedbackKeys, feedbackSourceTypes, } = {}) {
2399
2933
  const queryParams = new URLSearchParams();
2400
2934
  if (runIds) {
2401
- queryParams.append("run", runIds.join(","));
2935
+ for (const runId of runIds) {
2936
+ (0, _uuid_js_1.assertUuid)(runId);
2937
+ queryParams.append("run", runId);
2938
+ }
2402
2939
  }
2403
2940
  if (feedbackKeys) {
2404
2941
  for (const key of feedbackKeys) {
@@ -2448,15 +2985,19 @@ class Client {
2448
2985
  hours: 3,
2449
2986
  };
2450
2987
  }
2451
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/feedback/tokens`, {
2452
- method: "POST",
2453
- headers: { ...this.headers, "Content-Type": "application/json" },
2454
- body: JSON.stringify(body),
2455
- signal: AbortSignal.timeout(this.timeout_ms),
2456
- ...this.fetchOptions,
2988
+ const serializedBody = JSON.stringify(body);
2989
+ const response = await this.caller.call(async () => {
2990
+ const res = await this._fetch(`${this.apiUrl}/feedback/tokens`, {
2991
+ method: "POST",
2992
+ headers: { ...this.headers, "Content-Type": "application/json" },
2993
+ signal: AbortSignal.timeout(this.timeout_ms),
2994
+ ...this.fetchOptions,
2995
+ body: serializedBody,
2996
+ });
2997
+ await (0, error_js_1.raiseForStatus)(res, "create presigned feedback token");
2998
+ return res;
2457
2999
  });
2458
- const result = await response.json();
2459
- return result;
3000
+ return await response.json();
2460
3001
  }
2461
3002
  async createComparativeExperiment({ name, experimentIds, referenceDatasetId, createdAt, description, metadata, id, }) {
2462
3003
  if (experimentIds.length === 0) {
@@ -2481,14 +3022,19 @@ class Client {
2481
3022
  };
2482
3023
  if (metadata)
2483
3024
  body.extra["metadata"] = metadata;
2484
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/comparative`, {
2485
- method: "POST",
2486
- headers: { ...this.headers, "Content-Type": "application/json" },
2487
- body: JSON.stringify(body),
2488
- signal: AbortSignal.timeout(this.timeout_ms),
2489
- ...this.fetchOptions,
3025
+ const serializedBody = JSON.stringify(body);
3026
+ const response = await this.caller.call(async () => {
3027
+ const res = await this._fetch(`${this.apiUrl}/datasets/comparative`, {
3028
+ method: "POST",
3029
+ headers: { ...this.headers, "Content-Type": "application/json" },
3030
+ signal: AbortSignal.timeout(this.timeout_ms),
3031
+ ...this.fetchOptions,
3032
+ body: serializedBody,
3033
+ });
3034
+ await (0, error_js_1.raiseForStatus)(res, "create comparative experiment");
3035
+ return res;
2490
3036
  });
2491
- return await response.json();
3037
+ return response.json();
2492
3038
  }
2493
3039
  /**
2494
3040
  * Retrieves a list of presigned feedback tokens for a given run ID.
@@ -2590,37 +3136,44 @@ class Client {
2590
3136
  * @returns The created AnnotationQueue object
2591
3137
  */
2592
3138
  async createAnnotationQueue(options) {
2593
- const { name, description, queueId } = options;
3139
+ const { name, description, queueId, rubricInstructions } = options;
2594
3140
  const body = {
2595
3141
  name,
2596
3142
  description,
2597
3143
  id: queueId || uuid.v4(),
3144
+ rubric_instructions: rubricInstructions,
2598
3145
  };
2599
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues`, {
2600
- method: "POST",
2601
- headers: { ...this.headers, "Content-Type": "application/json" },
2602
- body: JSON.stringify(Object.fromEntries(Object.entries(body).filter(([_, v]) => v !== undefined))),
2603
- signal: AbortSignal.timeout(this.timeout_ms),
2604
- ...this.fetchOptions,
3146
+ const serializedBody = JSON.stringify(Object.fromEntries(Object.entries(body).filter(([_, v]) => v !== undefined)));
3147
+ const response = await this.caller.call(async () => {
3148
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues`, {
3149
+ method: "POST",
3150
+ headers: { ...this.headers, "Content-Type": "application/json" },
3151
+ signal: AbortSignal.timeout(this.timeout_ms),
3152
+ ...this.fetchOptions,
3153
+ body: serializedBody,
3154
+ });
3155
+ await (0, error_js_1.raiseForStatus)(res, "create annotation queue");
3156
+ return res;
2605
3157
  });
2606
- await (0, error_js_1.raiseForStatus)(response, "create annotation queue");
2607
- const data = await response.json();
2608
- return data;
3158
+ return response.json();
2609
3159
  }
2610
3160
  /**
2611
3161
  * Read an annotation queue with the specified queue ID.
2612
3162
  * @param queueId - The ID of the annotation queue to read
2613
- * @returns The AnnotationQueue object
3163
+ * @returns The AnnotationQueueWithDetails object
2614
3164
  */
2615
3165
  async readAnnotationQueue(queueId) {
2616
- // TODO: Replace when actual endpoint is added
2617
- const queueIteratorResult = await this.listAnnotationQueues({
2618
- queueIds: [queueId],
2619
- }).next();
2620
- if (queueIteratorResult.done) {
2621
- throw new Error(`Annotation queue with ID ${queueId} not found`);
2622
- }
2623
- return queueIteratorResult.value;
3166
+ const response = await this.caller.call(async () => {
3167
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
3168
+ method: "GET",
3169
+ headers: this.headers,
3170
+ signal: AbortSignal.timeout(this.timeout_ms),
3171
+ ...this.fetchOptions,
3172
+ });
3173
+ await (0, error_js_1.raiseForStatus)(res, "read annotation queue");
3174
+ return res;
3175
+ });
3176
+ return response.json();
2624
3177
  }
2625
3178
  /**
2626
3179
  * Update an annotation queue with the specified queue ID.
@@ -2630,28 +3183,39 @@ class Client {
2630
3183
  * @param options.description - The new description for the annotation queue
2631
3184
  */
2632
3185
  async updateAnnotationQueue(queueId, options) {
2633
- const { name, description } = options;
2634
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
2635
- method: "PATCH",
2636
- headers: { ...this.headers, "Content-Type": "application/json" },
2637
- body: JSON.stringify({ name, description }),
2638
- signal: AbortSignal.timeout(this.timeout_ms),
2639
- ...this.fetchOptions,
3186
+ const { name, description, rubricInstructions } = options;
3187
+ const body = JSON.stringify({
3188
+ name,
3189
+ description,
3190
+ rubric_instructions: rubricInstructions,
3191
+ });
3192
+ await this.caller.call(async () => {
3193
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
3194
+ method: "PATCH",
3195
+ headers: { ...this.headers, "Content-Type": "application/json" },
3196
+ signal: AbortSignal.timeout(this.timeout_ms),
3197
+ ...this.fetchOptions,
3198
+ body,
3199
+ });
3200
+ await (0, error_js_1.raiseForStatus)(res, "update annotation queue", true);
3201
+ return res;
2640
3202
  });
2641
- await (0, error_js_1.raiseForStatus)(response, "update annotation queue");
2642
3203
  }
2643
3204
  /**
2644
3205
  * Delete an annotation queue with the specified queue ID.
2645
3206
  * @param queueId - The ID of the annotation queue to delete
2646
3207
  */
2647
3208
  async deleteAnnotationQueue(queueId) {
2648
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
2649
- method: "DELETE",
2650
- headers: { ...this.headers, Accept: "application/json" },
2651
- signal: AbortSignal.timeout(this.timeout_ms),
2652
- ...this.fetchOptions,
3209
+ await this.caller.call(async () => {
3210
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
3211
+ method: "DELETE",
3212
+ headers: { ...this.headers, Accept: "application/json" },
3213
+ signal: AbortSignal.timeout(this.timeout_ms),
3214
+ ...this.fetchOptions,
3215
+ });
3216
+ await (0, error_js_1.raiseForStatus)(res, "delete annotation queue", true);
3217
+ return res;
2653
3218
  });
2654
- await (0, error_js_1.raiseForStatus)(response, "delete annotation queue");
2655
3219
  }
2656
3220
  /**
2657
3221
  * Add runs to an annotation queue with the specified queue ID.
@@ -2659,14 +3223,18 @@ class Client {
2659
3223
  * @param runIds - The IDs of the runs to be added to the annotation queue
2660
3224
  */
2661
3225
  async addRunsToAnnotationQueue(queueId, runIds) {
2662
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs`, {
2663
- method: "POST",
2664
- headers: { ...this.headers, "Content-Type": "application/json" },
2665
- body: JSON.stringify(runIds.map((id, i) => (0, _uuid_js_1.assertUuid)(id, `runIds[${i}]`).toString())),
2666
- signal: AbortSignal.timeout(this.timeout_ms),
2667
- ...this.fetchOptions,
3226
+ const body = JSON.stringify(runIds.map((id, i) => (0, _uuid_js_1.assertUuid)(id, `runIds[${i}]`).toString()));
3227
+ await this.caller.call(async () => {
3228
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs`, {
3229
+ method: "POST",
3230
+ headers: { ...this.headers, "Content-Type": "application/json" },
3231
+ signal: AbortSignal.timeout(this.timeout_ms),
3232
+ ...this.fetchOptions,
3233
+ body,
3234
+ });
3235
+ await (0, error_js_1.raiseForStatus)(res, "add runs to annotation queue", true);
3236
+ return res;
2668
3237
  });
2669
- await (0, error_js_1.raiseForStatus)(response, "add runs to annotation queue");
2670
3238
  }
2671
3239
  /**
2672
3240
  * Get a run from an annotation queue at the specified index.
@@ -2677,14 +3245,17 @@ class Client {
2677
3245
  */
2678
3246
  async getRunFromAnnotationQueue(queueId, index) {
2679
3247
  const baseUrl = `/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/run`;
2680
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}${baseUrl}/${index}`, {
2681
- method: "GET",
2682
- headers: this.headers,
2683
- signal: AbortSignal.timeout(this.timeout_ms),
2684
- ...this.fetchOptions,
3248
+ const response = await this.caller.call(async () => {
3249
+ const res = await this._fetch(`${this.apiUrl}${baseUrl}/${index}`, {
3250
+ method: "GET",
3251
+ headers: this.headers,
3252
+ signal: AbortSignal.timeout(this.timeout_ms),
3253
+ ...this.fetchOptions,
3254
+ });
3255
+ await (0, error_js_1.raiseForStatus)(res, "get run from annotation queue");
3256
+ return res;
2685
3257
  });
2686
- await (0, error_js_1.raiseForStatus)(response, "get run from annotation queue");
2687
- return await response.json();
3258
+ return response.json();
2688
3259
  }
2689
3260
  /**
2690
3261
  * Delete a run from an an annotation queue.
@@ -2692,27 +3263,33 @@ class Client {
2692
3263
  * @param queueRunId - The ID of the run to delete from the annotation queue
2693
3264
  */
2694
3265
  async deleteRunFromAnnotationQueue(queueId, queueRunId) {
2695
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs/${(0, _uuid_js_1.assertUuid)(queueRunId, "queueRunId")}`, {
2696
- method: "DELETE",
2697
- headers: { ...this.headers, Accept: "application/json" },
2698
- signal: AbortSignal.timeout(this.timeout_ms),
2699
- ...this.fetchOptions,
3266
+ await this.caller.call(async () => {
3267
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs/${(0, _uuid_js_1.assertUuid)(queueRunId, "queueRunId")}`, {
3268
+ method: "DELETE",
3269
+ headers: { ...this.headers, Accept: "application/json" },
3270
+ signal: AbortSignal.timeout(this.timeout_ms),
3271
+ ...this.fetchOptions,
3272
+ });
3273
+ await (0, error_js_1.raiseForStatus)(res, "delete run from annotation queue", true);
3274
+ return res;
2700
3275
  });
2701
- await (0, error_js_1.raiseForStatus)(response, "delete run from annotation queue");
2702
3276
  }
2703
3277
  /**
2704
3278
  * Get the size of an annotation queue.
2705
3279
  * @param queueId - The ID of the annotation queue
2706
3280
  */
2707
3281
  async getSizeFromAnnotationQueue(queueId) {
2708
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/size`, {
2709
- method: "GET",
2710
- headers: this.headers,
2711
- signal: AbortSignal.timeout(this.timeout_ms),
2712
- ...this.fetchOptions,
3282
+ const response = await this.caller.call(async () => {
3283
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/size`, {
3284
+ method: "GET",
3285
+ headers: this.headers,
3286
+ signal: AbortSignal.timeout(this.timeout_ms),
3287
+ ...this.fetchOptions,
3288
+ });
3289
+ await (0, error_js_1.raiseForStatus)(res, "get size from annotation queue");
3290
+ return res;
2713
3291
  });
2714
- await (0, error_js_1.raiseForStatus)(response, "get size from annotation queue");
2715
- return await response.json();
3292
+ return response.json();
2716
3293
  }
2717
3294
  async _currentTenantIsOwner(owner) {
2718
3295
  const settings = await this._getSettings();
@@ -2725,22 +3302,17 @@ class Client {
2725
3302
  Requested tenant: ${owner}`);
2726
3303
  }
2727
3304
  async _getLatestCommitHash(promptOwnerAndName) {
2728
- const res = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/commits/${promptOwnerAndName}/?limit=${1}&offset=${0}`, {
2729
- method: "GET",
2730
- headers: this.headers,
2731
- signal: AbortSignal.timeout(this.timeout_ms),
2732
- ...this.fetchOptions,
2733
- });
2734
- const json = await res.json();
2735
- if (!res.ok) {
2736
- const detail = typeof json.detail === "string"
2737
- ? json.detail
2738
- : JSON.stringify(json.detail);
2739
- const error = new Error(`Error ${res.status}: ${res.statusText}\n${detail}`);
2740
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2741
- error.statusCode = res.status;
2742
- throw error;
2743
- }
3305
+ const response = await this.caller.call(async () => {
3306
+ const res = await this._fetch(`${this.apiUrl}/commits/${promptOwnerAndName}/?limit=${1}&offset=${0}`, {
3307
+ method: "GET",
3308
+ headers: this.headers,
3309
+ signal: AbortSignal.timeout(this.timeout_ms),
3310
+ ...this.fetchOptions,
3311
+ });
3312
+ await (0, error_js_1.raiseForStatus)(res, "get latest commit hash");
3313
+ return res;
3314
+ });
3315
+ const json = await response.json();
2744
3316
  if (json.commits.length === 0) {
2745
3317
  return undefined;
2746
3318
  }
@@ -2748,15 +3320,19 @@ class Client {
2748
3320
  }
2749
3321
  async _likeOrUnlikePrompt(promptIdentifier, like) {
2750
3322
  const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
2751
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/likes/${owner}/${promptName}`, {
2752
- method: "POST",
2753
- body: JSON.stringify({ like: like }),
2754
- headers: { ...this.headers, "Content-Type": "application/json" },
2755
- signal: AbortSignal.timeout(this.timeout_ms),
2756
- ...this.fetchOptions,
2757
- });
2758
- await (0, error_js_1.raiseForStatus)(response, `${like ? "like" : "unlike"} prompt`);
2759
- return await response.json();
3323
+ const body = JSON.stringify({ like: like });
3324
+ const response = await this.caller.call(async () => {
3325
+ const res = await this._fetch(`${this.apiUrl}/likes/${owner}/${promptName}`, {
3326
+ method: "POST",
3327
+ headers: { ...this.headers, "Content-Type": "application/json" },
3328
+ signal: AbortSignal.timeout(this.timeout_ms),
3329
+ ...this.fetchOptions,
3330
+ body,
3331
+ });
3332
+ await (0, error_js_1.raiseForStatus)(res, `${like ? "like" : "unlike"} prompt`);
3333
+ return res;
3334
+ });
3335
+ return response.json();
2760
3336
  }
2761
3337
  async _getPromptUrl(promptIdentifier) {
2762
3338
  const [owner, promptName, commitHash] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
@@ -2810,18 +3386,21 @@ class Client {
2810
3386
  }
2811
3387
  async getPrompt(promptIdentifier) {
2812
3388
  const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
2813
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
2814
- method: "GET",
2815
- headers: this.headers,
2816
- signal: AbortSignal.timeout(this.timeout_ms),
2817
- ...this.fetchOptions,
3389
+ const response = await this.caller.call(async () => {
3390
+ const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
3391
+ method: "GET",
3392
+ headers: this.headers,
3393
+ signal: AbortSignal.timeout(this.timeout_ms),
3394
+ ...this.fetchOptions,
3395
+ });
3396
+ if (res?.status === 404) {
3397
+ return null;
3398
+ }
3399
+ await (0, error_js_1.raiseForStatus)(res, "get prompt");
3400
+ return res;
2818
3401
  });
2819
- if (response.status === 404) {
2820
- return null;
2821
- }
2822
- await (0, error_js_1.raiseForStatus)(response, "get prompt");
2823
- const result = await response.json();
2824
- if (result.repo) {
3402
+ const result = await response?.json();
3403
+ if (result?.repo) {
2825
3404
  return result.repo;
2826
3405
  }
2827
3406
  else {
@@ -2832,7 +3411,7 @@ class Client {
2832
3411
  const settings = await this._getSettings();
2833
3412
  if (options?.isPublic && !settings.tenant_handle) {
2834
3413
  throw new Error(`Cannot create a public prompt without first\n
2835
- creating a LangChain Hub handle.
3414
+ creating a LangChain Hub handle.
2836
3415
  You can add a handle by creating a public prompt at:\n
2837
3416
  https://smith.langchain.com/prompts`);
2838
3417
  }
@@ -2847,14 +3426,18 @@ class Client {
2847
3426
  ...(options?.tags && { tags: options.tags }),
2848
3427
  is_public: !!options?.isPublic,
2849
3428
  };
2850
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/repos/`, {
2851
- method: "POST",
2852
- headers: { ...this.headers, "Content-Type": "application/json" },
2853
- body: JSON.stringify(data),
2854
- signal: AbortSignal.timeout(this.timeout_ms),
2855
- ...this.fetchOptions,
2856
- });
2857
- await (0, error_js_1.raiseForStatus)(response, "create prompt");
3429
+ const body = JSON.stringify(data);
3430
+ const response = await this.caller.call(async () => {
3431
+ const res = await this._fetch(`${this.apiUrl}/repos/`, {
3432
+ method: "POST",
3433
+ headers: { ...this.headers, "Content-Type": "application/json" },
3434
+ signal: AbortSignal.timeout(this.timeout_ms),
3435
+ ...this.fetchOptions,
3436
+ body,
3437
+ });
3438
+ await (0, error_js_1.raiseForStatus)(res, "create prompt");
3439
+ return res;
3440
+ });
2858
3441
  const { repo } = await response.json();
2859
3442
  return repo;
2860
3443
  }
@@ -2870,14 +3453,18 @@ class Client {
2870
3453
  manifest: JSON.parse(JSON.stringify(object)),
2871
3454
  parent_commit: resolvedParentCommitHash,
2872
3455
  };
2873
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/commits/${owner}/${promptName}`, {
2874
- method: "POST",
2875
- headers: { ...this.headers, "Content-Type": "application/json" },
2876
- body: JSON.stringify(payload),
2877
- signal: AbortSignal.timeout(this.timeout_ms),
2878
- ...this.fetchOptions,
2879
- });
2880
- await (0, error_js_1.raiseForStatus)(response, "create commit");
3456
+ const body = JSON.stringify(payload);
3457
+ const response = await this.caller.call(async () => {
3458
+ const res = await this._fetch(`${this.apiUrl}/commits/${owner}/${promptName}`, {
3459
+ method: "POST",
3460
+ headers: { ...this.headers, "Content-Type": "application/json" },
3461
+ signal: AbortSignal.timeout(this.timeout_ms),
3462
+ ...this.fetchOptions,
3463
+ body,
3464
+ });
3465
+ await (0, error_js_1.raiseForStatus)(res, "create commit");
3466
+ return res;
3467
+ });
2881
3468
  const result = await response.json();
2882
3469
  return this._getPromptUrl(`${owner}/${promptName}${result.commit_hash ? `:${result.commit_hash}` : ""}`);
2883
3470
  }
@@ -2890,8 +3477,8 @@ class Client {
2890
3477
  return this._updateExamplesMultipart(datasetId, updates);
2891
3478
  }
2892
3479
  async _updateExamplesMultipart(datasetId, updates = []) {
2893
- if (!(await this._getMultiPartSupport())) {
2894
- throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
3480
+ if (!(await this._getDatasetExamplesMultiPartSupport())) {
3481
+ throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
2895
3482
  }
2896
3483
  const formData = new FormData();
2897
3484
  for (const example of updates) {
@@ -2902,14 +3489,14 @@ class Client {
2902
3489
  ...(example.split && { split: example.split }),
2903
3490
  };
2904
3491
  // Add main example data
2905
- const stringifiedExample = (0, index_js_2.serialize)(exampleBody);
3492
+ const stringifiedExample = (0, index_js_2.serialize)(exampleBody, `Serializing body for example with id: ${exampleId}`);
2906
3493
  const exampleBlob = new Blob([stringifiedExample], {
2907
3494
  type: "application/json",
2908
3495
  });
2909
3496
  formData.append(exampleId, exampleBlob);
2910
3497
  // Add inputs if present
2911
3498
  if (example.inputs) {
2912
- const stringifiedInputs = (0, index_js_2.serialize)(example.inputs);
3499
+ const stringifiedInputs = (0, index_js_2.serialize)(example.inputs, `Serializing inputs for example with id: ${exampleId}`);
2913
3500
  const inputsBlob = new Blob([stringifiedInputs], {
2914
3501
  type: "application/json",
2915
3502
  });
@@ -2917,7 +3504,7 @@ class Client {
2917
3504
  }
2918
3505
  // Add outputs if present
2919
3506
  if (example.outputs) {
2920
- const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs);
3507
+ const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs, `Serializing outputs whle updating example with id: ${exampleId}`);
2921
3508
  const outputsBlob = new Blob([stringifiedOutputs], {
2922
3509
  type: "application/json",
2923
3510
  });
@@ -2942,7 +3529,7 @@ class Client {
2942
3529
  }
2943
3530
  }
2944
3531
  if (example.attachments_operations) {
2945
- const stringifiedAttachmentsOperations = (0, index_js_2.serialize)(example.attachments_operations);
3532
+ const stringifiedAttachmentsOperations = (0, index_js_2.serialize)(example.attachments_operations, `Serializing attachments while updating example with id: ${exampleId}`);
2946
3533
  const attachmentsOperationsBlob = new Blob([stringifiedAttachmentsOperations], {
2947
3534
  type: "application/json",
2948
3535
  });
@@ -2950,13 +3537,18 @@ class Client {
2950
3537
  }
2951
3538
  }
2952
3539
  const datasetIdToUse = datasetId ?? updates[0]?.dataset_id;
2953
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/v1/platform/datasets/${datasetIdToUse}/examples`, {
2954
- method: "PATCH",
2955
- headers: this.headers,
2956
- body: formData,
3540
+ const response = await this.caller.call(async () => {
3541
+ const res = await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${datasetIdToUse}/examples`)}`, {
3542
+ method: "PATCH",
3543
+ headers: this.headers,
3544
+ signal: AbortSignal.timeout(this.timeout_ms),
3545
+ ...this.fetchOptions,
3546
+ body: formData,
3547
+ });
3548
+ await (0, error_js_1.raiseForStatus)(res, "update examples");
3549
+ return res;
2957
3550
  });
2958
- const result = await response.json();
2959
- return result;
3551
+ return response.json();
2960
3552
  }
2961
3553
  /**
2962
3554
  * Upload examples with attachments using multipart form data.
@@ -2968,8 +3560,8 @@ class Client {
2968
3560
  return this._uploadExamplesMultipart(datasetId, uploads);
2969
3561
  }
2970
3562
  async _uploadExamplesMultipart(datasetId, uploads = []) {
2971
- if (!(await this._getMultiPartSupport())) {
2972
- throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
3563
+ if (!(await this._getDatasetExamplesMultiPartSupport())) {
3564
+ throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
2973
3565
  }
2974
3566
  const formData = new FormData();
2975
3567
  for (const example of uploads) {
@@ -2988,14 +3580,14 @@ class Client {
2988
3580
  }),
2989
3581
  };
2990
3582
  // Add main example data
2991
- const stringifiedExample = (0, index_js_2.serialize)(exampleBody);
3583
+ const stringifiedExample = (0, index_js_2.serialize)(exampleBody, `Serializing body for uploaded example with id: ${exampleId}`);
2992
3584
  const exampleBlob = new Blob([stringifiedExample], {
2993
3585
  type: "application/json",
2994
3586
  });
2995
3587
  formData.append(exampleId, exampleBlob);
2996
3588
  // Add inputs if present
2997
3589
  if (example.inputs) {
2998
- const stringifiedInputs = (0, index_js_2.serialize)(example.inputs);
3590
+ const stringifiedInputs = (0, index_js_2.serialize)(example.inputs, `Serializing inputs for uploaded example with id: ${exampleId}`);
2999
3591
  const inputsBlob = new Blob([stringifiedInputs], {
3000
3592
  type: "application/json",
3001
3593
  });
@@ -3003,7 +3595,7 @@ class Client {
3003
3595
  }
3004
3596
  // Add outputs if present
3005
3597
  if (example.outputs) {
3006
- const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs);
3598
+ const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs, `Serializing outputs for uploaded example with id: ${exampleId}`);
3007
3599
  const outputsBlob = new Blob([stringifiedOutputs], {
3008
3600
  type: "application/json",
3009
3601
  });
@@ -3028,13 +3620,18 @@ class Client {
3028
3620
  }
3029
3621
  }
3030
3622
  }
3031
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/v1/platform/datasets/${datasetId}/examples`, {
3032
- method: "POST",
3033
- headers: this.headers,
3034
- body: formData,
3623
+ const response = await this.caller.call(async () => {
3624
+ const res = await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${datasetId}/examples`)}`, {
3625
+ method: "POST",
3626
+ headers: this.headers,
3627
+ signal: AbortSignal.timeout(this.timeout_ms),
3628
+ ...this.fetchOptions,
3629
+ body: formData,
3630
+ });
3631
+ await (0, error_js_1.raiseForStatus)(res, "upload examples");
3632
+ return res;
3035
3633
  });
3036
- const result = await response.json();
3037
- return result;
3634
+ return response.json();
3038
3635
  }
3039
3636
  async updatePrompt(promptIdentifier, options) {
3040
3637
  if (!(await this.promptExists(promptIdentifier))) {
@@ -3059,17 +3656,21 @@ class Client {
3059
3656
  if (Object.keys(payload).length === 0) {
3060
3657
  throw new Error("No valid update options provided");
3061
3658
  }
3062
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
3063
- method: "PATCH",
3064
- body: JSON.stringify(payload),
3065
- headers: {
3066
- ...this.headers,
3067
- "Content-Type": "application/json",
3068
- },
3069
- signal: AbortSignal.timeout(this.timeout_ms),
3070
- ...this.fetchOptions,
3659
+ const body = JSON.stringify(payload);
3660
+ const response = await this.caller.call(async () => {
3661
+ const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
3662
+ method: "PATCH",
3663
+ headers: {
3664
+ ...this.headers,
3665
+ "Content-Type": "application/json",
3666
+ },
3667
+ signal: AbortSignal.timeout(this.timeout_ms),
3668
+ ...this.fetchOptions,
3669
+ body,
3670
+ });
3671
+ await (0, error_js_1.raiseForStatus)(res, "update prompt");
3672
+ return res;
3071
3673
  });
3072
- await (0, error_js_1.raiseForStatus)(response, "update prompt");
3073
3674
  return response.json();
3074
3675
  }
3075
3676
  async deletePrompt(promptIdentifier) {
@@ -3080,23 +3681,30 @@ class Client {
3080
3681
  if (!(await this._currentTenantIsOwner(owner))) {
3081
3682
  throw await this._ownerConflictError("delete a prompt", owner);
3082
3683
  }
3083
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
3084
- method: "DELETE",
3085
- headers: this.headers,
3086
- signal: AbortSignal.timeout(this.timeout_ms),
3087
- ...this.fetchOptions,
3684
+ const response = await this.caller.call(async () => {
3685
+ const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
3686
+ method: "DELETE",
3687
+ headers: this.headers,
3688
+ signal: AbortSignal.timeout(this.timeout_ms),
3689
+ ...this.fetchOptions,
3690
+ });
3691
+ await (0, error_js_1.raiseForStatus)(res, "delete prompt");
3692
+ return res;
3088
3693
  });
3089
- return await response.json();
3694
+ return response.json();
3090
3695
  }
3091
3696
  async pullPromptCommit(promptIdentifier, options) {
3092
3697
  const [owner, promptName, commitHash] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
3093
- const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
3094
- method: "GET",
3095
- headers: this.headers,
3096
- signal: AbortSignal.timeout(this.timeout_ms),
3097
- ...this.fetchOptions,
3698
+ const response = await this.caller.call(async () => {
3699
+ const res = await this._fetch(`${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
3700
+ method: "GET",
3701
+ headers: this.headers,
3702
+ signal: AbortSignal.timeout(this.timeout_ms),
3703
+ ...this.fetchOptions,
3704
+ });
3705
+ await (0, error_js_1.raiseForStatus)(res, "pull prompt commit");
3706
+ return res;
3098
3707
  });
3099
- await (0, error_js_1.raiseForStatus)(response, "pull prompt commit");
3100
3708
  const result = await response.json();
3101
3709
  return {
3102
3710
  owner,
@@ -3249,15 +3857,18 @@ class Client {
3249
3857
  *
3250
3858
  * @returns A promise that resolves once all currently pending traces have sent.
3251
3859
  */
3252
- awaitPendingTraceBatches() {
3860
+ async awaitPendingTraceBatches() {
3253
3861
  if (this.manualFlushMode) {
3254
3862
  console.warn("[WARNING]: When tracing in manual flush mode, you must call `await client.flush()` manually to submit trace batches.");
3255
3863
  return Promise.resolve();
3256
3864
  }
3257
- return Promise.all([
3865
+ await Promise.all([
3258
3866
  ...this.autoBatchQueue.items.map(({ itemPromise }) => itemPromise),
3259
3867
  this.batchIngestCaller.queue.onIdle(),
3260
3868
  ]);
3869
+ if (this.langSmithToOTELTranslator !== undefined) {
3870
+ await (0, otel_js_1.getDefaultOTLPTracerComponents)()?.DEFAULT_LANGSMITH_SPAN_PROCESSOR?.forceFlush();
3871
+ }
3261
3872
  }
3262
3873
  }
3263
3874
  exports.Client = Client;