@nocobase/plugin-ai 1.9.32 → 1.9.34

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
@@ -1,17 +1,19 @@
1
1
  import * as uuid from "uuid";
2
+ import { LangSmithToOTELTranslator, } from "./experimental/otel/translator.js";
3
+ import { getDefaultOTLPTracerComponents, getOTELTrace, getOTELContext, } from "./singletons/otel.js";
2
4
  import { AsyncCaller } from "./utils/async_caller.js";
3
5
  import { convertLangChainMessageToExample, isLangChainMessage, } from "./utils/messages.js";
4
- import { getEnvironmentVariable, getLangChainEnvVarsMetadata, getLangSmithEnvironmentVariable, getRuntimeEnvironment, } from "./utils/env.js";
6
+ import { getEnvironmentVariable, getLangSmithEnvVarsMetadata, getLangSmithEnvironmentVariable, getRuntimeEnvironment, getOtelEnabled, getEnv, } from "./utils/env.js";
5
7
  import { __version__ } from "./index.js";
6
8
  import { assertUuid } from "./utils/_uuid.js";
7
9
  import { warnOnce } from "./utils/warn.js";
8
10
  import { parsePromptIdentifier } from "./utils/prompts.js";
9
11
  import { raiseForStatus } from "./utils/error.js";
10
- import { _getFetchImplementation } from "./singletons/fetch.js";
12
+ import { _globalFetchImplementationIsNodeFetch, _getFetchImplementation, } from "./singletons/fetch.js";
11
13
  import { serialize as serializePayloadForTracing } from "./utils/fast-safe-stringify/index.js";
12
- export function mergeRuntimeEnvIntoRunCreate(run) {
14
+ export function mergeRuntimeEnvIntoRun(run, cachedEnvVars) {
13
15
  const runtimeEnv = getRuntimeEnvironment();
14
- const envVars = getLangChainEnvVarsMetadata();
16
+ const envVars = cachedEnvVars ?? getLangSmithEnvVarsMetadata();
15
17
  const extra = run.extra ?? {};
16
18
  const metadata = extra.metadata;
17
19
  run.extra = {
@@ -22,16 +24,20 @@ export function mergeRuntimeEnvIntoRunCreate(run) {
22
24
  },
23
25
  metadata: {
24
26
  ...envVars,
25
- ...(envVars.revision_id || run.revision_id
26
- ? { revision_id: run.revision_id ?? envVars.revision_id }
27
+ ...(envVars.revision_id || ("revision_id" in run && run.revision_id)
28
+ ? {
29
+ revision_id: ("revision_id" in run ? run.revision_id : undefined) ??
30
+ envVars.revision_id,
31
+ }
27
32
  : {}),
28
33
  ...metadata,
29
34
  },
30
35
  };
31
36
  return run;
32
37
  }
33
- const getTracingSamplingRate = () => {
34
- const samplingRateStr = getLangSmithEnvironmentVariable("TRACING_SAMPLING_RATE");
38
+ const getTracingSamplingRate = (configRate) => {
39
+ const samplingRateStr = configRate?.toString() ??
40
+ getLangSmithEnvironmentVariable("TRACING_SAMPLING_RATE");
35
41
  if (samplingRateStr === undefined) {
36
42
  return undefined;
37
43
  }
@@ -65,7 +71,7 @@ function trimQuotes(str) {
65
71
  }
66
72
  const handle429 = async (response) => {
67
73
  if (response?.status === 429) {
68
- const retryAfter = parseInt(response.headers.get("retry-after") ?? "30", 10) * 1000;
74
+ const retryAfter = parseInt(response.headers.get("retry-after") ?? "10", 10) * 1000;
69
75
  if (retryAfter > 0) {
70
76
  await new Promise((resolve) => setTimeout(resolve, retryAfter));
71
77
  // Return directly after calling this check
@@ -75,6 +81,13 @@ const handle429 = async (response) => {
75
81
  // Fall back to existing status checks
76
82
  return false;
77
83
  };
84
+ function _formatFeedbackScore(score) {
85
+ if (typeof score === "number") {
86
+ // Truncate at 4 decimal places
87
+ return Number(score.toFixed(4));
88
+ }
89
+ return score;
90
+ }
78
91
  export class AutoBatchQueue {
79
92
  constructor() {
80
93
  Object.defineProperty(this, "items", {
@@ -100,10 +113,13 @@ export class AutoBatchQueue {
100
113
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise
101
114
  itemPromiseResolve = resolve;
102
115
  });
103
- const size = serializePayloadForTracing(item.item).length;
116
+ const size = serializePayloadForTracing(item.item, `Serializing run with id: ${item.item.id}`).length;
104
117
  this.items.push({
105
118
  action: item.action,
106
119
  payload: item.item,
120
+ otelContext: item.otelContext,
121
+ apiKey: item.apiKey,
122
+ apiUrl: item.apiUrl,
107
123
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
108
124
  itemPromiseResolve: itemPromiseResolve,
109
125
  itemPromise,
@@ -112,7 +128,7 @@ export class AutoBatchQueue {
112
128
  this.sizeBytes += size;
113
129
  return itemPromise;
114
130
  }
115
- pop(upToSizeBytes) {
131
+ pop({ upToSizeBytes, upToSize, }) {
116
132
  if (upToSizeBytes < 1) {
117
133
  throw new Error("Number of bytes to pop off may not be less than 1.");
118
134
  }
@@ -120,7 +136,8 @@ export class AutoBatchQueue {
120
136
  let poppedSizeBytes = 0;
121
137
  // Pop items until we reach or exceed the size limit
122
138
  while (poppedSizeBytes + (this.peek()?.size ?? 0) < upToSizeBytes &&
123
- this.items.length > 0) {
139
+ this.items.length > 0 &&
140
+ popped.length < upToSize) {
124
141
  const item = this.items.shift();
125
142
  if (item) {
126
143
  popped.push(item);
@@ -137,15 +154,26 @@ export class AutoBatchQueue {
137
154
  this.sizeBytes -= item.size;
138
155
  }
139
156
  return [
140
- popped.map((it) => ({ action: it.action, item: it.payload })),
157
+ popped.map((it) => ({
158
+ action: it.action,
159
+ item: it.payload,
160
+ otelContext: it.otelContext,
161
+ apiKey: it.apiKey,
162
+ apiUrl: it.apiUrl,
163
+ })),
141
164
  () => popped.forEach((it) => it.itemPromiseResolve()),
142
165
  ];
143
166
  }
144
167
  }
145
- // 20 MB
146
- export const DEFAULT_BATCH_SIZE_LIMIT_BYTES = 20_971_520;
147
- const SERVER_INFO_REQUEST_TIMEOUT = 2500;
168
+ export const DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES = 24 * 1024 * 1024;
169
+ const SERVER_INFO_REQUEST_TIMEOUT_MS = 10000;
170
+ /** Maximum number of operations to batch in a single request. */
171
+ const DEFAULT_BATCH_SIZE_LIMIT = 100;
172
+ const DEFAULT_API_URL = "https://api.smith.langchain.com";
148
173
  export class Client {
174
+ get _fetch() {
175
+ return this.fetchImplementation || _getFetchImplementation(this.debug);
176
+ }
149
177
  constructor(config = {}) {
150
178
  Object.defineProperty(this, "apiKey", {
151
179
  enumerable: true,
@@ -165,6 +193,12 @@ export class Client {
165
193
  writable: true,
166
194
  value: void 0
167
195
  });
196
+ Object.defineProperty(this, "workspaceId", {
197
+ enumerable: true,
198
+ configurable: true,
199
+ writable: true,
200
+ value: void 0
201
+ });
168
202
  Object.defineProperty(this, "caller", {
169
203
  enumerable: true,
170
204
  configurable: true,
@@ -243,6 +277,12 @@ export class Client {
243
277
  writable: true,
244
278
  value: void 0
245
279
  });
280
+ Object.defineProperty(this, "batchSizeLimit", {
281
+ enumerable: true,
282
+ configurable: true,
283
+ writable: true,
284
+ value: void 0
285
+ });
246
286
  Object.defineProperty(this, "fetchOptions", {
247
287
  enumerable: true,
248
288
  configurable: true,
@@ -286,8 +326,38 @@ export class Client {
286
326
  writable: true,
287
327
  value: false
288
328
  });
329
+ Object.defineProperty(this, "langSmithToOTELTranslator", {
330
+ enumerable: true,
331
+ configurable: true,
332
+ writable: true,
333
+ value: void 0
334
+ });
335
+ Object.defineProperty(this, "fetchImplementation", {
336
+ enumerable: true,
337
+ configurable: true,
338
+ writable: true,
339
+ value: void 0
340
+ });
341
+ Object.defineProperty(this, "cachedLSEnvVarsForMetadata", {
342
+ enumerable: true,
343
+ configurable: true,
344
+ writable: true,
345
+ value: void 0
346
+ });
347
+ Object.defineProperty(this, "multipartStreamingDisabled", {
348
+ enumerable: true,
349
+ configurable: true,
350
+ writable: true,
351
+ value: false
352
+ });
353
+ Object.defineProperty(this, "debug", {
354
+ enumerable: true,
355
+ configurable: true,
356
+ writable: true,
357
+ value: getEnvironmentVariable("LANGSMITH_DEBUG") === "true"
358
+ });
289
359
  const defaultConfig = Client.getDefaultClientConfig();
290
- this.tracingSampleRate = getTracingSamplingRate();
360
+ this.tracingSampleRate = getTracingSamplingRate(config.tracingSamplingRate);
291
361
  this.apiUrl = trimQuotes(config.apiUrl ?? defaultConfig.apiUrl) ?? "";
292
362
  if (this.apiUrl.endsWith("/")) {
293
363
  this.apiUrl = this.apiUrl.slice(0, -1);
@@ -297,18 +367,26 @@ export class Client {
297
367
  if (this.webUrl?.endsWith("/")) {
298
368
  this.webUrl = this.webUrl.slice(0, -1);
299
369
  }
370
+ this.workspaceId = trimQuotes(config.workspaceId ?? getLangSmithEnvironmentVariable("WORKSPACE_ID"));
300
371
  this.timeout_ms = config.timeout_ms ?? 90_000;
301
- this.caller = new AsyncCaller(config.callerOptions ?? {});
372
+ this.caller = new AsyncCaller({
373
+ ...(config.callerOptions ?? {}),
374
+ maxRetries: 4,
375
+ debug: config.debug ?? this.debug,
376
+ });
302
377
  this.traceBatchConcurrency =
303
378
  config.traceBatchConcurrency ?? this.traceBatchConcurrency;
304
379
  if (this.traceBatchConcurrency < 1) {
305
380
  throw new Error("Trace batch concurrency must be positive.");
306
381
  }
382
+ this.debug = config.debug ?? this.debug;
383
+ this.fetchImplementation = config.fetchImplementation;
307
384
  this.batchIngestCaller = new AsyncCaller({
308
385
  maxRetries: 2,
309
386
  maxConcurrency: this.traceBatchConcurrency,
310
387
  ...(config.callerOptions ?? {}),
311
388
  onFailedResponseHook: handle429,
389
+ debug: config.debug ?? this.debug,
312
390
  });
313
391
  this.hideInputs =
314
392
  config.hideInputs ?? config.anonymizer ?? defaultConfig.hideInputs;
@@ -318,13 +396,18 @@ export class Client {
318
396
  this.blockOnRootRunFinalization =
319
397
  config.blockOnRootRunFinalization ?? this.blockOnRootRunFinalization;
320
398
  this.batchSizeBytesLimit = config.batchSizeBytesLimit;
399
+ this.batchSizeLimit = config.batchSizeLimit;
321
400
  this.fetchOptions = config.fetchOptions || {};
322
401
  this.manualFlushMode = config.manualFlushMode ?? this.manualFlushMode;
402
+ if (getOtelEnabled()) {
403
+ this.langSmithToOTELTranslator = new LangSmithToOTELTranslator();
404
+ }
405
+ // Cache metadata env vars once during construction to avoid repeatedly scanning process.env
406
+ this.cachedLSEnvVarsForMetadata = getLangSmithEnvVarsMetadata();
323
407
  }
324
408
  static getDefaultClientConfig() {
325
409
  const apiKey = getLangSmithEnvironmentVariable("API_KEY");
326
- const apiUrl = getLangSmithEnvironmentVariable("ENDPOINT") ??
327
- "https://api.smith.langchain.com";
410
+ const apiUrl = getLangSmithEnvironmentVariable("ENDPOINT") ?? DEFAULT_API_URL;
328
411
  const hideInputs = getLangSmithEnvironmentVariable("HIDE_INPUTS") === "true";
329
412
  const hideOutputs = getLangSmithEnvironmentVariable("HIDE_OUTPUTS") === "true";
330
413
  return {
@@ -376,9 +459,17 @@ export class Client {
376
459
  if (this.apiKey) {
377
460
  headers["x-api-key"] = `${this.apiKey}`;
378
461
  }
462
+ if (this.workspaceId) {
463
+ headers["x-tenant-id"] = this.workspaceId;
464
+ }
379
465
  return headers;
380
466
  }
381
- processInputs(inputs) {
467
+ _getPlatformEndpointPath(path) {
468
+ // Check if apiUrl already ends with /v1 or /v1/ to avoid double /v1/v1/ paths
469
+ const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
470
+ return needsV1Prefix ? `/v1/platform/${path}` : `/platform/${path}`;
471
+ }
472
+ async processInputs(inputs) {
382
473
  if (this.hideInputs === false) {
383
474
  return inputs;
384
475
  }
@@ -390,7 +481,7 @@ export class Client {
390
481
  }
391
482
  return inputs;
392
483
  }
393
- processOutputs(outputs) {
484
+ async processOutputs(outputs) {
394
485
  if (this.hideOutputs === false) {
395
486
  return outputs;
396
487
  }
@@ -402,26 +493,29 @@ export class Client {
402
493
  }
403
494
  return outputs;
404
495
  }
405
- prepareRunCreateOrUpdateInputs(run) {
496
+ async prepareRunCreateOrUpdateInputs(run) {
406
497
  const runParams = { ...run };
407
498
  if (runParams.inputs !== undefined) {
408
- runParams.inputs = this.processInputs(runParams.inputs);
499
+ runParams.inputs = await this.processInputs(runParams.inputs);
409
500
  }
410
501
  if (runParams.outputs !== undefined) {
411
- runParams.outputs = this.processOutputs(runParams.outputs);
502
+ runParams.outputs = await this.processOutputs(runParams.outputs);
412
503
  }
413
504
  return runParams;
414
505
  }
415
506
  async _getResponse(path, queryParams) {
416
507
  const paramsString = queryParams?.toString() ?? "";
417
508
  const url = `${this.apiUrl}${path}?${paramsString}`;
418
- const response = await this.caller.call(_getFetchImplementation(), url, {
419
- method: "GET",
420
- headers: this.headers,
421
- signal: AbortSignal.timeout(this.timeout_ms),
422
- ...this.fetchOptions,
509
+ const response = await this.caller.call(async () => {
510
+ const res = await this._fetch(url, {
511
+ method: "GET",
512
+ headers: this.headers,
513
+ signal: AbortSignal.timeout(this.timeout_ms),
514
+ ...this.fetchOptions,
515
+ });
516
+ await raiseForStatus(res, `fetch ${path}`);
517
+ return res;
423
518
  });
424
- await raiseForStatus(response, `Failed to fetch ${path}`);
425
519
  return response;
426
520
  }
427
521
  async _get(path, queryParams) {
@@ -435,13 +529,16 @@ export class Client {
435
529
  queryParams.set("offset", String(offset));
436
530
  queryParams.set("limit", String(limit));
437
531
  const url = `${this.apiUrl}${path}?${queryParams}`;
438
- const response = await this.caller.call(_getFetchImplementation(), url, {
439
- method: "GET",
440
- headers: this.headers,
441
- signal: AbortSignal.timeout(this.timeout_ms),
442
- ...this.fetchOptions,
532
+ const response = await this.caller.call(async () => {
533
+ const res = await this._fetch(url, {
534
+ method: "GET",
535
+ headers: this.headers,
536
+ signal: AbortSignal.timeout(this.timeout_ms),
537
+ ...this.fetchOptions,
538
+ });
539
+ await raiseForStatus(res, `fetch ${path}`);
540
+ return res;
443
541
  });
444
- await raiseForStatus(response, `Failed to fetch ${path}`);
445
542
  const items = transform
446
543
  ? transform(await response.json())
447
544
  : await response.json();
@@ -458,12 +555,17 @@ export class Client {
458
555
  async *_getCursorPaginatedList(path, body = null, requestMethod = "POST", dataKey = "runs") {
459
556
  const bodyParams = body ? { ...body } : {};
460
557
  while (true) {
461
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}${path}`, {
462
- method: requestMethod,
463
- headers: { ...this.headers, "Content-Type": "application/json" },
464
- signal: AbortSignal.timeout(this.timeout_ms),
465
- ...this.fetchOptions,
466
- body: JSON.stringify(bodyParams),
558
+ const body = JSON.stringify(bodyParams);
559
+ const response = await this.caller.call(async () => {
560
+ const res = await this._fetch(`${this.apiUrl}${path}`, {
561
+ method: requestMethod,
562
+ headers: { ...this.headers, "Content-Type": "application/json" },
563
+ signal: AbortSignal.timeout(this.timeout_ms),
564
+ ...this.fetchOptions,
565
+ body,
566
+ });
567
+ await raiseForStatus(res, `fetch ${path}`);
568
+ return res;
467
569
  });
468
570
  const responseBody = await response.json();
469
571
  if (!responseBody) {
@@ -483,6 +585,13 @@ export class Client {
483
585
  bodyParams.cursor = cursors.next;
484
586
  }
485
587
  }
588
+ // Allows mocking for tests
589
+ _shouldSample() {
590
+ if (this.tracingSampleRate === undefined) {
591
+ return true;
592
+ }
593
+ return Math.random() < this.tracingSampleRate;
594
+ }
486
595
  _filterForSampling(runs, patch = false) {
487
596
  if (this.tracingSampleRate === undefined) {
488
597
  return runs;
@@ -490,25 +599,36 @@ export class Client {
490
599
  if (patch) {
491
600
  const sampled = [];
492
601
  for (const run of runs) {
493
- if (!this.filteredPostUuids.has(run.id)) {
602
+ if (!this.filteredPostUuids.has(run.trace_id)) {
494
603
  sampled.push(run);
495
604
  }
496
- else {
497
- this.filteredPostUuids.delete(run.id);
605
+ else if (run.id === run.trace_id) {
606
+ this.filteredPostUuids.delete(run.trace_id);
498
607
  }
499
608
  }
500
609
  return sampled;
501
610
  }
502
611
  else {
612
+ // For new runs, sample at trace level to maintain consistency
503
613
  const sampled = [];
504
614
  for (const run of runs) {
505
- if ((run.id !== run.trace_id &&
506
- !this.filteredPostUuids.has(run.trace_id)) ||
507
- Math.random() < this.tracingSampleRate) {
508
- sampled.push(run);
615
+ const traceId = run.trace_id ?? run.id;
616
+ // If we've already made a decision about this trace, follow it
617
+ if (this.filteredPostUuids.has(traceId)) {
618
+ continue;
619
+ }
620
+ // For new traces, apply sampling
621
+ if (run.id === traceId) {
622
+ if (this._shouldSample()) {
623
+ sampled.push(run);
624
+ }
625
+ else {
626
+ this.filteredPostUuids.add(traceId);
627
+ }
509
628
  }
510
629
  else {
511
- this.filteredPostUuids.add(run.id);
630
+ // Child runs follow their trace's sampling decision
631
+ sampled.push(run);
512
632
  }
513
633
  }
514
634
  return sampled;
@@ -518,83 +638,163 @@ export class Client {
518
638
  const serverInfo = await this._ensureServerInfo();
519
639
  return (this.batchSizeBytesLimit ??
520
640
  serverInfo.batch_ingest_config?.size_limit_bytes ??
521
- DEFAULT_BATCH_SIZE_LIMIT_BYTES);
641
+ DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES);
642
+ }
643
+ /**
644
+ * Get the maximum number of operations to batch in a single request.
645
+ */
646
+ async _getBatchSizeLimit() {
647
+ const serverInfo = await this._ensureServerInfo();
648
+ return (this.batchSizeLimit ??
649
+ serverInfo.batch_ingest_config?.size_limit ??
650
+ DEFAULT_BATCH_SIZE_LIMIT);
522
651
  }
523
- async _getMultiPartSupport() {
652
+ async _getDatasetExamplesMultiPartSupport() {
524
653
  const serverInfo = await this._ensureServerInfo();
525
654
  return (serverInfo.instance_flags?.dataset_examples_multipart_enabled ?? false);
526
655
  }
527
- drainAutoBatchQueue(batchSizeLimit) {
656
+ drainAutoBatchQueue({ batchSizeLimitBytes, batchSizeLimit, }) {
528
657
  const promises = [];
529
658
  while (this.autoBatchQueue.items.length > 0) {
530
- const [batch, done] = this.autoBatchQueue.pop(batchSizeLimit);
659
+ const [batch, done] = this.autoBatchQueue.pop({
660
+ upToSizeBytes: batchSizeLimitBytes,
661
+ upToSize: batchSizeLimit,
662
+ });
531
663
  if (!batch.length) {
532
664
  done();
533
665
  break;
534
666
  }
535
- const batchPromise = this._processBatch(batch, done).catch(console.error);
536
- promises.push(batchPromise);
667
+ const batchesByDestination = batch.reduce((acc, item) => {
668
+ const apiUrl = item.apiUrl ?? this.apiUrl;
669
+ const apiKey = item.apiKey ?? this.apiKey;
670
+ const isDefault = item.apiKey === this.apiKey && item.apiUrl === this.apiUrl;
671
+ const batchKey = isDefault ? "default" : `${apiUrl}|${apiKey}`;
672
+ if (!acc[batchKey]) {
673
+ acc[batchKey] = [];
674
+ }
675
+ acc[batchKey].push(item);
676
+ return acc;
677
+ }, {});
678
+ const batchPromises = [];
679
+ for (const [batchKey, batch] of Object.entries(batchesByDestination)) {
680
+ const batchPromise = this._processBatch(batch, {
681
+ apiUrl: batchKey === "default" ? undefined : batchKey.split("|")[0],
682
+ apiKey: batchKey === "default" ? undefined : batchKey.split("|")[1],
683
+ });
684
+ batchPromises.push(batchPromise);
685
+ }
686
+ // Wait for all batches to complete, then call the overall done callback
687
+ const allBatchesPromise = Promise.all(batchPromises).finally(done);
688
+ promises.push(allBatchesPromise);
537
689
  }
538
690
  return Promise.all(promises);
539
691
  }
540
- async _processBatch(batch, done) {
692
+ async _processBatch(batch, options) {
541
693
  if (!batch.length) {
542
- done();
543
694
  return;
544
695
  }
545
696
  try {
546
- const ingestParams = {
547
- runCreates: batch
548
- .filter((item) => item.action === "create")
549
- .map((item) => item.item),
550
- runUpdates: batch
551
- .filter((item) => item.action === "update")
552
- .map((item) => item.item),
553
- };
554
- const serverInfo = await this._ensureServerInfo();
555
- if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
556
- await this.multipartIngestRuns(ingestParams);
697
+ if (this.langSmithToOTELTranslator !== undefined) {
698
+ this._sendBatchToOTELTranslator(batch);
557
699
  }
558
700
  else {
559
- await this.batchIngestRuns(ingestParams);
701
+ const ingestParams = {
702
+ runCreates: batch
703
+ .filter((item) => item.action === "create")
704
+ .map((item) => item.item),
705
+ runUpdates: batch
706
+ .filter((item) => item.action === "update")
707
+ .map((item) => item.item),
708
+ };
709
+ const serverInfo = await this._ensureServerInfo();
710
+ if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
711
+ const useGzip = serverInfo?.instance_flags?.gzip_body_enabled;
712
+ await this.multipartIngestRuns(ingestParams, { ...options, useGzip });
713
+ }
714
+ else {
715
+ await this.batchIngestRuns(ingestParams, options);
716
+ }
560
717
  }
561
718
  }
562
- finally {
563
- done();
719
+ catch (e) {
720
+ console.error("Error exporting batch:", e);
721
+ }
722
+ }
723
+ _sendBatchToOTELTranslator(batch) {
724
+ if (this.langSmithToOTELTranslator !== undefined) {
725
+ const otelContextMap = new Map();
726
+ const operations = [];
727
+ for (const item of batch) {
728
+ if (item.item.id && item.otelContext) {
729
+ otelContextMap.set(item.item.id, item.otelContext);
730
+ if (item.action === "create") {
731
+ operations.push({
732
+ operation: "post",
733
+ id: item.item.id,
734
+ trace_id: item.item.trace_id ?? item.item.id,
735
+ run: item.item,
736
+ });
737
+ }
738
+ else {
739
+ operations.push({
740
+ operation: "patch",
741
+ id: item.item.id,
742
+ trace_id: item.item.trace_id ?? item.item.id,
743
+ run: item.item,
744
+ });
745
+ }
746
+ }
747
+ }
748
+ this.langSmithToOTELTranslator.exportBatch(operations, otelContextMap);
564
749
  }
565
750
  }
566
751
  async processRunOperation(item) {
567
752
  clearTimeout(this.autoBatchTimeout);
568
753
  this.autoBatchTimeout = undefined;
569
- if (item.action === "create") {
570
- item.item = mergeRuntimeEnvIntoRunCreate(item.item);
571
- }
754
+ item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata);
572
755
  const itemPromise = this.autoBatchQueue.push(item);
573
756
  if (this.manualFlushMode) {
574
757
  // Rely on manual flushing in serverless environments
575
758
  return itemPromise;
576
759
  }
577
760
  const sizeLimitBytes = await this._getBatchSizeLimitBytes();
578
- if (this.autoBatchQueue.sizeBytes > sizeLimitBytes) {
579
- void this.drainAutoBatchQueue(sizeLimitBytes);
761
+ const sizeLimit = await this._getBatchSizeLimit();
762
+ if (this.autoBatchQueue.sizeBytes > sizeLimitBytes ||
763
+ this.autoBatchQueue.items.length > sizeLimit) {
764
+ void this.drainAutoBatchQueue({
765
+ batchSizeLimitBytes: sizeLimitBytes,
766
+ batchSizeLimit: sizeLimit,
767
+ });
580
768
  }
581
769
  if (this.autoBatchQueue.items.length > 0) {
582
770
  this.autoBatchTimeout = setTimeout(() => {
583
771
  this.autoBatchTimeout = undefined;
584
- void this.drainAutoBatchQueue(sizeLimitBytes);
772
+ void this.drainAutoBatchQueue({
773
+ batchSizeLimitBytes: sizeLimitBytes,
774
+ batchSizeLimit: sizeLimit,
775
+ });
585
776
  }, this.autoBatchAggregationDelayMs);
586
777
  }
587
778
  return itemPromise;
588
779
  }
589
780
  async _getServerInfo() {
590
- const response = await _getFetchImplementation()(`${this.apiUrl}/info`, {
591
- method: "GET",
592
- headers: { Accept: "application/json" },
593
- signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT),
594
- ...this.fetchOptions,
781
+ const response = await this.caller.call(async () => {
782
+ const res = await this._fetch(`${this.apiUrl}/info`, {
783
+ method: "GET",
784
+ headers: { Accept: "application/json" },
785
+ signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT_MS),
786
+ ...this.fetchOptions,
787
+ });
788
+ await raiseForStatus(res, "get server info");
789
+ return res;
595
790
  });
596
- await raiseForStatus(response, "get server info");
597
- return response.json();
791
+ const json = await response.json();
792
+ if (this.debug) {
793
+ console.log("\n=== LangSmith Server Configuration ===\n" +
794
+ JSON.stringify(json, null, 2) +
795
+ "\n");
796
+ }
797
+ return json;
598
798
  }
599
799
  async _ensureServerInfo() {
600
800
  if (this._getServerInfoPromise === undefined) {
@@ -604,7 +804,7 @@ export class Client {
604
804
  this._serverInfo = await this._getServerInfo();
605
805
  }
606
806
  catch (e) {
607
- console.warn(`[WARNING]: LangSmith failed to fetch info on supported operations. Falling back to batch operations and default limits.`);
807
+ 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}`);
608
808
  }
609
809
  }
610
810
  return this._serverInfo ?? {};
@@ -628,16 +828,34 @@ export class Client {
628
828
  */
629
829
  async flush() {
630
830
  const sizeLimitBytes = await this._getBatchSizeLimitBytes();
631
- await this.drainAutoBatchQueue(sizeLimitBytes);
831
+ const sizeLimit = await this._getBatchSizeLimit();
832
+ await this.drainAutoBatchQueue({
833
+ batchSizeLimitBytes: sizeLimitBytes,
834
+ batchSizeLimit: sizeLimit,
835
+ });
632
836
  }
633
- async createRun(run) {
837
+ _cloneCurrentOTELContext() {
838
+ const otel_trace = getOTELTrace();
839
+ const otel_context = getOTELContext();
840
+ if (this.langSmithToOTELTranslator !== undefined) {
841
+ const currentSpan = otel_trace.getActiveSpan();
842
+ if (currentSpan) {
843
+ return otel_trace.setSpan(otel_context.active(), currentSpan);
844
+ }
845
+ }
846
+ return undefined;
847
+ }
848
+ async createRun(run, options) {
634
849
  if (!this._filterForSampling([run]).length) {
635
850
  return;
636
851
  }
637
- const headers = { ...this.headers, "Content-Type": "application/json" };
852
+ const headers = {
853
+ ...this.headers,
854
+ "Content-Type": "application/json",
855
+ };
638
856
  const session_name = run.project_name;
639
857
  delete run.project_name;
640
- const runCreate = this.prepareRunCreateOrUpdateInputs({
858
+ const runCreate = await this.prepareRunCreateOrUpdateInputs({
641
859
  session_name,
642
860
  ...run,
643
861
  start_time: run.start_time ?? Date.now(),
@@ -645,32 +863,46 @@ export class Client {
645
863
  if (this.autoBatchTracing &&
646
864
  runCreate.trace_id !== undefined &&
647
865
  runCreate.dotted_order !== undefined) {
866
+ const otelContext = this._cloneCurrentOTELContext();
648
867
  void this.processRunOperation({
649
868
  action: "create",
650
869
  item: runCreate,
870
+ otelContext,
871
+ apiKey: options?.apiKey,
872
+ apiUrl: options?.apiUrl,
651
873
  }).catch(console.error);
652
874
  return;
653
875
  }
654
- const mergedRunCreateParam = mergeRuntimeEnvIntoRunCreate(runCreate);
655
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/runs`, {
656
- method: "POST",
657
- headers,
658
- body: serializePayloadForTracing(mergedRunCreateParam),
659
- signal: AbortSignal.timeout(this.timeout_ms),
660
- ...this.fetchOptions,
876
+ const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata);
877
+ if (options?.apiKey !== undefined) {
878
+ headers["x-api-key"] = options.apiKey;
879
+ }
880
+ if (options?.workspaceId !== undefined) {
881
+ headers["x-tenant-id"] = options.workspaceId;
882
+ }
883
+ const body = serializePayloadForTracing(mergedRunCreateParam, `Creating run with id: ${mergedRunCreateParam.id}`);
884
+ await this.caller.call(async () => {
885
+ const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs`, {
886
+ method: "POST",
887
+ headers,
888
+ signal: AbortSignal.timeout(this.timeout_ms),
889
+ ...this.fetchOptions,
890
+ body,
891
+ });
892
+ await raiseForStatus(res, "create run", true);
893
+ return res;
661
894
  });
662
- await raiseForStatus(response, "create run", true);
663
895
  }
664
896
  /**
665
897
  * Batch ingest/upsert multiple runs in the Langsmith system.
666
898
  * @param runs
667
899
  */
668
- async batchIngestRuns({ runCreates, runUpdates, }) {
900
+ async batchIngestRuns({ runCreates, runUpdates, }, options) {
669
901
  if (runCreates === undefined && runUpdates === undefined) {
670
902
  return;
671
903
  }
672
- let preparedCreateParams = runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? [];
673
- let preparedUpdateParams = runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? [];
904
+ let preparedCreateParams = await Promise.all(runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? []);
905
+ let preparedUpdateParams = await Promise.all(runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? []);
674
906
  if (preparedCreateParams.length > 0 && preparedUpdateParams.length > 0) {
675
907
  const createById = preparedCreateParams.reduce((params, run) => {
676
908
  if (!run.id) {
@@ -695,8 +927,8 @@ export class Client {
695
927
  preparedUpdateParams = standaloneUpdates;
696
928
  }
697
929
  const rawBatch = {
698
- post: this._filterForSampling(preparedCreateParams),
699
- patch: this._filterForSampling(preparedUpdateParams, true),
930
+ post: preparedCreateParams,
931
+ patch: preparedUpdateParams,
700
932
  };
701
933
  if (!rawBatch.post.length && !rawBatch.patch.length) {
702
934
  return;
@@ -710,34 +942,45 @@ export class Client {
710
942
  const batchItems = rawBatch[key].reverse();
711
943
  let batchItem = batchItems.pop();
712
944
  while (batchItem !== undefined) {
945
+ // Type is wrong but this is a deprecated code path anyway
713
946
  batchChunks[key].push(batchItem);
714
947
  batchItem = batchItems.pop();
715
948
  }
716
949
  }
717
950
  if (batchChunks.post.length > 0 || batchChunks.patch.length > 0) {
718
- await this._postBatchIngestRuns(serializePayloadForTracing(batchChunks));
951
+ const runIds = batchChunks.post
952
+ .map((item) => item.id)
953
+ .concat(batchChunks.patch.map((item) => item.id))
954
+ .join(",");
955
+ await this._postBatchIngestRuns(serializePayloadForTracing(batchChunks, `Ingesting runs with ids: ${runIds}`), options);
719
956
  }
720
957
  }
721
- async _postBatchIngestRuns(body) {
958
+ async _postBatchIngestRuns(body, options) {
722
959
  const headers = {
723
960
  ...this.headers,
724
961
  "Content-Type": "application/json",
725
962
  Accept: "application/json",
726
963
  };
727
- const response = await this.batchIngestCaller.call(_getFetchImplementation(), `${this.apiUrl}/runs/batch`, {
728
- method: "POST",
729
- headers,
730
- body: body,
731
- signal: AbortSignal.timeout(this.timeout_ms),
732
- ...this.fetchOptions,
964
+ if (options?.apiKey !== undefined) {
965
+ headers["x-api-key"] = options.apiKey;
966
+ }
967
+ await this.batchIngestCaller.call(async () => {
968
+ const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/batch`, {
969
+ method: "POST",
970
+ headers,
971
+ signal: AbortSignal.timeout(this.timeout_ms),
972
+ ...this.fetchOptions,
973
+ body,
974
+ });
975
+ await raiseForStatus(res, "batch create run", true);
976
+ return res;
733
977
  });
734
- await raiseForStatus(response, "batch create run", true);
735
978
  }
736
979
  /**
737
980
  * Batch ingest/upsert multiple runs in the Langsmith system.
738
981
  * @param runs
739
982
  */
740
- async multipartIngestRuns({ runCreates, runUpdates, }) {
983
+ async multipartIngestRuns({ runCreates, runUpdates, }, options) {
741
984
  if (runCreates === undefined && runUpdates === undefined) {
742
985
  return;
743
986
  }
@@ -745,7 +988,7 @@ export class Client {
745
988
  const allAttachments = {};
746
989
  let preparedCreateParams = [];
747
990
  for (const create of runCreates ?? []) {
748
- const preparedCreate = this.prepareRunCreateOrUpdateInputs(create);
991
+ const preparedCreate = await this.prepareRunCreateOrUpdateInputs(create);
749
992
  if (preparedCreate.id !== undefined &&
750
993
  preparedCreate.attachments !== undefined) {
751
994
  allAttachments[preparedCreate.id] = preparedCreate.attachments;
@@ -755,7 +998,7 @@ export class Client {
755
998
  }
756
999
  let preparedUpdateParams = [];
757
1000
  for (const update of runUpdates ?? []) {
758
- preparedUpdateParams.push(this.prepareRunCreateOrUpdateInputs(update));
1001
+ preparedUpdateParams.push(await this.prepareRunCreateOrUpdateInputs(update));
759
1002
  }
760
1003
  // require trace_id and dotted_order
761
1004
  const invalidRunCreate = preparedCreateParams.find((runCreate) => {
@@ -807,10 +1050,10 @@ export class Client {
807
1050
  ]) {
808
1051
  for (const originalPayload of payloads) {
809
1052
  // collect fields to be sent as separate parts
810
- const { inputs, outputs, events, attachments, ...payload } = originalPayload;
811
- const fields = { inputs, outputs, events };
1053
+ const { inputs, outputs, events, extra, error, serialized, attachments, ...payload } = originalPayload;
1054
+ const fields = { inputs, outputs, events, extra, error, serialized };
812
1055
  // encode the main run payload
813
- const stringifiedPayload = serializePayloadForTracing(payload);
1056
+ const stringifiedPayload = serializePayloadForTracing(payload, `Serializing for multipart ingestion of run with id: ${payload.id}`);
814
1057
  accumulatedParts.push({
815
1058
  name: `${method}.${payload.id}`,
816
1059
  payload: new Blob([stringifiedPayload], {
@@ -822,7 +1065,7 @@ export class Client {
822
1065
  if (value === undefined) {
823
1066
  continue;
824
1067
  }
825
- const stringifiedValue = serializePayloadForTracing(value);
1068
+ const stringifiedValue = serializePayloadForTracing(value, `Serializing ${key} for multipart ingestion of run with id: ${payload.id}`);
826
1069
  accumulatedParts.push({
827
1070
  name: `${method}.${payload.id}.${key}`,
828
1071
  payload: new Blob([stringifiedValue], {
@@ -864,53 +1107,144 @@ export class Client {
864
1107
  accumulatedContext.push(`trace=${payload.trace_id},id=${payload.id}`);
865
1108
  }
866
1109
  }
867
- await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "));
868
- }
869
- async _sendMultipartRequest(parts, context) {
870
- try {
871
- // Create multipart form data manually using Blobs
872
- const boundary = "----LangSmithFormBoundary" + Math.random().toString(36).slice(2);
873
- const chunks = [];
874
- for (const part of parts) {
875
- // Add field boundary
876
- chunks.push(new Blob([`--${boundary}\r\n`]));
877
- chunks.push(new Blob([
878
- `Content-Disposition: form-data; name="${part.name}"\r\n`,
879
- `Content-Type: ${part.payload.type}\r\n\r\n`,
880
- ]));
881
- chunks.push(part.payload);
882
- chunks.push(new Blob(["\r\n"]));
883
- }
884
- // Add final boundary
885
- chunks.push(new Blob([`--${boundary}--\r\n`]));
886
- // Combine all chunks into a single Blob
887
- const body = new Blob(chunks);
888
- // Convert Blob to ArrayBuffer for compatibility
889
- const arrayBuffer = await body.arrayBuffer();
890
- const res = await this.batchIngestCaller.call(_getFetchImplementation(), `${this.apiUrl}/runs/multipart`, {
891
- method: "POST",
892
- headers: {
1110
+ await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "), options);
1111
+ }
1112
+ async _createNodeFetchBody(parts, boundary) {
1113
+ // Create multipart form data manually using Blobs
1114
+ const chunks = [];
1115
+ for (const part of parts) {
1116
+ // Add field boundary
1117
+ chunks.push(new Blob([`--${boundary}\r\n`]));
1118
+ chunks.push(new Blob([
1119
+ `Content-Disposition: form-data; name="${part.name}"\r\n`,
1120
+ `Content-Type: ${part.payload.type}\r\n\r\n`,
1121
+ ]));
1122
+ chunks.push(part.payload);
1123
+ chunks.push(new Blob(["\r\n"]));
1124
+ }
1125
+ // Add final boundary
1126
+ chunks.push(new Blob([`--${boundary}--\r\n`]));
1127
+ // Combine all chunks into a single Blob
1128
+ const body = new Blob(chunks);
1129
+ // Convert Blob to ArrayBuffer for compatibility
1130
+ const arrayBuffer = await body.arrayBuffer();
1131
+ return arrayBuffer;
1132
+ }
1133
+ async _createMultipartStream(parts, boundary) {
1134
+ const encoder = new TextEncoder();
1135
+ // Create a ReadableStream for streaming the multipart data
1136
+ // Only do special handling if we're using node-fetch
1137
+ const stream = new ReadableStream({
1138
+ async start(controller) {
1139
+ // Helper function to write a chunk to the stream
1140
+ const writeChunk = async (chunk) => {
1141
+ if (typeof chunk === "string") {
1142
+ controller.enqueue(encoder.encode(chunk));
1143
+ }
1144
+ else {
1145
+ controller.enqueue(chunk);
1146
+ }
1147
+ };
1148
+ // Write each part to the stream
1149
+ for (const part of parts) {
1150
+ // Write boundary and headers
1151
+ await writeChunk(`--${boundary}\r\n`);
1152
+ await writeChunk(`Content-Disposition: form-data; name="${part.name}"\r\n`);
1153
+ await writeChunk(`Content-Type: ${part.payload.type}\r\n\r\n`);
1154
+ // Write the payload
1155
+ const payloadStream = part.payload.stream();
1156
+ const reader = payloadStream.getReader();
1157
+ try {
1158
+ let result;
1159
+ while (!(result = await reader.read()).done) {
1160
+ controller.enqueue(result.value);
1161
+ }
1162
+ }
1163
+ finally {
1164
+ reader.releaseLock();
1165
+ }
1166
+ await writeChunk("\r\n");
1167
+ }
1168
+ // Write final boundary
1169
+ await writeChunk(`--${boundary}--\r\n`);
1170
+ controller.close();
1171
+ },
1172
+ });
1173
+ return stream;
1174
+ }
1175
+ async _sendMultipartRequest(parts, context, options) {
1176
+ // Create multipart form data boundary
1177
+ const boundary = "----LangSmithFormBoundary" + Math.random().toString(36).slice(2);
1178
+ const isNodeFetch = _globalFetchImplementationIsNodeFetch();
1179
+ const buildBuffered = () => this._createNodeFetchBody(parts, boundary);
1180
+ const buildStream = () => this._createMultipartStream(parts, boundary);
1181
+ const sendWithRetry = async (bodyFactory) => {
1182
+ return this.batchIngestCaller.call(async () => {
1183
+ const body = await bodyFactory();
1184
+ const headers = {
893
1185
  ...this.headers,
894
1186
  "Content-Type": `multipart/form-data; boundary=${boundary}`,
895
- },
896
- body: arrayBuffer,
897
- signal: AbortSignal.timeout(this.timeout_ms),
898
- ...this.fetchOptions,
1187
+ };
1188
+ if (options?.apiKey !== undefined) {
1189
+ headers["x-api-key"] = options.apiKey;
1190
+ }
1191
+ let transformedBody = body;
1192
+ if (options?.useGzip &&
1193
+ typeof body === "object" &&
1194
+ "pipeThrough" in body) {
1195
+ transformedBody = body.pipeThrough(new CompressionStream("gzip"));
1196
+ headers["Content-Encoding"] = "gzip";
1197
+ }
1198
+ const response = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/multipart`, {
1199
+ method: "POST",
1200
+ headers,
1201
+ body: transformedBody,
1202
+ duplex: "half",
1203
+ signal: AbortSignal.timeout(this.timeout_ms),
1204
+ ...this.fetchOptions,
1205
+ });
1206
+ await raiseForStatus(response, `Failed to send multipart request`, true);
1207
+ return response;
899
1208
  });
900
- await raiseForStatus(res, "ingest multipart runs", true);
1209
+ };
1210
+ try {
1211
+ let res;
1212
+ let streamedAttempt = false;
1213
+ // attempt stream only if not disabled and not using node-fetch or Bun
1214
+ if (!isNodeFetch &&
1215
+ !this.multipartStreamingDisabled &&
1216
+ getEnv() !== "bun") {
1217
+ streamedAttempt = true;
1218
+ res = await sendWithRetry(buildStream);
1219
+ }
1220
+ else {
1221
+ res = await sendWithRetry(buildBuffered);
1222
+ }
1223
+ // if stream fails, fallback to buffered body
1224
+ if ((!this.multipartStreamingDisabled || streamedAttempt) &&
1225
+ res.status === 422 &&
1226
+ (options?.apiUrl ?? this.apiUrl) !== DEFAULT_API_URL) {
1227
+ console.warn(`Streaming multipart upload to ${options?.apiUrl ?? this.apiUrl}/runs/multipart failed. ` +
1228
+ `This usually means the host does not support chunked uploads. ` +
1229
+ `Retrying with a buffered upload for operation "${context}".`);
1230
+ // Disable streaming for future requests
1231
+ this.multipartStreamingDisabled = true;
1232
+ // retry with fully-buffered body
1233
+ res = await sendWithRetry(buildBuffered);
1234
+ }
901
1235
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
902
1236
  }
903
1237
  catch (e) {
904
1238
  console.warn(`${e.message.trim()}\n\nContext: ${context}`);
905
1239
  }
906
1240
  }
907
- async updateRun(runId, run) {
1241
+ async updateRun(runId, run, options) {
908
1242
  assertUuid(runId);
909
1243
  if (run.inputs) {
910
- run.inputs = this.processInputs(run.inputs);
1244
+ run.inputs = await this.processInputs(run.inputs);
911
1245
  }
912
1246
  if (run.outputs) {
913
- run.outputs = this.processOutputs(run.outputs);
1247
+ run.outputs = await this.processOutputs(run.outputs);
914
1248
  }
915
1249
  // TODO: Untangle types
916
1250
  const data = { ...run, id: runId };
@@ -920,34 +1254,60 @@ export class Client {
920
1254
  if (this.autoBatchTracing &&
921
1255
  data.trace_id !== undefined &&
922
1256
  data.dotted_order !== undefined) {
1257
+ const otelContext = this._cloneCurrentOTELContext();
923
1258
  if (run.end_time !== undefined &&
924
1259
  data.parent_run_id === undefined &&
925
1260
  this.blockOnRootRunFinalization &&
926
1261
  !this.manualFlushMode) {
927
1262
  // Trigger batches as soon as a root trace ends and wait to ensure trace finishes
928
1263
  // in serverless environments.
929
- await this.processRunOperation({ action: "update", item: data }).catch(console.error);
1264
+ await this.processRunOperation({
1265
+ action: "update",
1266
+ item: data,
1267
+ otelContext,
1268
+ apiKey: options?.apiKey,
1269
+ apiUrl: options?.apiUrl,
1270
+ }).catch(console.error);
930
1271
  return;
931
1272
  }
932
1273
  else {
933
- void this.processRunOperation({ action: "update", item: data }).catch(console.error);
1274
+ void this.processRunOperation({
1275
+ action: "update",
1276
+ item: data,
1277
+ otelContext,
1278
+ apiKey: options?.apiKey,
1279
+ apiUrl: options?.apiUrl,
1280
+ }).catch(console.error);
934
1281
  }
935
1282
  return;
936
1283
  }
937
- const headers = { ...this.headers, "Content-Type": "application/json" };
938
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/runs/${runId}`, {
939
- method: "PATCH",
940
- headers,
941
- body: serializePayloadForTracing(run),
942
- signal: AbortSignal.timeout(this.timeout_ms),
943
- ...this.fetchOptions,
1284
+ const headers = {
1285
+ ...this.headers,
1286
+ "Content-Type": "application/json",
1287
+ };
1288
+ if (options?.apiKey !== undefined) {
1289
+ headers["x-api-key"] = options.apiKey;
1290
+ }
1291
+ if (options?.workspaceId !== undefined) {
1292
+ headers["x-tenant-id"] = options.workspaceId;
1293
+ }
1294
+ const body = serializePayloadForTracing(run, `Serializing payload to update run with id: ${runId}`);
1295
+ await this.caller.call(async () => {
1296
+ const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/${runId}`, {
1297
+ method: "PATCH",
1298
+ headers,
1299
+ signal: AbortSignal.timeout(this.timeout_ms),
1300
+ ...this.fetchOptions,
1301
+ body,
1302
+ });
1303
+ await raiseForStatus(res, "update run", true);
1304
+ return res;
944
1305
  });
945
- await raiseForStatus(response, "update run", true);
946
1306
  }
947
1307
  async readRun(runId, { loadChildRuns } = { loadChildRuns: false }) {
948
1308
  assertUuid(runId);
949
1309
  let run = await this._get(`/runs/${runId}`);
950
- if (loadChildRuns && run.child_run_ids) {
1310
+ if (loadChildRuns) {
951
1311
  run = await this._loadChildRuns(run);
952
1312
  }
953
1313
  return run;
@@ -986,7 +1346,11 @@ export class Client {
986
1346
  }
987
1347
  }
988
1348
  async _loadChildRuns(run) {
989
- const childRuns = await toArray(this.listRuns({ id: run.child_run_ids }));
1349
+ const childRuns = await toArray(this.listRuns({
1350
+ isRoot: false,
1351
+ projectId: run.session_id,
1352
+ traceId: run.trace_id,
1353
+ }));
990
1354
  const treemap = {};
991
1355
  const runs = {};
992
1356
  // TODO: make dotted order required when the migration finishes
@@ -996,11 +1360,14 @@ export class Client {
996
1360
  childRun.parent_run_id === undefined) {
997
1361
  throw new Error(`Child run ${childRun.id} has no parent`);
998
1362
  }
999
- if (!(childRun.parent_run_id in treemap)) {
1000
- treemap[childRun.parent_run_id] = [];
1363
+ if (childRun.dotted_order?.startsWith(run.dotted_order ?? "") &&
1364
+ childRun.id !== run.id) {
1365
+ if (!(childRun.parent_run_id in treemap)) {
1366
+ treemap[childRun.parent_run_id] = [];
1367
+ }
1368
+ treemap[childRun.parent_run_id].push(childRun);
1369
+ runs[childRun.id] = childRun;
1001
1370
  }
1002
- treemap[childRun.parent_run_id].push(childRun);
1003
- runs[childRun.id] = childRun;
1004
1371
  }
1005
1372
  run.child_runs = treemap[run.id] || [];
1006
1373
  for (const runId in treemap) {
@@ -1093,7 +1460,7 @@ export class Client {
1093
1460
  * });
1094
1461
  */
1095
1462
  async *listRuns(props) {
1096
- const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, } = props;
1463
+ const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, order, } = props;
1097
1464
  let projectIds = [];
1098
1465
  if (projectId) {
1099
1466
  projectIds = Array.isArray(projectId) ? projectId : [projectId];
@@ -1107,7 +1474,6 @@ export class Client {
1107
1474
  }
1108
1475
  const default_select = [
1109
1476
  "app_path",
1110
- "child_run_ids",
1111
1477
  "completion_cost",
1112
1478
  "completion_tokens",
1113
1479
  "dotted_order",
@@ -1152,7 +1518,11 @@ export class Client {
1152
1518
  trace: traceId,
1153
1519
  select: select ? select : default_select,
1154
1520
  is_root: isRoot,
1521
+ order,
1155
1522
  };
1523
+ if (body.select.includes("child_run_ids")) {
1524
+ warnOnce("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");
1525
+ }
1156
1526
  let runsYielded = 0;
1157
1527
  for await (const runs of this._getCursorPaginatedList("/runs/query", body)) {
1158
1528
  if (limit) {
@@ -1172,6 +1542,53 @@ export class Client {
1172
1542
  }
1173
1543
  }
1174
1544
  }
1545
+ async *listGroupRuns(props) {
1546
+ const { projectId, projectName, groupBy, filter, startTime, endTime, limit, offset, } = props;
1547
+ const sessionId = projectId || (await this.readProject({ projectName })).id;
1548
+ const baseBody = {
1549
+ session_id: sessionId,
1550
+ group_by: groupBy,
1551
+ filter,
1552
+ start_time: startTime ? startTime.toISOString() : null,
1553
+ end_time: endTime ? endTime.toISOString() : null,
1554
+ limit: Number(limit) || 100,
1555
+ };
1556
+ let currentOffset = Number(offset) || 0;
1557
+ const path = "/runs/group";
1558
+ const url = `${this.apiUrl}${path}`;
1559
+ while (true) {
1560
+ const currentBody = {
1561
+ ...baseBody,
1562
+ offset: currentOffset,
1563
+ };
1564
+ // Remove undefined values from the payload
1565
+ const filteredPayload = Object.fromEntries(Object.entries(currentBody).filter(([_, value]) => value !== undefined));
1566
+ const body = JSON.stringify(filteredPayload);
1567
+ const response = await this.caller.call(async () => {
1568
+ const res = await this._fetch(url, {
1569
+ method: "POST",
1570
+ headers: { ...this.headers, "Content-Type": "application/json" },
1571
+ signal: AbortSignal.timeout(this.timeout_ms),
1572
+ ...this.fetchOptions,
1573
+ body,
1574
+ });
1575
+ await raiseForStatus(res, `Failed to fetch ${path}`);
1576
+ return res;
1577
+ });
1578
+ const items = await response.json();
1579
+ const { groups, total } = items;
1580
+ if (groups.length === 0) {
1581
+ break;
1582
+ }
1583
+ for (const thread of groups) {
1584
+ yield thread;
1585
+ }
1586
+ currentOffset += groups.length;
1587
+ if (currentOffset >= total) {
1588
+ break;
1589
+ }
1590
+ }
1591
+ }
1175
1592
  async getRunStats({ id, trace, parentRun, runType, projectNames, projectIds, referenceExampleIds, startTime, endTime, error, query, filter, traceFilter, treeFilter, isRoot, dataSourceType, }) {
1176
1593
  let projectIds_ = projectIds || [];
1177
1594
  if (projectNames) {
@@ -1199,12 +1616,17 @@ export class Client {
1199
1616
  };
1200
1617
  // Remove undefined values from the payload
1201
1618
  const filteredPayload = Object.fromEntries(Object.entries(payload).filter(([_, value]) => value !== undefined));
1202
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/runs/stats`, {
1203
- method: "POST",
1204
- headers: this.headers,
1205
- body: JSON.stringify(filteredPayload),
1206
- signal: AbortSignal.timeout(this.timeout_ms),
1207
- ...this.fetchOptions,
1619
+ const body = JSON.stringify(filteredPayload);
1620
+ const response = await this.caller.call(async () => {
1621
+ const res = await this._fetch(`${this.apiUrl}/runs/stats`, {
1622
+ method: "POST",
1623
+ headers: { ...this.headers, "Content-Type": "application/json" },
1624
+ signal: AbortSignal.timeout(this.timeout_ms),
1625
+ ...this.fetchOptions,
1626
+ body,
1627
+ });
1628
+ await raiseForStatus(res, "get run stats");
1629
+ return res;
1208
1630
  });
1209
1631
  const result = await response.json();
1210
1632
  return result;
@@ -1215,12 +1637,17 @@ export class Client {
1215
1637
  share_token: shareId || uuid.v4(),
1216
1638
  };
1217
1639
  assertUuid(runId);
1218
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/runs/${runId}/share`, {
1219
- method: "PUT",
1220
- headers: this.headers,
1221
- body: JSON.stringify(data),
1222
- signal: AbortSignal.timeout(this.timeout_ms),
1223
- ...this.fetchOptions,
1640
+ const body = JSON.stringify(data);
1641
+ const response = await this.caller.call(async () => {
1642
+ const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
1643
+ method: "PUT",
1644
+ headers: this.headers,
1645
+ signal: AbortSignal.timeout(this.timeout_ms),
1646
+ ...this.fetchOptions,
1647
+ body,
1648
+ });
1649
+ await raiseForStatus(res, "share run");
1650
+ return res;
1224
1651
  });
1225
1652
  const result = await response.json();
1226
1653
  if (result === null || !("share_token" in result)) {
@@ -1230,21 +1657,28 @@ export class Client {
1230
1657
  }
1231
1658
  async unshareRun(runId) {
1232
1659
  assertUuid(runId);
1233
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/runs/${runId}/share`, {
1234
- method: "DELETE",
1235
- headers: this.headers,
1236
- signal: AbortSignal.timeout(this.timeout_ms),
1237
- ...this.fetchOptions,
1660
+ await this.caller.call(async () => {
1661
+ const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
1662
+ method: "DELETE",
1663
+ headers: this.headers,
1664
+ signal: AbortSignal.timeout(this.timeout_ms),
1665
+ ...this.fetchOptions,
1666
+ });
1667
+ await raiseForStatus(res, "unshare run", true);
1668
+ return res;
1238
1669
  });
1239
- await raiseForStatus(response, "unshare run", true);
1240
1670
  }
1241
1671
  async readRunSharedLink(runId) {
1242
1672
  assertUuid(runId);
1243
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/runs/${runId}/share`, {
1244
- method: "GET",
1245
- headers: this.headers,
1246
- signal: AbortSignal.timeout(this.timeout_ms),
1247
- ...this.fetchOptions,
1673
+ const response = await this.caller.call(async () => {
1674
+ const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
1675
+ method: "GET",
1676
+ headers: this.headers,
1677
+ signal: AbortSignal.timeout(this.timeout_ms),
1678
+ ...this.fetchOptions,
1679
+ });
1680
+ await raiseForStatus(res, "read run shared link");
1681
+ return res;
1248
1682
  });
1249
1683
  const result = await response.json();
1250
1684
  if (result === null || !("share_token" in result)) {
@@ -1262,11 +1696,15 @@ export class Client {
1262
1696
  }
1263
1697
  }
1264
1698
  assertUuid(shareToken);
1265
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/public/${shareToken}/runs${queryParams}`, {
1266
- method: "GET",
1267
- headers: this.headers,
1268
- signal: AbortSignal.timeout(this.timeout_ms),
1269
- ...this.fetchOptions,
1699
+ const response = await this.caller.call(async () => {
1700
+ const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/runs${queryParams}`, {
1701
+ method: "GET",
1702
+ headers: this.headers,
1703
+ signal: AbortSignal.timeout(this.timeout_ms),
1704
+ ...this.fetchOptions,
1705
+ });
1706
+ await raiseForStatus(res, "list shared runs");
1707
+ return res;
1270
1708
  });
1271
1709
  const runs = await response.json();
1272
1710
  return runs;
@@ -1280,11 +1718,15 @@ export class Client {
1280
1718
  datasetId = dataset.id;
1281
1719
  }
1282
1720
  assertUuid(datasetId);
1283
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId}/share`, {
1284
- method: "GET",
1285
- headers: this.headers,
1286
- signal: AbortSignal.timeout(this.timeout_ms),
1287
- ...this.fetchOptions,
1721
+ const response = await this.caller.call(async () => {
1722
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
1723
+ method: "GET",
1724
+ headers: this.headers,
1725
+ signal: AbortSignal.timeout(this.timeout_ms),
1726
+ ...this.fetchOptions,
1727
+ });
1728
+ await raiseForStatus(res, "read dataset shared schema");
1729
+ return res;
1288
1730
  });
1289
1731
  const shareSchema = await response.json();
1290
1732
  shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
@@ -1302,12 +1744,17 @@ export class Client {
1302
1744
  dataset_id: datasetId,
1303
1745
  };
1304
1746
  assertUuid(datasetId);
1305
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId}/share`, {
1306
- method: "PUT",
1307
- headers: this.headers,
1308
- body: JSON.stringify(data),
1309
- signal: AbortSignal.timeout(this.timeout_ms),
1310
- ...this.fetchOptions,
1747
+ const body = JSON.stringify(data);
1748
+ const response = await this.caller.call(async () => {
1749
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
1750
+ method: "PUT",
1751
+ headers: this.headers,
1752
+ signal: AbortSignal.timeout(this.timeout_ms),
1753
+ ...this.fetchOptions,
1754
+ body,
1755
+ });
1756
+ await raiseForStatus(res, "share dataset");
1757
+ return res;
1311
1758
  });
1312
1759
  const shareSchema = await response.json();
1313
1760
  shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
@@ -1315,21 +1762,28 @@ export class Client {
1315
1762
  }
1316
1763
  async unshareDataset(datasetId) {
1317
1764
  assertUuid(datasetId);
1318
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId}/share`, {
1319
- method: "DELETE",
1320
- headers: this.headers,
1321
- signal: AbortSignal.timeout(this.timeout_ms),
1322
- ...this.fetchOptions,
1765
+ await this.caller.call(async () => {
1766
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
1767
+ method: "DELETE",
1768
+ headers: this.headers,
1769
+ signal: AbortSignal.timeout(this.timeout_ms),
1770
+ ...this.fetchOptions,
1771
+ });
1772
+ await raiseForStatus(res, "unshare dataset", true);
1773
+ return res;
1323
1774
  });
1324
- await raiseForStatus(response, "unshare dataset", true);
1325
1775
  }
1326
1776
  async readSharedDataset(shareToken) {
1327
1777
  assertUuid(shareToken);
1328
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/public/${shareToken}/datasets`, {
1329
- method: "GET",
1330
- headers: this.headers,
1331
- signal: AbortSignal.timeout(this.timeout_ms),
1332
- ...this.fetchOptions,
1778
+ const response = await this.caller.call(async () => {
1779
+ const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/datasets`, {
1780
+ method: "GET",
1781
+ headers: this.headers,
1782
+ signal: AbortSignal.timeout(this.timeout_ms),
1783
+ ...this.fetchOptions,
1784
+ });
1785
+ await raiseForStatus(res, "read shared dataset");
1786
+ return res;
1333
1787
  });
1334
1788
  const dataset = await response.json();
1335
1789
  return dataset;
@@ -1356,16 +1810,22 @@ export class Client {
1356
1810
  urlParams.append(key, value);
1357
1811
  }
1358
1812
  });
1359
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/public/${shareToken}/examples?${urlParams.toString()}`, {
1360
- method: "GET",
1361
- headers: this.headers,
1362
- signal: AbortSignal.timeout(this.timeout_ms),
1363
- ...this.fetchOptions,
1813
+ const response = await this.caller.call(async () => {
1814
+ const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/examples?${urlParams.toString()}`, {
1815
+ method: "GET",
1816
+ headers: this.headers,
1817
+ signal: AbortSignal.timeout(this.timeout_ms),
1818
+ ...this.fetchOptions,
1819
+ });
1820
+ await raiseForStatus(res, "list shared examples");
1821
+ return res;
1364
1822
  });
1365
1823
  const result = await response.json();
1366
1824
  if (!response.ok) {
1367
1825
  if ("detail" in result) {
1368
- throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${result.detail.join("\n")}`);
1826
+ throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${Array.isArray(result.detail)
1827
+ ? result.detail.join("\n")
1828
+ : "Unspecified error"}`);
1369
1829
  }
1370
1830
  throw new Error(`Failed to list shared examples: ${response.status} ${response.statusText}`);
1371
1831
  }
@@ -1389,14 +1849,18 @@ export class Client {
1389
1849
  if (referenceDatasetId !== null) {
1390
1850
  body["reference_dataset_id"] = referenceDatasetId;
1391
1851
  }
1392
- const response = await this.caller.call(_getFetchImplementation(), endpoint, {
1393
- method: "POST",
1394
- headers: { ...this.headers, "Content-Type": "application/json" },
1395
- body: JSON.stringify(body),
1396
- signal: AbortSignal.timeout(this.timeout_ms),
1397
- ...this.fetchOptions,
1852
+ const serializedBody = JSON.stringify(body);
1853
+ const response = await this.caller.call(async () => {
1854
+ const res = await this._fetch(endpoint, {
1855
+ method: "POST",
1856
+ headers: { ...this.headers, "Content-Type": "application/json" },
1857
+ signal: AbortSignal.timeout(this.timeout_ms),
1858
+ ...this.fetchOptions,
1859
+ body: serializedBody,
1860
+ });
1861
+ await raiseForStatus(res, "create project");
1862
+ return res;
1398
1863
  });
1399
- await raiseForStatus(response, "create project");
1400
1864
  const result = await response.json();
1401
1865
  return result;
1402
1866
  }
@@ -1406,20 +1870,23 @@ export class Client {
1406
1870
  if (metadata) {
1407
1871
  extra = { ...(extra || {}), metadata };
1408
1872
  }
1409
- const body = {
1873
+ const body = JSON.stringify({
1410
1874
  name,
1411
1875
  extra,
1412
1876
  description,
1413
1877
  end_time: endTime ? new Date(endTime).toISOString() : null,
1414
- };
1415
- const response = await this.caller.call(_getFetchImplementation(), endpoint, {
1416
- method: "PATCH",
1417
- headers: { ...this.headers, "Content-Type": "application/json" },
1418
- body: JSON.stringify(body),
1419
- signal: AbortSignal.timeout(this.timeout_ms),
1420
- ...this.fetchOptions,
1421
- });
1422
- await raiseForStatus(response, "update project");
1878
+ });
1879
+ const response = await this.caller.call(async () => {
1880
+ const res = await this._fetch(endpoint, {
1881
+ method: "PATCH",
1882
+ headers: { ...this.headers, "Content-Type": "application/json" },
1883
+ signal: AbortSignal.timeout(this.timeout_ms),
1884
+ ...this.fetchOptions,
1885
+ body,
1886
+ });
1887
+ await raiseForStatus(res, "update project");
1888
+ return res;
1889
+ });
1423
1890
  const result = await response.json();
1424
1891
  return result;
1425
1892
  }
@@ -1440,11 +1907,15 @@ export class Client {
1440
1907
  else {
1441
1908
  throw new Error("Must provide projectName or projectId");
1442
1909
  }
1443
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}${path}?${params}`, {
1444
- method: "GET",
1445
- headers: this.headers,
1446
- signal: AbortSignal.timeout(this.timeout_ms),
1447
- ...this.fetchOptions,
1910
+ const response = await this.caller.call(async () => {
1911
+ const res = await this._fetch(`${this.apiUrl}${path}?${params}`, {
1912
+ method: "GET",
1913
+ headers: this.headers,
1914
+ signal: AbortSignal.timeout(this.timeout_ms),
1915
+ ...this.fetchOptions,
1916
+ });
1917
+ await raiseForStatus(res, "has project");
1918
+ return res;
1448
1919
  });
1449
1920
  // consume the response body to release the connection
1450
1921
  // https://undici.nodejs.org/#/?id=garbage-collection
@@ -1523,7 +1994,7 @@ export class Client {
1523
1994
  }
1524
1995
  throw new Error("No projects found to resolve tenant.");
1525
1996
  }
1526
- async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, referenceFree, metadata, } = {}) {
1997
+ async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, includeStats, datasetVersion, referenceFree, metadata, } = {}) {
1527
1998
  const params = new URLSearchParams();
1528
1999
  if (projectIds !== undefined) {
1529
2000
  for (const projectId of projectIds) {
@@ -1545,6 +2016,12 @@ export class Client {
1545
2016
  });
1546
2017
  params.append("reference_dataset", dataset.id);
1547
2018
  }
2019
+ if (includeStats !== undefined) {
2020
+ params.append("include_stats", includeStats.toString());
2021
+ }
2022
+ if (datasetVersion !== undefined) {
2023
+ params.append("dataset_version", datasetVersion);
2024
+ }
1548
2025
  if (referenceFree !== undefined) {
1549
2026
  params.append("reference_free", referenceFree.toString());
1550
2027
  }
@@ -1570,13 +2047,16 @@ export class Client {
1570
2047
  projectId_ = projectId;
1571
2048
  }
1572
2049
  assertUuid(projectId_);
1573
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/sessions/${projectId_}`, {
1574
- method: "DELETE",
1575
- headers: this.headers,
1576
- signal: AbortSignal.timeout(this.timeout_ms),
1577
- ...this.fetchOptions,
2050
+ await this.caller.call(async () => {
2051
+ const res = await this._fetch(`${this.apiUrl}/sessions/${projectId_}`, {
2052
+ method: "DELETE",
2053
+ headers: this.headers,
2054
+ signal: AbortSignal.timeout(this.timeout_ms),
2055
+ ...this.fetchOptions,
2056
+ });
2057
+ await raiseForStatus(res, `delete session ${projectId_} (${projectName})`, true);
2058
+ return res;
1578
2059
  });
1579
- await raiseForStatus(response, `delete session ${projectId_} (${projectName})`, true);
1580
2060
  }
1581
2061
  async uploadCsv({ csvFile, fileName, inputKeys, outputKeys, description, dataType, name, }) {
1582
2062
  const url = `${this.apiUrl}/datasets/upload`;
@@ -1597,14 +2077,17 @@ export class Client {
1597
2077
  if (name) {
1598
2078
  formData.append("name", name);
1599
2079
  }
1600
- const response = await this.caller.call(_getFetchImplementation(), url, {
1601
- method: "POST",
1602
- headers: this.headers,
1603
- body: formData,
1604
- signal: AbortSignal.timeout(this.timeout_ms),
1605
- ...this.fetchOptions,
2080
+ const response = await this.caller.call(async () => {
2081
+ const res = await this._fetch(url, {
2082
+ method: "POST",
2083
+ headers: this.headers,
2084
+ signal: AbortSignal.timeout(this.timeout_ms),
2085
+ ...this.fetchOptions,
2086
+ body: formData,
2087
+ });
2088
+ await raiseForStatus(res, "upload CSV");
2089
+ return res;
1606
2090
  });
1607
- await raiseForStatus(response, "upload CSV");
1608
2091
  const result = await response.json();
1609
2092
  return result;
1610
2093
  }
@@ -1623,14 +2106,18 @@ export class Client {
1623
2106
  if (outputsSchema) {
1624
2107
  body.outputs_schema_definition = outputsSchema;
1625
2108
  }
1626
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets`, {
1627
- method: "POST",
1628
- headers: { ...this.headers, "Content-Type": "application/json" },
1629
- body: JSON.stringify(body),
1630
- signal: AbortSignal.timeout(this.timeout_ms),
1631
- ...this.fetchOptions,
2109
+ const serializedBody = JSON.stringify(body);
2110
+ const response = await this.caller.call(async () => {
2111
+ const res = await this._fetch(`${this.apiUrl}/datasets`, {
2112
+ method: "POST",
2113
+ headers: { ...this.headers, "Content-Type": "application/json" },
2114
+ signal: AbortSignal.timeout(this.timeout_ms),
2115
+ ...this.fetchOptions,
2116
+ body: serializedBody,
2117
+ });
2118
+ await raiseForStatus(res, "create dataset");
2119
+ return res;
1632
2120
  });
1633
- await raiseForStatus(response, "create dataset");
1634
2121
  const result = await response.json();
1635
2122
  return result;
1636
2123
  }
@@ -1638,14 +2125,14 @@ export class Client {
1638
2125
  let path = "/datasets";
1639
2126
  // limit to 1 result
1640
2127
  const params = new URLSearchParams({ limit: "1" });
1641
- if (datasetId !== undefined && datasetName !== undefined) {
2128
+ if (datasetId && datasetName) {
1642
2129
  throw new Error("Must provide either datasetName or datasetId, not both");
1643
2130
  }
1644
- else if (datasetId !== undefined) {
2131
+ else if (datasetId) {
1645
2132
  assertUuid(datasetId);
1646
2133
  path += `/${datasetId}`;
1647
2134
  }
1648
- else if (datasetName !== undefined) {
2135
+ else if (datasetName) {
1649
2136
  params.append("name", datasetName);
1650
2137
  }
1651
2138
  else {
@@ -1755,14 +2242,18 @@ export class Client {
1755
2242
  }
1756
2243
  const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
1757
2244
  assertUuid(_datasetId);
1758
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${_datasetId}`, {
1759
- method: "PATCH",
1760
- headers: { ...this.headers, "Content-Type": "application/json" },
1761
- body: JSON.stringify(update),
1762
- signal: AbortSignal.timeout(this.timeout_ms),
1763
- ...this.fetchOptions,
1764
- });
1765
- await raiseForStatus(response, "update dataset");
2245
+ const body = JSON.stringify(update);
2246
+ const response = await this.caller.call(async () => {
2247
+ const res = await this._fetch(`${this.apiUrl}/datasets/${_datasetId}`, {
2248
+ method: "PATCH",
2249
+ headers: { ...this.headers, "Content-Type": "application/json" },
2250
+ signal: AbortSignal.timeout(this.timeout_ms),
2251
+ ...this.fetchOptions,
2252
+ body,
2253
+ });
2254
+ await raiseForStatus(res, "update dataset");
2255
+ return res;
2256
+ });
1766
2257
  return (await response.json());
1767
2258
  }
1768
2259
  /**
@@ -1787,17 +2278,21 @@ export class Client {
1787
2278
  }
1788
2279
  const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
1789
2280
  assertUuid(_datasetId);
1790
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${_datasetId}/tags`, {
1791
- method: "PUT",
1792
- headers: { ...this.headers, "Content-Type": "application/json" },
1793
- body: JSON.stringify({
1794
- as_of: typeof asOf === "string" ? asOf : asOf.toISOString(),
1795
- tag,
1796
- }),
1797
- signal: AbortSignal.timeout(this.timeout_ms),
1798
- ...this.fetchOptions,
2281
+ const body = JSON.stringify({
2282
+ as_of: typeof asOf === "string" ? asOf : asOf.toISOString(),
2283
+ tag,
2284
+ });
2285
+ await this.caller.call(async () => {
2286
+ const res = await this._fetch(`${this.apiUrl}/datasets/${_datasetId}/tags`, {
2287
+ method: "PUT",
2288
+ headers: { ...this.headers, "Content-Type": "application/json" },
2289
+ signal: AbortSignal.timeout(this.timeout_ms),
2290
+ ...this.fetchOptions,
2291
+ body,
2292
+ });
2293
+ await raiseForStatus(res, "update dataset tags", true);
2294
+ return res;
1799
2295
  });
1800
- await raiseForStatus(response, "update dataset tags");
1801
2296
  }
1802
2297
  async deleteDataset({ datasetId, datasetName, }) {
1803
2298
  let path = "/datasets";
@@ -1816,14 +2311,16 @@ export class Client {
1816
2311
  else {
1817
2312
  throw new Error("Must provide datasetName or datasetId");
1818
2313
  }
1819
- const response = await this.caller.call(_getFetchImplementation(), this.apiUrl + path, {
1820
- method: "DELETE",
1821
- headers: this.headers,
1822
- signal: AbortSignal.timeout(this.timeout_ms),
1823
- ...this.fetchOptions,
2314
+ await this.caller.call(async () => {
2315
+ const res = await this._fetch(this.apiUrl + path, {
2316
+ method: "DELETE",
2317
+ headers: this.headers,
2318
+ signal: AbortSignal.timeout(this.timeout_ms),
2319
+ ...this.fetchOptions,
2320
+ });
2321
+ await raiseForStatus(res, `delete ${path}`, true);
2322
+ return res;
1824
2323
  });
1825
- await raiseForStatus(response, `delete ${path}`);
1826
- await response.json();
1827
2324
  }
1828
2325
  async indexDataset({ datasetId, datasetName, tag, }) {
1829
2326
  let datasetId_ = datasetId;
@@ -1841,14 +2338,18 @@ export class Client {
1841
2338
  const data = {
1842
2339
  tag: tag,
1843
2340
  };
1844
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId_}/index`, {
1845
- method: "POST",
1846
- headers: { ...this.headers, "Content-Type": "application/json" },
1847
- body: JSON.stringify(data),
1848
- signal: AbortSignal.timeout(this.timeout_ms),
1849
- ...this.fetchOptions,
1850
- });
1851
- await raiseForStatus(response, "index dataset");
2341
+ const body = JSON.stringify(data);
2342
+ const response = await this.caller.call(async () => {
2343
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId_}/index`, {
2344
+ method: "POST",
2345
+ headers: { ...this.headers, "Content-Type": "application/json" },
2346
+ signal: AbortSignal.timeout(this.timeout_ms),
2347
+ ...this.fetchOptions,
2348
+ body,
2349
+ });
2350
+ await raiseForStatus(res, "index dataset");
2351
+ return res;
2352
+ });
1852
2353
  await response.json();
1853
2354
  }
1854
2355
  /**
@@ -1890,14 +2391,18 @@ export class Client {
1890
2391
  data["filter"] = filter;
1891
2392
  }
1892
2393
  assertUuid(datasetId);
1893
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId}/search`, {
1894
- method: "POST",
1895
- headers: { ...this.headers, "Content-Type": "application/json" },
1896
- body: JSON.stringify(data),
1897
- signal: AbortSignal.timeout(this.timeout_ms),
1898
- ...this.fetchOptions,
1899
- });
1900
- await raiseForStatus(response, "fetch similar examples");
2394
+ const body = JSON.stringify(data);
2395
+ const response = await this.caller.call(async () => {
2396
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/search`, {
2397
+ headers: { ...this.headers, "Content-Type": "application/json" },
2398
+ signal: AbortSignal.timeout(this.timeout_ms),
2399
+ ...this.fetchOptions,
2400
+ method: "POST",
2401
+ body,
2402
+ });
2403
+ await raiseForStatus(res, "fetch similar examples");
2404
+ return res;
2405
+ });
1901
2406
  const result = await response.json();
1902
2407
  return result["examples"];
1903
2408
  }
@@ -2109,14 +2614,16 @@ export class Client {
2109
2614
  async deleteExample(exampleId) {
2110
2615
  assertUuid(exampleId);
2111
2616
  const path = `/examples/${exampleId}`;
2112
- const response = await this.caller.call(_getFetchImplementation(), this.apiUrl + path, {
2113
- method: "DELETE",
2114
- headers: this.headers,
2115
- signal: AbortSignal.timeout(this.timeout_ms),
2116
- ...this.fetchOptions,
2617
+ await this.caller.call(async () => {
2618
+ const res = await this._fetch(this.apiUrl + path, {
2619
+ method: "DELETE",
2620
+ headers: this.headers,
2621
+ signal: AbortSignal.timeout(this.timeout_ms),
2622
+ ...this.fetchOptions,
2623
+ });
2624
+ await raiseForStatus(res, `delete ${path}`, true);
2625
+ return res;
2117
2626
  });
2118
- await raiseForStatus(response, `delete ${path}`);
2119
- await response.json();
2120
2627
  }
2121
2628
  async updateExample(exampleIdOrUpdate, update) {
2122
2629
  let exampleId;
@@ -2188,13 +2695,16 @@ export class Client {
2188
2695
  if (tag !== undefined) {
2189
2696
  params.append("tag", tag);
2190
2697
  }
2191
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${resolvedDatasetId}/version?${params.toString()}`, {
2192
- method: "GET",
2193
- headers: { ...this.headers },
2194
- signal: AbortSignal.timeout(this.timeout_ms),
2195
- ...this.fetchOptions,
2698
+ const response = await this.caller.call(async () => {
2699
+ const res = await this._fetch(`${this.apiUrl}/datasets/${resolvedDatasetId}/version?${params.toString()}`, {
2700
+ method: "GET",
2701
+ headers: { ...this.headers },
2702
+ signal: AbortSignal.timeout(this.timeout_ms),
2703
+ ...this.fetchOptions,
2704
+ });
2705
+ await raiseForStatus(res, "read dataset version");
2706
+ return res;
2196
2707
  });
2197
- await raiseForStatus(response, "read dataset version");
2198
2708
  return await response.json();
2199
2709
  }
2200
2710
  async listDatasetSplits({ datasetId, datasetName, asOf, }) {
@@ -2249,14 +2759,18 @@ export class Client {
2249
2759
  }),
2250
2760
  remove,
2251
2761
  };
2252
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/${datasetId_}/splits`, {
2253
- method: "PUT",
2254
- headers: { ...this.headers, "Content-Type": "application/json" },
2255
- body: JSON.stringify(data),
2256
- signal: AbortSignal.timeout(this.timeout_ms),
2257
- ...this.fetchOptions,
2762
+ const body = JSON.stringify(data);
2763
+ await this.caller.call(async () => {
2764
+ const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId_}/splits`, {
2765
+ method: "PUT",
2766
+ headers: { ...this.headers, "Content-Type": "application/json" },
2767
+ signal: AbortSignal.timeout(this.timeout_ms),
2768
+ ...this.fetchOptions,
2769
+ body,
2770
+ });
2771
+ await raiseForStatus(res, "update dataset splits", true);
2772
+ return res;
2258
2773
  });
2259
- await raiseForStatus(response, "update dataset splits", true);
2260
2774
  }
2261
2775
  /**
2262
2776
  * @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.
@@ -2305,7 +2819,7 @@ export class Client {
2305
2819
  id: feedbackId ?? uuid.v4(),
2306
2820
  run_id: runId,
2307
2821
  key,
2308
- score,
2822
+ score: _formatFeedbackScore(score),
2309
2823
  value,
2310
2824
  correction,
2311
2825
  comment,
@@ -2314,21 +2828,25 @@ export class Client {
2314
2828
  feedbackConfig,
2315
2829
  session_id: projectId,
2316
2830
  };
2831
+ const body = JSON.stringify(feedback);
2317
2832
  const url = `${this.apiUrl}/feedback`;
2318
- const response = await this.caller.call(_getFetchImplementation(), url, {
2319
- method: "POST",
2320
- headers: { ...this.headers, "Content-Type": "application/json" },
2321
- body: JSON.stringify(feedback),
2322
- signal: AbortSignal.timeout(this.timeout_ms),
2323
- ...this.fetchOptions,
2324
- });
2325
- await raiseForStatus(response, "create feedback", true);
2833
+ await this.caller.call(async () => {
2834
+ const res = await this._fetch(url, {
2835
+ method: "POST",
2836
+ headers: { ...this.headers, "Content-Type": "application/json" },
2837
+ signal: AbortSignal.timeout(this.timeout_ms),
2838
+ ...this.fetchOptions,
2839
+ body,
2840
+ });
2841
+ await raiseForStatus(res, "create feedback", true);
2842
+ return res;
2843
+ });
2326
2844
  return feedback;
2327
2845
  }
2328
2846
  async updateFeedback(feedbackId, { score, value, correction, comment, }) {
2329
2847
  const feedbackUpdate = {};
2330
2848
  if (score !== undefined && score !== null) {
2331
- feedbackUpdate["score"] = score;
2849
+ feedbackUpdate["score"] = _formatFeedbackScore(score);
2332
2850
  }
2333
2851
  if (value !== undefined && value !== null) {
2334
2852
  feedbackUpdate["value"] = value;
@@ -2340,14 +2858,18 @@ export class Client {
2340
2858
  feedbackUpdate["comment"] = comment;
2341
2859
  }
2342
2860
  assertUuid(feedbackId);
2343
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/feedback/${feedbackId}`, {
2344
- method: "PATCH",
2345
- headers: { ...this.headers, "Content-Type": "application/json" },
2346
- body: JSON.stringify(feedbackUpdate),
2347
- signal: AbortSignal.timeout(this.timeout_ms),
2348
- ...this.fetchOptions,
2861
+ const body = JSON.stringify(feedbackUpdate);
2862
+ await this.caller.call(async () => {
2863
+ const res = await this._fetch(`${this.apiUrl}/feedback/${feedbackId}`, {
2864
+ method: "PATCH",
2865
+ headers: { ...this.headers, "Content-Type": "application/json" },
2866
+ signal: AbortSignal.timeout(this.timeout_ms),
2867
+ ...this.fetchOptions,
2868
+ body,
2869
+ });
2870
+ await raiseForStatus(res, "update feedback", true);
2871
+ return res;
2349
2872
  });
2350
- await raiseForStatus(response, "update feedback", true);
2351
2873
  }
2352
2874
  async readFeedback(feedbackId) {
2353
2875
  assertUuid(feedbackId);
@@ -2358,19 +2880,24 @@ export class Client {
2358
2880
  async deleteFeedback(feedbackId) {
2359
2881
  assertUuid(feedbackId);
2360
2882
  const path = `/feedback/${feedbackId}`;
2361
- const response = await this.caller.call(_getFetchImplementation(), this.apiUrl + path, {
2362
- method: "DELETE",
2363
- headers: this.headers,
2364
- signal: AbortSignal.timeout(this.timeout_ms),
2365
- ...this.fetchOptions,
2883
+ await this.caller.call(async () => {
2884
+ const res = await this._fetch(this.apiUrl + path, {
2885
+ method: "DELETE",
2886
+ headers: this.headers,
2887
+ signal: AbortSignal.timeout(this.timeout_ms),
2888
+ ...this.fetchOptions,
2889
+ });
2890
+ await raiseForStatus(res, `delete ${path}`, true);
2891
+ return res;
2366
2892
  });
2367
- await raiseForStatus(response, `delete ${path}`);
2368
- await response.json();
2369
2893
  }
2370
2894
  async *listFeedback({ runIds, feedbackKeys, feedbackSourceTypes, } = {}) {
2371
2895
  const queryParams = new URLSearchParams();
2372
2896
  if (runIds) {
2373
- queryParams.append("run", runIds.join(","));
2897
+ for (const runId of runIds) {
2898
+ assertUuid(runId);
2899
+ queryParams.append("run", runId);
2900
+ }
2374
2901
  }
2375
2902
  if (feedbackKeys) {
2376
2903
  for (const key of feedbackKeys) {
@@ -2420,15 +2947,19 @@ export class Client {
2420
2947
  hours: 3,
2421
2948
  };
2422
2949
  }
2423
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/feedback/tokens`, {
2424
- method: "POST",
2425
- headers: { ...this.headers, "Content-Type": "application/json" },
2426
- body: JSON.stringify(body),
2427
- signal: AbortSignal.timeout(this.timeout_ms),
2428
- ...this.fetchOptions,
2950
+ const serializedBody = JSON.stringify(body);
2951
+ const response = await this.caller.call(async () => {
2952
+ const res = await this._fetch(`${this.apiUrl}/feedback/tokens`, {
2953
+ method: "POST",
2954
+ headers: { ...this.headers, "Content-Type": "application/json" },
2955
+ signal: AbortSignal.timeout(this.timeout_ms),
2956
+ ...this.fetchOptions,
2957
+ body: serializedBody,
2958
+ });
2959
+ await raiseForStatus(res, "create presigned feedback token");
2960
+ return res;
2429
2961
  });
2430
- const result = await response.json();
2431
- return result;
2962
+ return await response.json();
2432
2963
  }
2433
2964
  async createComparativeExperiment({ name, experimentIds, referenceDatasetId, createdAt, description, metadata, id, }) {
2434
2965
  if (experimentIds.length === 0) {
@@ -2453,14 +2984,19 @@ export class Client {
2453
2984
  };
2454
2985
  if (metadata)
2455
2986
  body.extra["metadata"] = metadata;
2456
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/datasets/comparative`, {
2457
- method: "POST",
2458
- headers: { ...this.headers, "Content-Type": "application/json" },
2459
- body: JSON.stringify(body),
2460
- signal: AbortSignal.timeout(this.timeout_ms),
2461
- ...this.fetchOptions,
2987
+ const serializedBody = JSON.stringify(body);
2988
+ const response = await this.caller.call(async () => {
2989
+ const res = await this._fetch(`${this.apiUrl}/datasets/comparative`, {
2990
+ method: "POST",
2991
+ headers: { ...this.headers, "Content-Type": "application/json" },
2992
+ signal: AbortSignal.timeout(this.timeout_ms),
2993
+ ...this.fetchOptions,
2994
+ body: serializedBody,
2995
+ });
2996
+ await raiseForStatus(res, "create comparative experiment");
2997
+ return res;
2462
2998
  });
2463
- return await response.json();
2999
+ return response.json();
2464
3000
  }
2465
3001
  /**
2466
3002
  * Retrieves a list of presigned feedback tokens for a given run ID.
@@ -2562,37 +3098,44 @@ export class Client {
2562
3098
  * @returns The created AnnotationQueue object
2563
3099
  */
2564
3100
  async createAnnotationQueue(options) {
2565
- const { name, description, queueId } = options;
3101
+ const { name, description, queueId, rubricInstructions } = options;
2566
3102
  const body = {
2567
3103
  name,
2568
3104
  description,
2569
3105
  id: queueId || uuid.v4(),
3106
+ rubric_instructions: rubricInstructions,
2570
3107
  };
2571
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/annotation-queues`, {
2572
- method: "POST",
2573
- headers: { ...this.headers, "Content-Type": "application/json" },
2574
- body: JSON.stringify(Object.fromEntries(Object.entries(body).filter(([_, v]) => v !== undefined))),
2575
- signal: AbortSignal.timeout(this.timeout_ms),
2576
- ...this.fetchOptions,
3108
+ const serializedBody = JSON.stringify(Object.fromEntries(Object.entries(body).filter(([_, v]) => v !== undefined)));
3109
+ const response = await this.caller.call(async () => {
3110
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues`, {
3111
+ method: "POST",
3112
+ headers: { ...this.headers, "Content-Type": "application/json" },
3113
+ signal: AbortSignal.timeout(this.timeout_ms),
3114
+ ...this.fetchOptions,
3115
+ body: serializedBody,
3116
+ });
3117
+ await raiseForStatus(res, "create annotation queue");
3118
+ return res;
2577
3119
  });
2578
- await raiseForStatus(response, "create annotation queue");
2579
- const data = await response.json();
2580
- return data;
3120
+ return response.json();
2581
3121
  }
2582
3122
  /**
2583
3123
  * Read an annotation queue with the specified queue ID.
2584
3124
  * @param queueId - The ID of the annotation queue to read
2585
- * @returns The AnnotationQueue object
3125
+ * @returns The AnnotationQueueWithDetails object
2586
3126
  */
2587
3127
  async readAnnotationQueue(queueId) {
2588
- // TODO: Replace when actual endpoint is added
2589
- const queueIteratorResult = await this.listAnnotationQueues({
2590
- queueIds: [queueId],
2591
- }).next();
2592
- if (queueIteratorResult.done) {
2593
- throw new Error(`Annotation queue with ID ${queueId} not found`);
2594
- }
2595
- return queueIteratorResult.value;
3128
+ const response = await this.caller.call(async () => {
3129
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
3130
+ method: "GET",
3131
+ headers: this.headers,
3132
+ signal: AbortSignal.timeout(this.timeout_ms),
3133
+ ...this.fetchOptions,
3134
+ });
3135
+ await raiseForStatus(res, "read annotation queue");
3136
+ return res;
3137
+ });
3138
+ return response.json();
2596
3139
  }
2597
3140
  /**
2598
3141
  * Update an annotation queue with the specified queue ID.
@@ -2602,28 +3145,39 @@ export class Client {
2602
3145
  * @param options.description - The new description for the annotation queue
2603
3146
  */
2604
3147
  async updateAnnotationQueue(queueId, options) {
2605
- const { name, description } = options;
2606
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
2607
- method: "PATCH",
2608
- headers: { ...this.headers, "Content-Type": "application/json" },
2609
- body: JSON.stringify({ name, description }),
2610
- signal: AbortSignal.timeout(this.timeout_ms),
2611
- ...this.fetchOptions,
3148
+ const { name, description, rubricInstructions } = options;
3149
+ const body = JSON.stringify({
3150
+ name,
3151
+ description,
3152
+ rubric_instructions: rubricInstructions,
3153
+ });
3154
+ await this.caller.call(async () => {
3155
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
3156
+ method: "PATCH",
3157
+ headers: { ...this.headers, "Content-Type": "application/json" },
3158
+ signal: AbortSignal.timeout(this.timeout_ms),
3159
+ ...this.fetchOptions,
3160
+ body,
3161
+ });
3162
+ await raiseForStatus(res, "update annotation queue", true);
3163
+ return res;
2612
3164
  });
2613
- await raiseForStatus(response, "update annotation queue");
2614
3165
  }
2615
3166
  /**
2616
3167
  * Delete an annotation queue with the specified queue ID.
2617
3168
  * @param queueId - The ID of the annotation queue to delete
2618
3169
  */
2619
3170
  async deleteAnnotationQueue(queueId) {
2620
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
2621
- method: "DELETE",
2622
- headers: { ...this.headers, Accept: "application/json" },
2623
- signal: AbortSignal.timeout(this.timeout_ms),
2624
- ...this.fetchOptions,
3171
+ await this.caller.call(async () => {
3172
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
3173
+ method: "DELETE",
3174
+ headers: { ...this.headers, Accept: "application/json" },
3175
+ signal: AbortSignal.timeout(this.timeout_ms),
3176
+ ...this.fetchOptions,
3177
+ });
3178
+ await raiseForStatus(res, "delete annotation queue", true);
3179
+ return res;
2625
3180
  });
2626
- await raiseForStatus(response, "delete annotation queue");
2627
3181
  }
2628
3182
  /**
2629
3183
  * Add runs to an annotation queue with the specified queue ID.
@@ -2631,14 +3185,18 @@ export class Client {
2631
3185
  * @param runIds - The IDs of the runs to be added to the annotation queue
2632
3186
  */
2633
3187
  async addRunsToAnnotationQueue(queueId, runIds) {
2634
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs`, {
2635
- method: "POST",
2636
- headers: { ...this.headers, "Content-Type": "application/json" },
2637
- body: JSON.stringify(runIds.map((id, i) => assertUuid(id, `runIds[${i}]`).toString())),
2638
- signal: AbortSignal.timeout(this.timeout_ms),
2639
- ...this.fetchOptions,
3188
+ const body = JSON.stringify(runIds.map((id, i) => assertUuid(id, `runIds[${i}]`).toString()));
3189
+ await this.caller.call(async () => {
3190
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs`, {
3191
+ method: "POST",
3192
+ headers: { ...this.headers, "Content-Type": "application/json" },
3193
+ signal: AbortSignal.timeout(this.timeout_ms),
3194
+ ...this.fetchOptions,
3195
+ body,
3196
+ });
3197
+ await raiseForStatus(res, "add runs to annotation queue", true);
3198
+ return res;
2640
3199
  });
2641
- await raiseForStatus(response, "add runs to annotation queue");
2642
3200
  }
2643
3201
  /**
2644
3202
  * Get a run from an annotation queue at the specified index.
@@ -2649,14 +3207,17 @@ export class Client {
2649
3207
  */
2650
3208
  async getRunFromAnnotationQueue(queueId, index) {
2651
3209
  const baseUrl = `/annotation-queues/${assertUuid(queueId, "queueId")}/run`;
2652
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}${baseUrl}/${index}`, {
2653
- method: "GET",
2654
- headers: this.headers,
2655
- signal: AbortSignal.timeout(this.timeout_ms),
2656
- ...this.fetchOptions,
3210
+ const response = await this.caller.call(async () => {
3211
+ const res = await this._fetch(`${this.apiUrl}${baseUrl}/${index}`, {
3212
+ method: "GET",
3213
+ headers: this.headers,
3214
+ signal: AbortSignal.timeout(this.timeout_ms),
3215
+ ...this.fetchOptions,
3216
+ });
3217
+ await raiseForStatus(res, "get run from annotation queue");
3218
+ return res;
2657
3219
  });
2658
- await raiseForStatus(response, "get run from annotation queue");
2659
- return await response.json();
3220
+ return response.json();
2660
3221
  }
2661
3222
  /**
2662
3223
  * Delete a run from an an annotation queue.
@@ -2664,27 +3225,33 @@ export class Client {
2664
3225
  * @param queueRunId - The ID of the run to delete from the annotation queue
2665
3226
  */
2666
3227
  async deleteRunFromAnnotationQueue(queueId, queueRunId) {
2667
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs/${assertUuid(queueRunId, "queueRunId")}`, {
2668
- method: "DELETE",
2669
- headers: { ...this.headers, Accept: "application/json" },
2670
- signal: AbortSignal.timeout(this.timeout_ms),
2671
- ...this.fetchOptions,
3228
+ await this.caller.call(async () => {
3229
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs/${assertUuid(queueRunId, "queueRunId")}`, {
3230
+ method: "DELETE",
3231
+ headers: { ...this.headers, Accept: "application/json" },
3232
+ signal: AbortSignal.timeout(this.timeout_ms),
3233
+ ...this.fetchOptions,
3234
+ });
3235
+ await raiseForStatus(res, "delete run from annotation queue", true);
3236
+ return res;
2672
3237
  });
2673
- await raiseForStatus(response, "delete run from annotation queue");
2674
3238
  }
2675
3239
  /**
2676
3240
  * Get the size of an annotation queue.
2677
3241
  * @param queueId - The ID of the annotation queue
2678
3242
  */
2679
3243
  async getSizeFromAnnotationQueue(queueId) {
2680
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/size`, {
2681
- method: "GET",
2682
- headers: this.headers,
2683
- signal: AbortSignal.timeout(this.timeout_ms),
2684
- ...this.fetchOptions,
3244
+ const response = await this.caller.call(async () => {
3245
+ const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/size`, {
3246
+ method: "GET",
3247
+ headers: this.headers,
3248
+ signal: AbortSignal.timeout(this.timeout_ms),
3249
+ ...this.fetchOptions,
3250
+ });
3251
+ await raiseForStatus(res, "get size from annotation queue");
3252
+ return res;
2685
3253
  });
2686
- await raiseForStatus(response, "get size from annotation queue");
2687
- return await response.json();
3254
+ return response.json();
2688
3255
  }
2689
3256
  async _currentTenantIsOwner(owner) {
2690
3257
  const settings = await this._getSettings();
@@ -2697,22 +3264,17 @@ export class Client {
2697
3264
  Requested tenant: ${owner}`);
2698
3265
  }
2699
3266
  async _getLatestCommitHash(promptOwnerAndName) {
2700
- const res = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/commits/${promptOwnerAndName}/?limit=${1}&offset=${0}`, {
2701
- method: "GET",
2702
- headers: this.headers,
2703
- signal: AbortSignal.timeout(this.timeout_ms),
2704
- ...this.fetchOptions,
2705
- });
2706
- const json = await res.json();
2707
- if (!res.ok) {
2708
- const detail = typeof json.detail === "string"
2709
- ? json.detail
2710
- : JSON.stringify(json.detail);
2711
- const error = new Error(`Error ${res.status}: ${res.statusText}\n${detail}`);
2712
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2713
- error.statusCode = res.status;
2714
- throw error;
2715
- }
3267
+ const response = await this.caller.call(async () => {
3268
+ const res = await this._fetch(`${this.apiUrl}/commits/${promptOwnerAndName}/?limit=${1}&offset=${0}`, {
3269
+ method: "GET",
3270
+ headers: this.headers,
3271
+ signal: AbortSignal.timeout(this.timeout_ms),
3272
+ ...this.fetchOptions,
3273
+ });
3274
+ await raiseForStatus(res, "get latest commit hash");
3275
+ return res;
3276
+ });
3277
+ const json = await response.json();
2716
3278
  if (json.commits.length === 0) {
2717
3279
  return undefined;
2718
3280
  }
@@ -2720,15 +3282,19 @@ export class Client {
2720
3282
  }
2721
3283
  async _likeOrUnlikePrompt(promptIdentifier, like) {
2722
3284
  const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier);
2723
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/likes/${owner}/${promptName}`, {
2724
- method: "POST",
2725
- body: JSON.stringify({ like: like }),
2726
- headers: { ...this.headers, "Content-Type": "application/json" },
2727
- signal: AbortSignal.timeout(this.timeout_ms),
2728
- ...this.fetchOptions,
2729
- });
2730
- await raiseForStatus(response, `${like ? "like" : "unlike"} prompt`);
2731
- return await response.json();
3285
+ const body = JSON.stringify({ like: like });
3286
+ const response = await this.caller.call(async () => {
3287
+ const res = await this._fetch(`${this.apiUrl}/likes/${owner}/${promptName}`, {
3288
+ method: "POST",
3289
+ headers: { ...this.headers, "Content-Type": "application/json" },
3290
+ signal: AbortSignal.timeout(this.timeout_ms),
3291
+ ...this.fetchOptions,
3292
+ body,
3293
+ });
3294
+ await raiseForStatus(res, `${like ? "like" : "unlike"} prompt`);
3295
+ return res;
3296
+ });
3297
+ return response.json();
2732
3298
  }
2733
3299
  async _getPromptUrl(promptIdentifier) {
2734
3300
  const [owner, promptName, commitHash] = parsePromptIdentifier(promptIdentifier);
@@ -2782,18 +3348,21 @@ export class Client {
2782
3348
  }
2783
3349
  async getPrompt(promptIdentifier) {
2784
3350
  const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier);
2785
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
2786
- method: "GET",
2787
- headers: this.headers,
2788
- signal: AbortSignal.timeout(this.timeout_ms),
2789
- ...this.fetchOptions,
3351
+ const response = await this.caller.call(async () => {
3352
+ const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
3353
+ method: "GET",
3354
+ headers: this.headers,
3355
+ signal: AbortSignal.timeout(this.timeout_ms),
3356
+ ...this.fetchOptions,
3357
+ });
3358
+ if (res?.status === 404) {
3359
+ return null;
3360
+ }
3361
+ await raiseForStatus(res, "get prompt");
3362
+ return res;
2790
3363
  });
2791
- if (response.status === 404) {
2792
- return null;
2793
- }
2794
- await raiseForStatus(response, "get prompt");
2795
- const result = await response.json();
2796
- if (result.repo) {
3364
+ const result = await response?.json();
3365
+ if (result?.repo) {
2797
3366
  return result.repo;
2798
3367
  }
2799
3368
  else {
@@ -2804,7 +3373,7 @@ export class Client {
2804
3373
  const settings = await this._getSettings();
2805
3374
  if (options?.isPublic && !settings.tenant_handle) {
2806
3375
  throw new Error(`Cannot create a public prompt without first\n
2807
- creating a LangChain Hub handle.
3376
+ creating a LangChain Hub handle.
2808
3377
  You can add a handle by creating a public prompt at:\n
2809
3378
  https://smith.langchain.com/prompts`);
2810
3379
  }
@@ -2819,14 +3388,18 @@ export class Client {
2819
3388
  ...(options?.tags && { tags: options.tags }),
2820
3389
  is_public: !!options?.isPublic,
2821
3390
  };
2822
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/repos/`, {
2823
- method: "POST",
2824
- headers: { ...this.headers, "Content-Type": "application/json" },
2825
- body: JSON.stringify(data),
2826
- signal: AbortSignal.timeout(this.timeout_ms),
2827
- ...this.fetchOptions,
2828
- });
2829
- await raiseForStatus(response, "create prompt");
3391
+ const body = JSON.stringify(data);
3392
+ const response = await this.caller.call(async () => {
3393
+ const res = await this._fetch(`${this.apiUrl}/repos/`, {
3394
+ method: "POST",
3395
+ headers: { ...this.headers, "Content-Type": "application/json" },
3396
+ signal: AbortSignal.timeout(this.timeout_ms),
3397
+ ...this.fetchOptions,
3398
+ body,
3399
+ });
3400
+ await raiseForStatus(res, "create prompt");
3401
+ return res;
3402
+ });
2830
3403
  const { repo } = await response.json();
2831
3404
  return repo;
2832
3405
  }
@@ -2842,14 +3415,18 @@ export class Client {
2842
3415
  manifest: JSON.parse(JSON.stringify(object)),
2843
3416
  parent_commit: resolvedParentCommitHash,
2844
3417
  };
2845
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/commits/${owner}/${promptName}`, {
2846
- method: "POST",
2847
- headers: { ...this.headers, "Content-Type": "application/json" },
2848
- body: JSON.stringify(payload),
2849
- signal: AbortSignal.timeout(this.timeout_ms),
2850
- ...this.fetchOptions,
2851
- });
2852
- await raiseForStatus(response, "create commit");
3418
+ const body = JSON.stringify(payload);
3419
+ const response = await this.caller.call(async () => {
3420
+ const res = await this._fetch(`${this.apiUrl}/commits/${owner}/${promptName}`, {
3421
+ method: "POST",
3422
+ headers: { ...this.headers, "Content-Type": "application/json" },
3423
+ signal: AbortSignal.timeout(this.timeout_ms),
3424
+ ...this.fetchOptions,
3425
+ body,
3426
+ });
3427
+ await raiseForStatus(res, "create commit");
3428
+ return res;
3429
+ });
2853
3430
  const result = await response.json();
2854
3431
  return this._getPromptUrl(`${owner}/${promptName}${result.commit_hash ? `:${result.commit_hash}` : ""}`);
2855
3432
  }
@@ -2862,8 +3439,8 @@ export class Client {
2862
3439
  return this._updateExamplesMultipart(datasetId, updates);
2863
3440
  }
2864
3441
  async _updateExamplesMultipart(datasetId, updates = []) {
2865
- if (!(await this._getMultiPartSupport())) {
2866
- throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
3442
+ if (!(await this._getDatasetExamplesMultiPartSupport())) {
3443
+ throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
2867
3444
  }
2868
3445
  const formData = new FormData();
2869
3446
  for (const example of updates) {
@@ -2874,14 +3451,14 @@ export class Client {
2874
3451
  ...(example.split && { split: example.split }),
2875
3452
  };
2876
3453
  // Add main example data
2877
- const stringifiedExample = serializePayloadForTracing(exampleBody);
3454
+ const stringifiedExample = serializePayloadForTracing(exampleBody, `Serializing body for example with id: ${exampleId}`);
2878
3455
  const exampleBlob = new Blob([stringifiedExample], {
2879
3456
  type: "application/json",
2880
3457
  });
2881
3458
  formData.append(exampleId, exampleBlob);
2882
3459
  // Add inputs if present
2883
3460
  if (example.inputs) {
2884
- const stringifiedInputs = serializePayloadForTracing(example.inputs);
3461
+ const stringifiedInputs = serializePayloadForTracing(example.inputs, `Serializing inputs for example with id: ${exampleId}`);
2885
3462
  const inputsBlob = new Blob([stringifiedInputs], {
2886
3463
  type: "application/json",
2887
3464
  });
@@ -2889,7 +3466,7 @@ export class Client {
2889
3466
  }
2890
3467
  // Add outputs if present
2891
3468
  if (example.outputs) {
2892
- const stringifiedOutputs = serializePayloadForTracing(example.outputs);
3469
+ const stringifiedOutputs = serializePayloadForTracing(example.outputs, `Serializing outputs whle updating example with id: ${exampleId}`);
2893
3470
  const outputsBlob = new Blob([stringifiedOutputs], {
2894
3471
  type: "application/json",
2895
3472
  });
@@ -2914,7 +3491,7 @@ export class Client {
2914
3491
  }
2915
3492
  }
2916
3493
  if (example.attachments_operations) {
2917
- const stringifiedAttachmentsOperations = serializePayloadForTracing(example.attachments_operations);
3494
+ const stringifiedAttachmentsOperations = serializePayloadForTracing(example.attachments_operations, `Serializing attachments while updating example with id: ${exampleId}`);
2918
3495
  const attachmentsOperationsBlob = new Blob([stringifiedAttachmentsOperations], {
2919
3496
  type: "application/json",
2920
3497
  });
@@ -2922,13 +3499,18 @@ export class Client {
2922
3499
  }
2923
3500
  }
2924
3501
  const datasetIdToUse = datasetId ?? updates[0]?.dataset_id;
2925
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/v1/platform/datasets/${datasetIdToUse}/examples`, {
2926
- method: "PATCH",
2927
- headers: this.headers,
2928
- body: formData,
3502
+ const response = await this.caller.call(async () => {
3503
+ const res = await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${datasetIdToUse}/examples`)}`, {
3504
+ method: "PATCH",
3505
+ headers: this.headers,
3506
+ signal: AbortSignal.timeout(this.timeout_ms),
3507
+ ...this.fetchOptions,
3508
+ body: formData,
3509
+ });
3510
+ await raiseForStatus(res, "update examples");
3511
+ return res;
2929
3512
  });
2930
- const result = await response.json();
2931
- return result;
3513
+ return response.json();
2932
3514
  }
2933
3515
  /**
2934
3516
  * Upload examples with attachments using multipart form data.
@@ -2940,8 +3522,8 @@ export class Client {
2940
3522
  return this._uploadExamplesMultipart(datasetId, uploads);
2941
3523
  }
2942
3524
  async _uploadExamplesMultipart(datasetId, uploads = []) {
2943
- if (!(await this._getMultiPartSupport())) {
2944
- throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
3525
+ if (!(await this._getDatasetExamplesMultiPartSupport())) {
3526
+ throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
2945
3527
  }
2946
3528
  const formData = new FormData();
2947
3529
  for (const example of uploads) {
@@ -2960,14 +3542,14 @@ export class Client {
2960
3542
  }),
2961
3543
  };
2962
3544
  // Add main example data
2963
- const stringifiedExample = serializePayloadForTracing(exampleBody);
3545
+ const stringifiedExample = serializePayloadForTracing(exampleBody, `Serializing body for uploaded example with id: ${exampleId}`);
2964
3546
  const exampleBlob = new Blob([stringifiedExample], {
2965
3547
  type: "application/json",
2966
3548
  });
2967
3549
  formData.append(exampleId, exampleBlob);
2968
3550
  // Add inputs if present
2969
3551
  if (example.inputs) {
2970
- const stringifiedInputs = serializePayloadForTracing(example.inputs);
3552
+ const stringifiedInputs = serializePayloadForTracing(example.inputs, `Serializing inputs for uploaded example with id: ${exampleId}`);
2971
3553
  const inputsBlob = new Blob([stringifiedInputs], {
2972
3554
  type: "application/json",
2973
3555
  });
@@ -2975,7 +3557,7 @@ export class Client {
2975
3557
  }
2976
3558
  // Add outputs if present
2977
3559
  if (example.outputs) {
2978
- const stringifiedOutputs = serializePayloadForTracing(example.outputs);
3560
+ const stringifiedOutputs = serializePayloadForTracing(example.outputs, `Serializing outputs for uploaded example with id: ${exampleId}`);
2979
3561
  const outputsBlob = new Blob([stringifiedOutputs], {
2980
3562
  type: "application/json",
2981
3563
  });
@@ -3000,13 +3582,18 @@ export class Client {
3000
3582
  }
3001
3583
  }
3002
3584
  }
3003
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/v1/platform/datasets/${datasetId}/examples`, {
3004
- method: "POST",
3005
- headers: this.headers,
3006
- body: formData,
3585
+ const response = await this.caller.call(async () => {
3586
+ const res = await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${datasetId}/examples`)}`, {
3587
+ method: "POST",
3588
+ headers: this.headers,
3589
+ signal: AbortSignal.timeout(this.timeout_ms),
3590
+ ...this.fetchOptions,
3591
+ body: formData,
3592
+ });
3593
+ await raiseForStatus(res, "upload examples");
3594
+ return res;
3007
3595
  });
3008
- const result = await response.json();
3009
- return result;
3596
+ return response.json();
3010
3597
  }
3011
3598
  async updatePrompt(promptIdentifier, options) {
3012
3599
  if (!(await this.promptExists(promptIdentifier))) {
@@ -3031,17 +3618,21 @@ export class Client {
3031
3618
  if (Object.keys(payload).length === 0) {
3032
3619
  throw new Error("No valid update options provided");
3033
3620
  }
3034
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
3035
- method: "PATCH",
3036
- body: JSON.stringify(payload),
3037
- headers: {
3038
- ...this.headers,
3039
- "Content-Type": "application/json",
3040
- },
3041
- signal: AbortSignal.timeout(this.timeout_ms),
3042
- ...this.fetchOptions,
3621
+ const body = JSON.stringify(payload);
3622
+ const response = await this.caller.call(async () => {
3623
+ const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
3624
+ method: "PATCH",
3625
+ headers: {
3626
+ ...this.headers,
3627
+ "Content-Type": "application/json",
3628
+ },
3629
+ signal: AbortSignal.timeout(this.timeout_ms),
3630
+ ...this.fetchOptions,
3631
+ body,
3632
+ });
3633
+ await raiseForStatus(res, "update prompt");
3634
+ return res;
3043
3635
  });
3044
- await raiseForStatus(response, "update prompt");
3045
3636
  return response.json();
3046
3637
  }
3047
3638
  async deletePrompt(promptIdentifier) {
@@ -3052,23 +3643,30 @@ export class Client {
3052
3643
  if (!(await this._currentTenantIsOwner(owner))) {
3053
3644
  throw await this._ownerConflictError("delete a prompt", owner);
3054
3645
  }
3055
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
3056
- method: "DELETE",
3057
- headers: this.headers,
3058
- signal: AbortSignal.timeout(this.timeout_ms),
3059
- ...this.fetchOptions,
3646
+ const response = await this.caller.call(async () => {
3647
+ const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
3648
+ method: "DELETE",
3649
+ headers: this.headers,
3650
+ signal: AbortSignal.timeout(this.timeout_ms),
3651
+ ...this.fetchOptions,
3652
+ });
3653
+ await raiseForStatus(res, "delete prompt");
3654
+ return res;
3060
3655
  });
3061
- return await response.json();
3656
+ return response.json();
3062
3657
  }
3063
3658
  async pullPromptCommit(promptIdentifier, options) {
3064
3659
  const [owner, promptName, commitHash] = parsePromptIdentifier(promptIdentifier);
3065
- const response = await this.caller.call(_getFetchImplementation(), `${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
3066
- method: "GET",
3067
- headers: this.headers,
3068
- signal: AbortSignal.timeout(this.timeout_ms),
3069
- ...this.fetchOptions,
3660
+ const response = await this.caller.call(async () => {
3661
+ const res = await this._fetch(`${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
3662
+ method: "GET",
3663
+ headers: this.headers,
3664
+ signal: AbortSignal.timeout(this.timeout_ms),
3665
+ ...this.fetchOptions,
3666
+ });
3667
+ await raiseForStatus(res, "pull prompt commit");
3668
+ return res;
3070
3669
  });
3071
- await raiseForStatus(response, "pull prompt commit");
3072
3670
  const result = await response.json();
3073
3671
  return {
3074
3672
  owner,
@@ -3221,15 +3819,18 @@ export class Client {
3221
3819
  *
3222
3820
  * @returns A promise that resolves once all currently pending traces have sent.
3223
3821
  */
3224
- awaitPendingTraceBatches() {
3822
+ async awaitPendingTraceBatches() {
3225
3823
  if (this.manualFlushMode) {
3226
3824
  console.warn("[WARNING]: When tracing in manual flush mode, you must call `await client.flush()` manually to submit trace batches.");
3227
3825
  return Promise.resolve();
3228
3826
  }
3229
- return Promise.all([
3827
+ await Promise.all([
3230
3828
  ...this.autoBatchQueue.items.map(({ itemPromise }) => itemPromise),
3231
3829
  this.batchIngestCaller.queue.onIdle(),
3232
3830
  ]);
3831
+ if (this.langSmithToOTELTranslator !== undefined) {
3832
+ await getDefaultOTLPTracerComponents()?.DEFAULT_LANGSMITH_SPAN_PROCESSOR?.forceFlush();
3833
+ }
3233
3834
  }
3234
3835
  }
3235
3836
  function isExampleCreate(input) {