@langchain/core 1.1.4 → 1.1.5-dev-1765432861398

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 (706) hide show
  1. package/README.md +1 -1
  2. package/dist/agents.d.cts +0 -2
  3. package/dist/agents.d.cts.map +1 -0
  4. package/dist/agents.d.ts +0 -2
  5. package/dist/agents.d.ts.map +1 -0
  6. package/dist/caches/index.d.cts.map +1 -0
  7. package/dist/caches/index.d.ts.map +1 -0
  8. package/dist/callbacks/base.cjs +1 -1
  9. package/dist/callbacks/base.cjs.map +1 -1
  10. package/dist/callbacks/base.d.cts +22 -60
  11. package/dist/callbacks/base.d.cts.map +1 -0
  12. package/dist/callbacks/base.d.ts +22 -60
  13. package/dist/callbacks/base.d.ts.map +1 -0
  14. package/dist/callbacks/base.js +1 -1
  15. package/dist/callbacks/base.js.map +1 -1
  16. package/dist/callbacks/dispatch/index.d.cts +1 -3
  17. package/dist/callbacks/dispatch/index.d.cts.map +1 -0
  18. package/dist/callbacks/dispatch/index.d.ts +1 -3
  19. package/dist/callbacks/dispatch/index.d.ts.map +1 -0
  20. package/dist/callbacks/dispatch/web.d.cts +1 -3
  21. package/dist/callbacks/dispatch/web.d.cts.map +1 -0
  22. package/dist/callbacks/dispatch/web.d.ts +1 -3
  23. package/dist/callbacks/dispatch/web.d.ts.map +1 -0
  24. package/dist/callbacks/manager.cjs +6 -6
  25. package/dist/callbacks/manager.cjs.map +1 -1
  26. package/dist/callbacks/manager.d.cts +2 -12
  27. package/dist/callbacks/manager.d.cts.map +1 -0
  28. package/dist/callbacks/manager.d.ts +2 -12
  29. package/dist/callbacks/manager.d.ts.map +1 -0
  30. package/dist/callbacks/manager.js +7 -7
  31. package/dist/callbacks/manager.js.map +1 -1
  32. package/dist/chat_history.d.cts +0 -1
  33. package/dist/chat_history.d.cts.map +1 -0
  34. package/dist/chat_history.d.ts +0 -1
  35. package/dist/chat_history.d.ts.map +1 -0
  36. package/dist/context.d.cts.map +1 -0
  37. package/dist/context.d.ts.map +1 -0
  38. package/dist/document_loaders/base.d.cts.map +1 -0
  39. package/dist/document_loaders/base.d.ts.map +1 -0
  40. package/dist/document_loaders/langsmith.d.cts +0 -3
  41. package/dist/document_loaders/langsmith.d.cts.map +1 -0
  42. package/dist/document_loaders/langsmith.d.ts +0 -3
  43. package/dist/document_loaders/langsmith.d.ts.map +1 -0
  44. package/dist/documents/document.d.cts +3 -12
  45. package/dist/documents/document.d.cts.map +1 -0
  46. package/dist/documents/document.d.ts +3 -12
  47. package/dist/documents/document.d.ts.map +1 -0
  48. package/dist/documents/transformers.d.cts.map +1 -0
  49. package/dist/documents/transformers.d.ts.map +1 -0
  50. package/dist/embeddings.d.cts.map +1 -0
  51. package/dist/embeddings.d.ts.map +1 -0
  52. package/dist/example_selectors/base.d.cts.map +1 -0
  53. package/dist/example_selectors/base.d.ts.map +1 -0
  54. package/dist/example_selectors/conditional.d.cts.map +1 -0
  55. package/dist/example_selectors/conditional.d.ts.map +1 -0
  56. package/dist/example_selectors/length_based.d.cts +1 -1
  57. package/dist/example_selectors/length_based.d.cts.map +1 -0
  58. package/dist/example_selectors/length_based.d.ts +1 -1
  59. package/dist/example_selectors/length_based.d.ts.map +1 -0
  60. package/dist/example_selectors/semantic_similarity.d.cts.map +1 -0
  61. package/dist/example_selectors/semantic_similarity.d.ts.map +1 -0
  62. package/dist/indexing/base.d.cts +0 -1
  63. package/dist/indexing/base.d.cts.map +1 -0
  64. package/dist/indexing/base.d.ts +0 -1
  65. package/dist/indexing/base.d.ts.map +1 -0
  66. package/dist/indexing/record_manager.d.cts +0 -1
  67. package/dist/indexing/record_manager.d.cts.map +1 -0
  68. package/dist/indexing/record_manager.d.ts +0 -1
  69. package/dist/indexing/record_manager.d.ts.map +1 -0
  70. package/dist/language_models/base.d.cts +8 -38
  71. package/dist/language_models/base.d.cts.map +1 -0
  72. package/dist/language_models/base.d.ts +8 -38
  73. package/dist/language_models/base.d.ts.map +1 -0
  74. package/dist/language_models/chat_models.d.cts +6 -33
  75. package/dist/language_models/chat_models.d.cts.map +1 -0
  76. package/dist/language_models/chat_models.d.ts +6 -33
  77. package/dist/language_models/chat_models.d.ts.map +1 -0
  78. package/dist/language_models/llms.d.cts +0 -6
  79. package/dist/language_models/llms.d.cts.map +1 -0
  80. package/dist/language_models/llms.d.ts +0 -6
  81. package/dist/language_models/llms.d.ts.map +1 -0
  82. package/dist/language_models/profile.d.cts.map +1 -0
  83. package/dist/language_models/profile.d.ts.map +1 -0
  84. package/dist/load/import_type.d.cts +0 -1
  85. package/dist/load/import_type.d.cts.map +1 -0
  86. package/dist/load/import_type.d.ts +0 -1
  87. package/dist/load/import_type.d.ts.map +1 -0
  88. package/dist/load/index.d.cts.map +1 -0
  89. package/dist/load/index.d.ts.map +1 -0
  90. package/dist/load/map_keys.d.cts +0 -1
  91. package/dist/load/map_keys.d.cts.map +1 -0
  92. package/dist/load/map_keys.d.ts +0 -1
  93. package/dist/load/map_keys.d.ts.map +1 -0
  94. package/dist/load/serializable.d.cts +0 -1
  95. package/dist/load/serializable.d.cts.map +1 -0
  96. package/dist/load/serializable.d.ts +0 -1
  97. package/dist/load/serializable.d.ts.map +1 -0
  98. package/dist/memory.d.cts +0 -3
  99. package/dist/memory.d.cts.map +1 -0
  100. package/dist/memory.d.ts +0 -3
  101. package/dist/memory.d.ts.map +1 -0
  102. package/dist/messages/ai.d.cts.map +1 -0
  103. package/dist/messages/ai.d.ts.map +1 -0
  104. package/dist/messages/base.d.cts +1 -13
  105. package/dist/messages/base.d.cts.map +1 -0
  106. package/dist/messages/base.d.ts +1 -13
  107. package/dist/messages/base.d.ts.map +1 -0
  108. package/dist/messages/chat.d.cts.map +1 -0
  109. package/dist/messages/chat.d.ts.map +1 -0
  110. package/dist/messages/content/base.d.cts.map +1 -0
  111. package/dist/messages/content/base.d.ts.map +1 -0
  112. package/dist/messages/content/data.d.cts +2 -7
  113. package/dist/messages/content/data.d.cts.map +1 -0
  114. package/dist/messages/content/data.d.ts +2 -7
  115. package/dist/messages/content/data.d.ts.map +1 -0
  116. package/dist/messages/content/index.d.cts +1 -4
  117. package/dist/messages/content/index.d.cts.map +1 -0
  118. package/dist/messages/content/index.d.ts +1 -4
  119. package/dist/messages/content/index.d.ts.map +1 -0
  120. package/dist/messages/content/multimodal.d.cts +0 -1
  121. package/dist/messages/content/multimodal.d.cts.map +1 -0
  122. package/dist/messages/content/multimodal.d.ts +0 -1
  123. package/dist/messages/content/multimodal.d.ts.map +1 -0
  124. package/dist/messages/content/tools.d.cts +0 -1
  125. package/dist/messages/content/tools.d.cts.map +1 -0
  126. package/dist/messages/content/tools.d.ts +0 -1
  127. package/dist/messages/content/tools.d.ts.map +1 -0
  128. package/dist/messages/format.d.cts.map +1 -0
  129. package/dist/messages/format.d.ts.map +1 -0
  130. package/dist/messages/function.d.cts.map +1 -0
  131. package/dist/messages/function.d.ts.map +1 -0
  132. package/dist/messages/human.d.cts.map +1 -0
  133. package/dist/messages/human.d.ts.map +1 -0
  134. package/dist/messages/message.d.cts.map +1 -0
  135. package/dist/messages/message.d.ts.map +1 -0
  136. package/dist/messages/metadata.d.cts.map +1 -0
  137. package/dist/messages/metadata.d.ts.map +1 -0
  138. package/dist/messages/modifier.d.cts.map +1 -0
  139. package/dist/messages/modifier.d.ts.map +1 -0
  140. package/dist/messages/system.d.cts.map +1 -0
  141. package/dist/messages/system.d.ts.map +1 -0
  142. package/dist/messages/tool.d.cts +2 -9
  143. package/dist/messages/tool.d.cts.map +1 -0
  144. package/dist/messages/tool.d.ts +2 -9
  145. package/dist/messages/tool.d.ts.map +1 -0
  146. package/dist/messages/transformers.d.cts +0 -3
  147. package/dist/messages/transformers.d.cts.map +1 -0
  148. package/dist/messages/transformers.d.ts +0 -3
  149. package/dist/messages/transformers.d.ts.map +1 -0
  150. package/dist/messages/utils.d.cts +2 -5
  151. package/dist/messages/utils.d.cts.map +1 -0
  152. package/dist/messages/utils.d.ts +2 -5
  153. package/dist/messages/utils.d.ts.map +1 -0
  154. package/dist/output_parsers/base.d.cts.map +1 -0
  155. package/dist/output_parsers/base.d.ts.map +1 -0
  156. package/dist/output_parsers/bytes.d.cts.map +1 -0
  157. package/dist/output_parsers/bytes.d.ts.map +1 -0
  158. package/dist/output_parsers/json.d.cts +1 -5
  159. package/dist/output_parsers/json.d.cts.map +1 -0
  160. package/dist/output_parsers/json.d.ts +1 -5
  161. package/dist/output_parsers/json.d.ts.map +1 -0
  162. package/dist/output_parsers/list.d.cts.map +1 -0
  163. package/dist/output_parsers/list.d.ts.map +1 -0
  164. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts +2 -6
  165. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts.map +1 -0
  166. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +2 -6
  167. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts.map +1 -0
  168. package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts +10 -34
  169. package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts.map +1 -0
  170. package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +10 -34
  171. package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts.map +1 -0
  172. package/dist/output_parsers/string.d.cts.map +1 -0
  173. package/dist/output_parsers/string.d.ts.map +1 -0
  174. package/dist/output_parsers/structured.d.cts.map +1 -0
  175. package/dist/output_parsers/structured.d.ts.map +1 -0
  176. package/dist/output_parsers/transform.d.cts +0 -1
  177. package/dist/output_parsers/transform.d.cts.map +1 -0
  178. package/dist/output_parsers/transform.d.ts +0 -1
  179. package/dist/output_parsers/transform.d.ts.map +1 -0
  180. package/dist/output_parsers/xml.d.cts.map +1 -0
  181. package/dist/output_parsers/xml.d.ts.map +1 -0
  182. package/dist/outputs.d.cts +0 -6
  183. package/dist/outputs.d.cts.map +1 -0
  184. package/dist/outputs.d.ts +0 -6
  185. package/dist/outputs.d.ts.map +1 -0
  186. package/dist/prompt_values.d.cts.map +1 -0
  187. package/dist/prompt_values.d.ts.map +1 -0
  188. package/dist/prompts/base.d.cts +2 -10
  189. package/dist/prompts/base.d.cts.map +1 -0
  190. package/dist/prompts/base.d.ts +2 -10
  191. package/dist/prompts/base.d.ts.map +1 -0
  192. package/dist/prompts/chat.d.cts +13 -51
  193. package/dist/prompts/chat.d.cts.map +1 -0
  194. package/dist/prompts/chat.d.ts +13 -51
  195. package/dist/prompts/chat.d.ts.map +1 -0
  196. package/dist/prompts/dict.d.cts.map +1 -0
  197. package/dist/prompts/dict.d.ts.map +1 -0
  198. package/dist/prompts/few_shot.d.cts +1 -5
  199. package/dist/prompts/few_shot.d.cts.map +1 -0
  200. package/dist/prompts/few_shot.d.ts +1 -5
  201. package/dist/prompts/few_shot.d.ts.map +1 -0
  202. package/dist/prompts/image.d.cts +2 -10
  203. package/dist/prompts/image.d.cts.map +1 -0
  204. package/dist/prompts/image.d.ts +2 -10
  205. package/dist/prompts/image.d.ts.map +1 -0
  206. package/dist/prompts/pipeline.d.cts.map +1 -0
  207. package/dist/prompts/pipeline.d.ts.map +1 -0
  208. package/dist/prompts/prompt.d.cts +4 -15
  209. package/dist/prompts/prompt.d.cts.map +1 -0
  210. package/dist/prompts/prompt.d.ts +4 -16
  211. package/dist/prompts/prompt.d.ts.map +1 -0
  212. package/dist/prompts/serde.d.cts +0 -1
  213. package/dist/prompts/serde.d.cts.map +1 -0
  214. package/dist/prompts/serde.d.ts +0 -1
  215. package/dist/prompts/serde.d.ts.map +1 -0
  216. package/dist/prompts/string.d.cts +1 -5
  217. package/dist/prompts/string.d.cts.map +1 -0
  218. package/dist/prompts/string.d.ts +1 -5
  219. package/dist/prompts/string.d.ts.map +1 -0
  220. package/dist/prompts/structured.d.cts +3 -16
  221. package/dist/prompts/structured.d.cts.map +1 -0
  222. package/dist/prompts/structured.d.ts +3 -16
  223. package/dist/prompts/structured.d.ts.map +1 -0
  224. package/dist/prompts/template.d.cts.map +1 -0
  225. package/dist/prompts/template.d.ts.map +1 -0
  226. package/dist/retrievers/document_compressors/index.d.cts +0 -1
  227. package/dist/retrievers/document_compressors/index.d.cts.map +1 -0
  228. package/dist/retrievers/document_compressors/index.d.ts +0 -1
  229. package/dist/retrievers/document_compressors/index.d.ts.map +1 -0
  230. package/dist/retrievers/index.d.cts +2 -6
  231. package/dist/retrievers/index.d.cts.map +1 -0
  232. package/dist/retrievers/index.d.ts +2 -6
  233. package/dist/retrievers/index.d.ts.map +1 -0
  234. package/dist/runnables/base.d.cts +12 -64
  235. package/dist/runnables/base.d.cts.map +1 -0
  236. package/dist/runnables/base.d.ts +12 -64
  237. package/dist/runnables/base.d.ts.map +1 -0
  238. package/dist/runnables/branch.d.cts +0 -2
  239. package/dist/runnables/branch.d.cts.map +1 -0
  240. package/dist/runnables/branch.d.ts +0 -2
  241. package/dist/runnables/branch.d.ts.map +1 -0
  242. package/dist/runnables/config.cjs +15 -1
  243. package/dist/runnables/config.cjs.map +1 -1
  244. package/dist/runnables/config.d.cts +0 -1
  245. package/dist/runnables/config.d.cts.map +1 -0
  246. package/dist/runnables/config.d.ts +0 -1
  247. package/dist/runnables/config.d.ts.map +1 -0
  248. package/dist/runnables/config.js +15 -1
  249. package/dist/runnables/config.js.map +1 -1
  250. package/dist/runnables/graph.d.cts +1 -5
  251. package/dist/runnables/graph.d.cts.map +1 -0
  252. package/dist/runnables/graph.d.ts +1 -5
  253. package/dist/runnables/graph.d.ts.map +1 -0
  254. package/dist/runnables/history.d.cts +4 -12
  255. package/dist/runnables/history.d.cts.map +1 -0
  256. package/dist/runnables/history.d.ts +4 -12
  257. package/dist/runnables/history.d.ts.map +1 -0
  258. package/dist/runnables/passthrough.d.cts +0 -2
  259. package/dist/runnables/passthrough.d.cts.map +1 -0
  260. package/dist/runnables/passthrough.d.ts +0 -2
  261. package/dist/runnables/passthrough.d.ts.map +1 -0
  262. package/dist/runnables/router.d.cts +0 -1
  263. package/dist/runnables/router.d.cts.map +1 -0
  264. package/dist/runnables/router.d.ts +0 -1
  265. package/dist/runnables/router.d.ts.map +1 -0
  266. package/dist/runnables/types.d.cts +2 -9
  267. package/dist/runnables/types.d.cts.map +1 -0
  268. package/dist/runnables/types.d.ts +2 -9
  269. package/dist/runnables/types.d.ts.map +1 -0
  270. package/dist/singletons/async_local_storage/context.d.cts +0 -2
  271. package/dist/singletons/async_local_storage/context.d.cts.map +1 -0
  272. package/dist/singletons/async_local_storage/context.d.ts +0 -2
  273. package/dist/singletons/async_local_storage/context.d.ts.map +1 -0
  274. package/dist/singletons/async_local_storage/globals.d.cts +0 -1
  275. package/dist/singletons/async_local_storage/globals.d.cts.map +1 -0
  276. package/dist/singletons/async_local_storage/globals.d.ts +0 -1
  277. package/dist/singletons/async_local_storage/globals.d.ts.map +1 -0
  278. package/dist/singletons/async_local_storage/index.d.cts.map +1 -0
  279. package/dist/singletons/async_local_storage/index.d.ts.map +1 -0
  280. package/dist/singletons/callbacks.d.cts.map +1 -0
  281. package/dist/singletons/callbacks.d.ts.map +1 -0
  282. package/dist/stores.d.cts +0 -1
  283. package/dist/stores.d.cts.map +1 -0
  284. package/dist/stores.d.ts +0 -1
  285. package/dist/stores.d.ts.map +1 -0
  286. package/dist/structured_query/base.d.cts.map +1 -0
  287. package/dist/structured_query/base.d.ts.map +1 -0
  288. package/dist/structured_query/functional.d.cts.map +1 -0
  289. package/dist/structured_query/functional.d.ts.map +1 -0
  290. package/dist/structured_query/ir.d.cts.map +1 -0
  291. package/dist/structured_query/ir.d.ts.map +1 -0
  292. package/dist/structured_query/utils.d.cts +1 -4
  293. package/dist/structured_query/utils.d.cts.map +1 -0
  294. package/dist/structured_query/utils.d.ts +1 -4
  295. package/dist/structured_query/utils.d.ts.map +1 -0
  296. package/dist/tools/index.d.cts +1 -6
  297. package/dist/tools/index.d.cts.map +1 -0
  298. package/dist/tools/index.d.ts +1 -6
  299. package/dist/tools/index.d.ts.map +1 -0
  300. package/dist/tools/types.d.cts +3 -13
  301. package/dist/tools/types.d.cts.map +1 -0
  302. package/dist/tools/types.d.ts +3 -13
  303. package/dist/tools/types.d.ts.map +1 -0
  304. package/dist/tools/utils.d.cts.map +1 -0
  305. package/dist/tools/utils.d.ts.map +1 -0
  306. package/dist/tracers/base.d.cts +1 -20
  307. package/dist/tracers/base.d.cts.map +1 -0
  308. package/dist/tracers/base.d.ts +1 -20
  309. package/dist/tracers/base.d.ts.map +1 -0
  310. package/dist/tracers/console.d.cts +0 -2
  311. package/dist/tracers/console.d.cts.map +1 -0
  312. package/dist/tracers/console.d.ts +0 -2
  313. package/dist/tracers/console.d.ts.map +1 -0
  314. package/dist/tracers/event_stream.d.cts +0 -4
  315. package/dist/tracers/event_stream.d.cts.map +1 -0
  316. package/dist/tracers/event_stream.d.ts +0 -4
  317. package/dist/tracers/event_stream.d.ts.map +1 -0
  318. package/dist/tracers/log_stream.d.cts +0 -6
  319. package/dist/tracers/log_stream.d.cts.map +1 -0
  320. package/dist/tracers/log_stream.d.ts +0 -6
  321. package/dist/tracers/log_stream.d.ts.map +1 -0
  322. package/dist/tracers/run_collector.d.cts.map +1 -0
  323. package/dist/tracers/run_collector.d.ts.map +1 -0
  324. package/dist/tracers/tracer_langchain.d.cts.map +1 -0
  325. package/dist/tracers/tracer_langchain.d.ts.map +1 -0
  326. package/dist/types/_internal.d.cts +0 -3
  327. package/dist/types/_internal.d.cts.map +1 -0
  328. package/dist/types/_internal.d.ts +0 -3
  329. package/dist/types/_internal.d.ts.map +1 -0
  330. package/dist/types/type-utils.d.cts +0 -2
  331. package/dist/types/type-utils.d.cts.map +1 -0
  332. package/dist/types/type-utils.d.ts +0 -2
  333. package/dist/types/type-utils.d.ts.map +1 -0
  334. package/dist/utils/async_caller.d.cts +0 -3
  335. package/dist/utils/async_caller.d.cts.map +1 -0
  336. package/dist/utils/async_caller.d.ts +0 -3
  337. package/dist/utils/async_caller.d.ts.map +1 -0
  338. package/dist/utils/chunk_array.d.cts.map +1 -0
  339. package/dist/utils/chunk_array.d.ts.map +1 -0
  340. package/dist/utils/env.d.cts +0 -4
  341. package/dist/utils/env.d.cts.map +1 -0
  342. package/dist/utils/env.d.ts +0 -4
  343. package/dist/utils/env.d.ts.map +1 -0
  344. package/dist/utils/event_source_parse.d.cts +1 -4
  345. package/dist/utils/event_source_parse.d.cts.map +1 -0
  346. package/dist/utils/event_source_parse.d.ts +1 -4
  347. package/dist/utils/event_source_parse.d.ts.map +1 -0
  348. package/dist/utils/fast-json-patch/src/core.d.cts.map +1 -0
  349. package/dist/utils/fast-json-patch/src/core.d.ts.map +1 -0
  350. package/dist/utils/fast-json-patch/src/duplex.d.cts.map +1 -0
  351. package/dist/utils/fast-json-patch/src/duplex.d.ts.map +1 -0
  352. package/dist/utils/format.d.cts.map +1 -0
  353. package/dist/utils/format.d.ts.map +1 -0
  354. package/dist/utils/function_calling.d.cts +1 -3
  355. package/dist/utils/function_calling.d.cts.map +1 -0
  356. package/dist/utils/function_calling.d.ts +1 -3
  357. package/dist/utils/function_calling.d.ts.map +1 -0
  358. package/dist/utils/hash.d.cts.map +1 -0
  359. package/dist/utils/hash.d.ts.map +1 -0
  360. package/dist/utils/js-sha256/hash.d.cts.map +1 -0
  361. package/dist/utils/js-sha256/hash.d.ts.map +1 -0
  362. package/dist/utils/json.d.cts +0 -1
  363. package/dist/utils/json.d.cts.map +1 -0
  364. package/dist/utils/json.d.ts +0 -1
  365. package/dist/utils/json.d.ts.map +1 -0
  366. package/dist/utils/json_schema.d.cts.map +1 -0
  367. package/dist/utils/json_schema.d.ts.map +1 -0
  368. package/dist/utils/math.d.cts.map +1 -0
  369. package/dist/utils/math.d.ts.map +1 -0
  370. package/dist/utils/ml-distance/similarities.d.cts.map +1 -0
  371. package/dist/utils/ml-distance/similarities.d.ts.map +1 -0
  372. package/dist/utils/signal.d.cts.map +1 -0
  373. package/dist/utils/signal.d.ts.map +1 -0
  374. package/dist/utils/stream.d.cts +1 -13
  375. package/dist/utils/stream.d.cts.map +1 -0
  376. package/dist/utils/stream.d.ts +1 -13
  377. package/dist/utils/stream.d.ts.map +1 -0
  378. package/dist/utils/testing/chat_models.cjs +11 -5
  379. package/dist/utils/testing/chat_models.cjs.map +1 -1
  380. package/dist/utils/testing/chat_models.d.cts +11 -12
  381. package/dist/utils/testing/chat_models.d.cts.map +1 -0
  382. package/dist/utils/testing/chat_models.d.ts +11 -12
  383. package/dist/utils/testing/chat_models.d.ts.map +1 -0
  384. package/dist/utils/testing/chat_models.js +11 -5
  385. package/dist/utils/testing/chat_models.js.map +1 -1
  386. package/dist/utils/testing/embeddings.d.cts.map +1 -0
  387. package/dist/utils/testing/embeddings.d.ts.map +1 -0
  388. package/dist/utils/testing/llms.d.cts.map +1 -0
  389. package/dist/utils/testing/llms.d.ts.map +1 -0
  390. package/dist/utils/testing/message_history.d.cts.map +1 -0
  391. package/dist/utils/testing/message_history.d.ts.map +1 -0
  392. package/dist/utils/testing/output_parsers.d.cts.map +1 -0
  393. package/dist/utils/testing/output_parsers.d.ts.map +1 -0
  394. package/dist/utils/testing/retrievers.d.cts +1 -3
  395. package/dist/utils/testing/retrievers.d.cts.map +1 -0
  396. package/dist/utils/testing/retrievers.d.ts +1 -3
  397. package/dist/utils/testing/retrievers.d.ts.map +1 -0
  398. package/dist/utils/testing/runnables.d.cts.map +1 -0
  399. package/dist/utils/testing/runnables.d.ts.map +1 -0
  400. package/dist/utils/testing/tools.d.cts.map +1 -0
  401. package/dist/utils/testing/tools.d.ts.map +1 -0
  402. package/dist/utils/testing/tracers.d.cts.map +1 -0
  403. package/dist/utils/testing/tracers.d.ts.map +1 -0
  404. package/dist/utils/testing/vectorstores.d.cts +0 -1
  405. package/dist/utils/testing/vectorstores.d.cts.map +1 -0
  406. package/dist/utils/testing/vectorstores.d.ts +0 -1
  407. package/dist/utils/testing/vectorstores.d.ts.map +1 -0
  408. package/dist/utils/tiktoken.d.cts.map +1 -0
  409. package/dist/utils/tiktoken.d.ts.map +1 -0
  410. package/dist/utils/types/index.d.cts +0 -2
  411. package/dist/utils/types/index.d.cts.map +1 -0
  412. package/dist/utils/types/index.d.ts +0 -2
  413. package/dist/utils/types/index.d.ts.map +1 -0
  414. package/dist/utils/types/zod.d.cts +0 -3
  415. package/dist/utils/types/zod.d.cts.map +1 -0
  416. package/dist/utils/types/zod.d.ts +0 -3
  417. package/dist/utils/types/zod.d.ts.map +1 -0
  418. package/dist/utils/zod-to-json-schema/errorMessages.d.cts.map +1 -0
  419. package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +1 -0
  420. package/dist/utils/zod-to-json-schema/parseTypes.d.cts.map +1 -0
  421. package/dist/utils/zod-to-json-schema/parseTypes.d.ts.map +1 -0
  422. package/dist/utils/zod-to-json-schema/parsers/any.d.cts.map +1 -0
  423. package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +1 -0
  424. package/dist/utils/zod-to-json-schema/parsers/array.d.cts.map +1 -0
  425. package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +1 -0
  426. package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts.map +1 -0
  427. package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +1 -0
  428. package/dist/utils/zod-to-json-schema/parsers/boolean.d.cts.map +1 -0
  429. package/dist/utils/zod-to-json-schema/parsers/boolean.d.ts.map +1 -0
  430. package/dist/utils/zod-to-json-schema/parsers/date.d.cts.map +1 -0
  431. package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +1 -0
  432. package/dist/utils/zod-to-json-schema/parsers/enum.d.cts.map +1 -0
  433. package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +1 -0
  434. package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts.map +1 -0
  435. package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +1 -0
  436. package/dist/utils/zod-to-json-schema/parsers/literal.d.cts.map +1 -0
  437. package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +1 -0
  438. package/dist/utils/zod-to-json-schema/parsers/map.d.cts.map +1 -0
  439. package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +1 -0
  440. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.cts.map +1 -0
  441. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +1 -0
  442. package/dist/utils/zod-to-json-schema/parsers/never.d.cts.map +1 -0
  443. package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +1 -0
  444. package/dist/utils/zod-to-json-schema/parsers/null.d.cts.map +1 -0
  445. package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +1 -0
  446. package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts.map +1 -0
  447. package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +1 -0
  448. package/dist/utils/zod-to-json-schema/parsers/number.d.cts.map +1 -0
  449. package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +1 -0
  450. package/dist/utils/zod-to-json-schema/parsers/object.d.cts.map +1 -0
  451. package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +1 -0
  452. package/dist/utils/zod-to-json-schema/parsers/record.d.cts.map +1 -0
  453. package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +1 -0
  454. package/dist/utils/zod-to-json-schema/parsers/set.d.cts.map +1 -0
  455. package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +1 -0
  456. package/dist/utils/zod-to-json-schema/parsers/string.d.cts.map +1 -0
  457. package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +1 -0
  458. package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts.map +1 -0
  459. package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +1 -0
  460. package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts.map +1 -0
  461. package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +1 -0
  462. package/dist/utils/zod-to-json-schema/parsers/union.d.cts.map +1 -0
  463. package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +1 -0
  464. package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts.map +1 -0
  465. package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +1 -0
  466. package/dist/vectorstores.d.cts +5 -17
  467. package/dist/vectorstores.d.cts.map +1 -0
  468. package/dist/vectorstores.d.ts +5 -17
  469. package/dist/vectorstores.d.ts.map +1 -0
  470. package/package.json +6 -5
  471. package/agents.cjs +0 -1
  472. package/agents.d.cts +0 -1
  473. package/agents.d.ts +0 -1
  474. package/agents.js +0 -1
  475. package/caches.cjs +0 -1
  476. package/caches.d.cts +0 -1
  477. package/caches.d.ts +0 -1
  478. package/caches.js +0 -1
  479. package/callbacks/base.cjs +0 -1
  480. package/callbacks/base.d.cts +0 -1
  481. package/callbacks/base.d.ts +0 -1
  482. package/callbacks/base.js +0 -1
  483. package/callbacks/dispatch/web.cjs +0 -1
  484. package/callbacks/dispatch/web.d.cts +0 -1
  485. package/callbacks/dispatch/web.d.ts +0 -1
  486. package/callbacks/dispatch/web.js +0 -1
  487. package/callbacks/dispatch.cjs +0 -1
  488. package/callbacks/dispatch.d.cts +0 -1
  489. package/callbacks/dispatch.d.ts +0 -1
  490. package/callbacks/dispatch.js +0 -1
  491. package/callbacks/manager.cjs +0 -1
  492. package/callbacks/manager.d.cts +0 -1
  493. package/callbacks/manager.d.ts +0 -1
  494. package/callbacks/manager.js +0 -1
  495. package/callbacks/promises.cjs +0 -1
  496. package/callbacks/promises.d.cts +0 -1
  497. package/callbacks/promises.d.ts +0 -1
  498. package/callbacks/promises.js +0 -1
  499. package/chat_history.cjs +0 -1
  500. package/chat_history.d.cts +0 -1
  501. package/chat_history.d.ts +0 -1
  502. package/chat_history.js +0 -1
  503. package/context.cjs +0 -1
  504. package/context.d.cts +0 -1
  505. package/context.d.ts +0 -1
  506. package/context.js +0 -1
  507. package/document_loaders/base.cjs +0 -1
  508. package/document_loaders/base.d.cts +0 -1
  509. package/document_loaders/base.d.ts +0 -1
  510. package/document_loaders/base.js +0 -1
  511. package/document_loaders/langsmith.cjs +0 -1
  512. package/document_loaders/langsmith.d.cts +0 -1
  513. package/document_loaders/langsmith.d.ts +0 -1
  514. package/document_loaders/langsmith.js +0 -1
  515. package/documents.cjs +0 -1
  516. package/documents.d.cts +0 -1
  517. package/documents.d.ts +0 -1
  518. package/documents.js +0 -1
  519. package/embeddings.cjs +0 -1
  520. package/embeddings.d.cts +0 -1
  521. package/embeddings.d.ts +0 -1
  522. package/embeddings.js +0 -1
  523. package/example_selectors.cjs +0 -1
  524. package/example_selectors.d.cts +0 -1
  525. package/example_selectors.d.ts +0 -1
  526. package/example_selectors.js +0 -1
  527. package/indexing.cjs +0 -1
  528. package/indexing.d.cts +0 -1
  529. package/indexing.d.ts +0 -1
  530. package/indexing.js +0 -1
  531. package/language_models/base.cjs +0 -1
  532. package/language_models/base.d.cts +0 -1
  533. package/language_models/base.d.ts +0 -1
  534. package/language_models/base.js +0 -1
  535. package/language_models/chat_models.cjs +0 -1
  536. package/language_models/chat_models.d.cts +0 -1
  537. package/language_models/chat_models.d.ts +0 -1
  538. package/language_models/chat_models.js +0 -1
  539. package/language_models/llms.cjs +0 -1
  540. package/language_models/llms.d.cts +0 -1
  541. package/language_models/llms.d.ts +0 -1
  542. package/language_models/llms.js +0 -1
  543. package/language_models/profile.cjs +0 -1
  544. package/language_models/profile.d.cts +0 -1
  545. package/language_models/profile.d.ts +0 -1
  546. package/language_models/profile.js +0 -1
  547. package/load/serializable.cjs +0 -1
  548. package/load/serializable.d.cts +0 -1
  549. package/load/serializable.d.ts +0 -1
  550. package/load/serializable.js +0 -1
  551. package/load.cjs +0 -1
  552. package/load.d.cts +0 -1
  553. package/load.d.ts +0 -1
  554. package/load.js +0 -1
  555. package/memory.cjs +0 -1
  556. package/memory.d.cts +0 -1
  557. package/memory.d.ts +0 -1
  558. package/memory.js +0 -1
  559. package/messages/tool.cjs +0 -1
  560. package/messages/tool.d.cts +0 -1
  561. package/messages/tool.d.ts +0 -1
  562. package/messages/tool.js +0 -1
  563. package/messages.cjs +0 -1
  564. package/messages.d.cts +0 -1
  565. package/messages.d.ts +0 -1
  566. package/messages.js +0 -1
  567. package/output_parsers/openai_functions.cjs +0 -1
  568. package/output_parsers/openai_functions.d.cts +0 -1
  569. package/output_parsers/openai_functions.d.ts +0 -1
  570. package/output_parsers/openai_functions.js +0 -1
  571. package/output_parsers/openai_tools.cjs +0 -1
  572. package/output_parsers/openai_tools.d.cts +0 -1
  573. package/output_parsers/openai_tools.d.ts +0 -1
  574. package/output_parsers/openai_tools.js +0 -1
  575. package/output_parsers.cjs +0 -1
  576. package/output_parsers.d.cts +0 -1
  577. package/output_parsers.d.ts +0 -1
  578. package/output_parsers.js +0 -1
  579. package/outputs.cjs +0 -1
  580. package/outputs.d.cts +0 -1
  581. package/outputs.d.ts +0 -1
  582. package/outputs.js +0 -1
  583. package/prompt_values.cjs +0 -1
  584. package/prompt_values.d.cts +0 -1
  585. package/prompt_values.d.ts +0 -1
  586. package/prompt_values.js +0 -1
  587. package/prompts.cjs +0 -1
  588. package/prompts.d.cts +0 -1
  589. package/prompts.d.ts +0 -1
  590. package/prompts.js +0 -1
  591. package/retrievers/document_compressors.cjs +0 -1
  592. package/retrievers/document_compressors.d.cts +0 -1
  593. package/retrievers/document_compressors.d.ts +0 -1
  594. package/retrievers/document_compressors.js +0 -1
  595. package/retrievers.cjs +0 -1
  596. package/retrievers.d.cts +0 -1
  597. package/retrievers.d.ts +0 -1
  598. package/retrievers.js +0 -1
  599. package/runnables/graph.cjs +0 -1
  600. package/runnables/graph.d.cts +0 -1
  601. package/runnables/graph.d.ts +0 -1
  602. package/runnables/graph.js +0 -1
  603. package/runnables.cjs +0 -1
  604. package/runnables.d.cts +0 -1
  605. package/runnables.d.ts +0 -1
  606. package/runnables.js +0 -1
  607. package/singletons.cjs +0 -1
  608. package/singletons.d.cts +0 -1
  609. package/singletons.d.ts +0 -1
  610. package/singletons.js +0 -1
  611. package/stores.cjs +0 -1
  612. package/stores.d.cts +0 -1
  613. package/stores.d.ts +0 -1
  614. package/stores.js +0 -1
  615. package/structured_query.cjs +0 -1
  616. package/structured_query.d.cts +0 -1
  617. package/structured_query.d.ts +0 -1
  618. package/structured_query.js +0 -1
  619. package/tools.cjs +0 -1
  620. package/tools.d.cts +0 -1
  621. package/tools.d.ts +0 -1
  622. package/tools.js +0 -1
  623. package/tracers/base.cjs +0 -1
  624. package/tracers/base.d.cts +0 -1
  625. package/tracers/base.d.ts +0 -1
  626. package/tracers/base.js +0 -1
  627. package/tracers/console.cjs +0 -1
  628. package/tracers/console.d.cts +0 -1
  629. package/tracers/console.d.ts +0 -1
  630. package/tracers/console.js +0 -1
  631. package/tracers/log_stream.cjs +0 -1
  632. package/tracers/log_stream.d.cts +0 -1
  633. package/tracers/log_stream.d.ts +0 -1
  634. package/tracers/log_stream.js +0 -1
  635. package/tracers/run_collector.cjs +0 -1
  636. package/tracers/run_collector.d.cts +0 -1
  637. package/tracers/run_collector.d.ts +0 -1
  638. package/tracers/run_collector.js +0 -1
  639. package/tracers/tracer_langchain.cjs +0 -1
  640. package/tracers/tracer_langchain.d.cts +0 -1
  641. package/tracers/tracer_langchain.d.ts +0 -1
  642. package/tracers/tracer_langchain.js +0 -1
  643. package/types/stream.cjs +0 -1
  644. package/types/stream.d.cts +0 -1
  645. package/types/stream.d.ts +0 -1
  646. package/types/stream.js +0 -1
  647. package/utils/async_caller.cjs +0 -1
  648. package/utils/async_caller.d.cts +0 -1
  649. package/utils/async_caller.d.ts +0 -1
  650. package/utils/async_caller.js +0 -1
  651. package/utils/chunk_array.cjs +0 -1
  652. package/utils/chunk_array.d.cts +0 -1
  653. package/utils/chunk_array.d.ts +0 -1
  654. package/utils/chunk_array.js +0 -1
  655. package/utils/env.cjs +0 -1
  656. package/utils/env.d.cts +0 -1
  657. package/utils/env.d.ts +0 -1
  658. package/utils/env.js +0 -1
  659. package/utils/event_source_parse.cjs +0 -1
  660. package/utils/event_source_parse.d.cts +0 -1
  661. package/utils/event_source_parse.d.ts +0 -1
  662. package/utils/event_source_parse.js +0 -1
  663. package/utils/format.cjs +0 -1
  664. package/utils/format.d.cts +0 -1
  665. package/utils/format.d.ts +0 -1
  666. package/utils/format.js +0 -1
  667. package/utils/function_calling.cjs +0 -1
  668. package/utils/function_calling.d.cts +0 -1
  669. package/utils/function_calling.d.ts +0 -1
  670. package/utils/function_calling.js +0 -1
  671. package/utils/hash.cjs +0 -1
  672. package/utils/hash.d.cts +0 -1
  673. package/utils/hash.d.ts +0 -1
  674. package/utils/hash.js +0 -1
  675. package/utils/json_patch.cjs +0 -1
  676. package/utils/json_patch.d.cts +0 -1
  677. package/utils/json_patch.d.ts +0 -1
  678. package/utils/json_patch.js +0 -1
  679. package/utils/json_schema.cjs +0 -1
  680. package/utils/json_schema.d.cts +0 -1
  681. package/utils/json_schema.d.ts +0 -1
  682. package/utils/json_schema.js +0 -1
  683. package/utils/math.cjs +0 -1
  684. package/utils/math.d.cts +0 -1
  685. package/utils/math.d.ts +0 -1
  686. package/utils/math.js +0 -1
  687. package/utils/stream.cjs +0 -1
  688. package/utils/stream.d.cts +0 -1
  689. package/utils/stream.d.ts +0 -1
  690. package/utils/stream.js +0 -1
  691. package/utils/testing.cjs +0 -1
  692. package/utils/testing.d.cts +0 -1
  693. package/utils/testing.d.ts +0 -1
  694. package/utils/testing.js +0 -1
  695. package/utils/tiktoken.cjs +0 -1
  696. package/utils/tiktoken.d.cts +0 -1
  697. package/utils/tiktoken.d.ts +0 -1
  698. package/utils/tiktoken.js +0 -1
  699. package/utils/types.cjs +0 -1
  700. package/utils/types.d.cts +0 -1
  701. package/utils/types.d.ts +0 -1
  702. package/utils/types.js +0 -1
  703. package/vectorstores.cjs +0 -1
  704. package/vectorstores.d.cts +0 -1
  705. package/vectorstores.d.ts +0 -1
  706. package/vectorstores.js +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","names":["AIMessage","AIMessageChunk","BaseMessageLike","BaseMessage","StoredMessage","ChatMessage","ChatMessageChunk","FunctionMessage","FunctionMessageChunk","HumanMessage","HumanMessageChunk","SystemMessage","SystemMessageChunk","InvalidToolCall","ToolCall","ToolCallChunk","ToolMessage","$Expand","T","U","K","$KnownKeys","$HasIndexSignature","$OnlyIndexSignatures","$MergeObjects","Record","$MergeDiscriminatedUnion","A","B","Key","PropertyKey","Extract","Constructor","iife","coerceMessageLikeToMessage","getBufferString","mapStoredMessageToChatMessage","__message_js0","MessageStructure","mapStoredMessagesToChatMessages","mapChatMessagesToStoredMessages","convertToChunk","collapseToolCallChunks"],"sources":["../../src/messages/utils.d.ts"],"sourcesContent":["import { AIMessage, AIMessageChunk } from \"./ai.js\";\nimport { BaseMessageLike, BaseMessage, StoredMessage } from \"./base.js\";\nimport { ChatMessage, ChatMessageChunk } from \"./chat.js\";\nimport { FunctionMessage, FunctionMessageChunk } from \"./function.js\";\nimport { HumanMessage, HumanMessageChunk } from \"./human.js\";\nimport { SystemMessage, SystemMessageChunk } from \"./system.js\";\nimport { InvalidToolCall, ToolCall, ToolCallChunk, ToolMessage } from \"./tool.js\";\nexport type $Expand<T> = T extends infer U ? {\n [K in keyof U]: U[K];\n} : never;\n/**\n * Extracts the explicitly declared keys from a type T.\n *\n * @template T - The type to extract keys from\n * @returns A union of keys that are not string, number, or symbol\n */\ntype $KnownKeys<T> = {\n [K in keyof T]: string extends K ? never : number extends K ? never : symbol extends K ? never : K;\n}[keyof T];\n/**\n * Detects if T has an index signature.\n *\n * @template T - The type to check for index signatures\n * @returns True if T has an index signature, false otherwise\n */\ntype $HasIndexSignature<T> = string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : false;\n/**\n * Detects if T has an index signature and no known keys.\n *\n * @template T - The type to check for index signatures and no known keys\n * @returns True if T has an index signature and no known keys, false otherwise\n */\ntype $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<T>] extends [never] ? true : false : false;\n/**\n * Recursively merges two object types T and U, with U taking precedence over T.\n *\n * This utility type performs a deep merge of two object types:\n * - For keys that exist in both T and U:\n * - If both values are objects (Record<string, unknown>), recursively merge them\n * - Otherwise, U's value takes precedence\n * - For keys that exist only in T, use T's value\n * - For keys that exist only in U, use U's value\n *\n * @template T - The first object type to merge\n * @template U - The second object type to merge (takes precedence over T)\n *\n * @example\n * ```ts\n * type ObjectA = {\n * shared: { a: string; b: number };\n * onlyInA: boolean;\n * };\n *\n * type ObjectB = {\n * shared: { b: string; c: Date };\n * onlyInB: symbol;\n * };\n *\n * type Merged = $MergeObjects<ObjectA, ObjectB>;\n * // Result: {\n * // shared: { a: string; b: string; c: Date };\n * // onlyInA: boolean;\n * // onlyInB: symbol;\n * // }\n * ```\n */\nexport type $MergeObjects<T, U> = $OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true ? U : {\n [K in keyof T | keyof U]: K extends keyof T ? K extends keyof U ? T[K] extends Record<string, unknown> ? U[K] extends Record<string, unknown> ? $MergeObjects<T[K], U[K]> : U[K] : U[K] : T[K] : K extends keyof U ? U[K] : never;\n};\n/**\n * Merges two discriminated unions A and B based on a discriminator key (defaults to \"type\").\n * For each possible value of the discriminator across both unions:\n * - If B has a member with that discriminator value, use B's member\n * - Otherwise use A's member with that discriminator value\n * This effectively merges the unions while giving B's members precedence over A's members.\n *\n * @template A - First discriminated union type that extends Record<Key, PropertyKey>\n * @template B - Second discriminated union type that extends Record<Key, PropertyKey>\n * @template Key - The discriminator key property, defaults to \"type\"\n */\nexport type $MergeDiscriminatedUnion<A extends Record<Key, PropertyKey>, B extends Record<Key, PropertyKey>, Key extends PropertyKey = \"type\"> = {\n [T in A[Key] | B[Key]]: [Extract<B, Record<Key, T>>] extends [never] ? Extract<A, Record<Key, T>> : [\n Extract<A, Record<Key, T>>\n ] extends [never] ? Extract<B, Record<Key, T>> : $MergeObjects<Extract<A, Record<Key, T>>, Extract<B, Record<Key, T>>>;\n}[A[Key] | B[Key]];\nexport type Constructor<T> = new (...args: unknown[]) => T;\n/**\n * Immediately-invoked function expression.\n *\n * @param fn - The function to execute\n * @returns The result of the function\n */\nexport declare const iife: <T>(fn: () => T) => T;\nexport declare function coerceMessageLikeToMessage(messageLike: BaseMessageLike): BaseMessage;\n/**\n * This function is used by memory classes to get a string representation\n * of the chat message history, based on the message content and role.\n */\nexport declare function getBufferString(messages: BaseMessage[], humanPrefix?: string, aiPrefix?: string): string;\nexport declare function mapStoredMessageToChatMessage(message: StoredMessage): AIMessage<import(\"./message.js\").MessageStructure> | ChatMessage<import(\"./message.js\").MessageStructure> | FunctionMessage<import(\"./message.js\").MessageStructure> | HumanMessage<import(\"./message.js\").MessageStructure> | SystemMessage<import(\"./message.js\").MessageStructure> | ToolMessage<import(\"./message.js\").MessageStructure>;\n/**\n * Transforms an array of `StoredMessage` instances into an array of\n * `BaseMessage` instances. It uses the `mapV1MessageToStoredMessage`\n * function to ensure all messages are in the `StoredMessage` format, then\n * creates new instances of the appropriate `BaseMessage` subclass based\n * on the type of each message. This function is used to prepare stored\n * messages for use in a chat context.\n */\nexport declare function mapStoredMessagesToChatMessages(messages: StoredMessage[]): BaseMessage[];\n/**\n * Transforms an array of `BaseMessage` instances into an array of\n * `StoredMessage` instances. It does this by calling the `toDict` method\n * on each `BaseMessage`, which returns a `StoredMessage`. This function\n * is used to prepare chat messages for storage.\n */\nexport declare function mapChatMessagesToStoredMessages(messages: BaseMessage[]): StoredMessage[];\nexport declare function convertToChunk(message: BaseMessage): AIMessageChunk<import(\"./message.js\").MessageStructure> | ChatMessageChunk<import(\"./message.js\").MessageStructure> | FunctionMessageChunk<import(\"./message.js\").MessageStructure> | HumanMessageChunk<import(\"./message.js\").MessageStructure> | SystemMessageChunk<import(\"./message.js\").MessageStructure>;\n/**\n * Collapses an array of tool call chunks into complete tool calls.\n *\n * This function groups tool call chunks by their id and/or index, then attempts to\n * parse and validate the accumulated arguments for each group. Successfully parsed\n * tool calls are returned as valid `ToolCall` objects, while malformed ones are\n * returned as `InvalidToolCall` objects.\n *\n * @param chunks - An array of `ToolCallChunk` objects to collapse\n * @returns An object containing:\n * - `tool_call_chunks`: The original input chunks\n * - `tool_calls`: An array of successfully parsed and validated tool calls\n * - `invalid_tool_calls`: An array of tool calls that failed parsing or validation\n *\n * @remarks\n * Chunks are grouped using the following matching logic:\n * - If a chunk has both an id and index, it matches chunks with the same id and index\n * - If a chunk has only an id, it matches chunks with the same id\n * - If a chunk has only an index, it matches chunks with the same index\n *\n * For each group, the function:\n * 1. Concatenates all `args` strings from the chunks\n * 2. Attempts to parse the concatenated string as JSON\n * 3. Validates that the result is a non-null object with a valid id\n * 4. Creates either a `ToolCall` (if valid) or `InvalidToolCall` (if invalid)\n */\nexport declare function collapseToolCallChunks(chunks: ToolCallChunk[]): {\n tool_call_chunks: ToolCallChunk[];\n tool_calls: ToolCall[];\n invalid_tool_calls: InvalidToolCall[];\n};\nexport {};\n//# sourceMappingURL=utils.d.ts.map"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.cts","names":["Runnable","RunnableConfig","BasePromptValueInterface","BaseMessage","ContentBlock","Callbacks","Generation","ChatGeneration","FormatInstructionsOptions","BaseLLMOutputParser","T","Promise","BaseOutputParser","OutputParserException","Error"],"sources":["../../src/output_parsers/base.d.ts"],"sourcesContent":["import { Runnable } from \"../runnables/index.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport type { BaseMessage, ContentBlock } from \"../messages/index.js\";\nimport type { Callbacks } from \"../callbacks/manager.js\";\nimport type { Generation, ChatGeneration } from \"../outputs.js\";\n/**\n * Options for formatting instructions.\n */\nexport interface FormatInstructionsOptions {\n}\n/**\n * Abstract base class for parsing the output of a Large Language Model\n * (LLM) call. It provides methods for parsing the result of an LLM call\n * and invoking the parser with a given input.\n */\nexport declare abstract class BaseLLMOutputParser<T = unknown> extends Runnable<string | BaseMessage, T> {\n /**\n * Parses the result of an LLM call. This method is meant to be\n * implemented by subclasses to define how the output from the LLM should\n * be parsed.\n * @param generations The generations from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n abstract parseResult(generations: Generation[] | ChatGeneration[], callbacks?: Callbacks): Promise<T>;\n /**\n * Parses the result of an LLM call with a given prompt. By default, it\n * simply calls `parseResult`.\n * @param generations The generations from an LLM call.\n * @param _prompt The prompt used in the LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parseResultWithPrompt(generations: Generation[] | ChatGeneration[], _prompt: BasePromptValueInterface, callbacks?: Callbacks): Promise<T>;\n protected _baseMessageToString(message: BaseMessage): string;\n protected _baseMessageContentToString(content: ContentBlock[]): string;\n /**\n * Calls the parser with a given input and optional configuration options.\n * If the input is a string, it creates a generation with the input as\n * text and calls `parseResult`. If the input is a `BaseMessage`, it\n * creates a generation with the input as a message and the content of the\n * input as text, and then calls `parseResult`.\n * @param input The input to the parser, which can be a string or a `BaseMessage`.\n * @param options Optional configuration options.\n * @returns A promise of the parsed output.\n */\n invoke(input: string | BaseMessage, options?: RunnableConfig): Promise<T>;\n}\n/**\n * Class to parse the output of an LLM call.\n */\nexport declare abstract class BaseOutputParser<T = unknown> extends BaseLLMOutputParser<T> {\n parseResult(generations: Generation[] | ChatGeneration[], callbacks?: Callbacks): Promise<T>;\n /**\n * Parse the output of an LLM call.\n *\n * @param text - LLM output to parse.\n * @returns Parsed output.\n */\n abstract parse(text: string, callbacks?: Callbacks): Promise<T>;\n parseWithPrompt(text: string, _prompt: BasePromptValueInterface, callbacks?: Callbacks): Promise<T>;\n /**\n * Return a string describing the format of the output.\n * @returns Format instructions.\n * @param options - Options for formatting instructions.\n * @example\n * ```json\n * {\n * \"foo\": \"bar\"\n * }\n * ```\n */\n abstract getFormatInstructions(options?: FormatInstructionsOptions): string;\n /**\n * Return the string type key uniquely identifying this class of parser\n */\n _type(): string;\n}\n/**\n * Exception that output parsers should raise to signify a parsing error.\n *\n * This exists to differentiate parsing errors from other code or execution errors\n * that also may arise inside the output parser. OutputParserExceptions will be\n * available to catch and handle in ways to fix the parsing error, while other\n * errors will be raised.\n *\n * @param message - The error that's being re-raised or an error message.\n * @param llmOutput - String model output which is error-ing.\n * @param observation - String explanation of error which can be passed to a\n * model to try and remediate the issue.\n * @param sendToLLM - Whether to send the observation and llm_output back to an Agent\n * after an OutputParserException has been raised. This gives the underlying\n * model driving the agent the context that the previous output was improperly\n * structured, in the hopes that it will update the output to the correct\n * format.\n */\nexport declare class OutputParserException extends Error {\n llmOutput?: string;\n observation?: string;\n sendToLLM: boolean;\n constructor(message: string, llmOutput?: string, observation?: string, sendToLLM?: boolean);\n}\n//# sourceMappingURL=base.d.ts.map"],"mappings":";;;;;;;;;;;;AASiBQ,UAAAA,yBAAAA,CAAyB,CAO1C;;;;;;AASuGE,uBATzED,mBASyEC,CAAAA,IAAAA,OAAAA,CAAAA,SAThCV,QASgCU,CAAAA,MAAAA,GATdP,WAScO,EATDA,CASCA,CAAAA,CAAAA;EAARC;;;;;;;;EAW5CP,SAAAA,WAAAA,CAAAA,WAAAA,EAXbE,UAWaF,EAAAA,GAXEG,cAWFH,EAAAA,EAAAA,SAAAA,CAAAA,EAXgCC,SAWhCD,CAAAA,EAX4CO,OAW5CP,CAXoDM,CAWpDN,CAAAA;EAWxBD;;;;;AA/BoD;AAoC/E;;EAC6BG,qBAAAA,CAAAA,WAAAA,EAnBUA,UAmBVA,EAAAA,GAnByBC,cAmBzBD,EAAAA,EAAAA,OAAAA,EAnBoDJ,wBAmBpDI,EAAAA,SAAAA,CAAAA,EAnB0FD,SAmB1FC,CAAAA,EAnBsGK,OAmBtGL,CAnB8GI,CAmB9GJ,CAAAA;EAAeC,UAAAA,oBAAAA,CAAAA,OAAAA,EAlBAJ,WAkBAI,CAAAA,EAAAA,MAAAA;EAA8BF,UAAAA,2BAAAA,CAAAA,OAAAA,EAjBvBD,YAiBuBC,EAAAA,CAAAA,EAAAA,MAAAA;EAAoBK;;;;;;;;;;EAD1BD,MAAAA,CAAAA,KAAAA,EAAAA,MAAAA,GALzCN,WAKyCM,EAAAA,OAAAA,CAAAA,EALlBR,cAKkBQ,CAAAA,EALDE,OAKCF,CALOC,CAKPD,CAAAA;AAAmB;AA6CvF;;;uBA7C8BG,sCAAsCH,oBAAoBC;2BAC3DJ,eAAeC,8BAA8BF,YAAYM,QAAQD;;;;;;;2CAOjDL,YAAYM,QAAQD;yCACtBR,sCAAsCG,YAAYM,QAAQD;;;;;;;;;;;;2CAYxDF;;;;;;;;;;;;;;;;;;;;;;;;cAwBxBK,qBAAAA,SAA8BC,KAAK"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","names":["Runnable","RunnableConfig","BasePromptValueInterface","BaseMessage","ContentBlock","Callbacks","Generation","ChatGeneration","FormatInstructionsOptions","BaseLLMOutputParser","T","Promise","BaseOutputParser","OutputParserException","Error"],"sources":["../../src/output_parsers/base.d.ts"],"sourcesContent":["import { Runnable } from \"../runnables/index.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport type { BaseMessage, ContentBlock } from \"../messages/index.js\";\nimport type { Callbacks } from \"../callbacks/manager.js\";\nimport type { Generation, ChatGeneration } from \"../outputs.js\";\n/**\n * Options for formatting instructions.\n */\nexport interface FormatInstructionsOptions {\n}\n/**\n * Abstract base class for parsing the output of a Large Language Model\n * (LLM) call. It provides methods for parsing the result of an LLM call\n * and invoking the parser with a given input.\n */\nexport declare abstract class BaseLLMOutputParser<T = unknown> extends Runnable<string | BaseMessage, T> {\n /**\n * Parses the result of an LLM call. This method is meant to be\n * implemented by subclasses to define how the output from the LLM should\n * be parsed.\n * @param generations The generations from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n abstract parseResult(generations: Generation[] | ChatGeneration[], callbacks?: Callbacks): Promise<T>;\n /**\n * Parses the result of an LLM call with a given prompt. By default, it\n * simply calls `parseResult`.\n * @param generations The generations from an LLM call.\n * @param _prompt The prompt used in the LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parseResultWithPrompt(generations: Generation[] | ChatGeneration[], _prompt: BasePromptValueInterface, callbacks?: Callbacks): Promise<T>;\n protected _baseMessageToString(message: BaseMessage): string;\n protected _baseMessageContentToString(content: ContentBlock[]): string;\n /**\n * Calls the parser with a given input and optional configuration options.\n * If the input is a string, it creates a generation with the input as\n * text and calls `parseResult`. If the input is a `BaseMessage`, it\n * creates a generation with the input as a message and the content of the\n * input as text, and then calls `parseResult`.\n * @param input The input to the parser, which can be a string or a `BaseMessage`.\n * @param options Optional configuration options.\n * @returns A promise of the parsed output.\n */\n invoke(input: string | BaseMessage, options?: RunnableConfig): Promise<T>;\n}\n/**\n * Class to parse the output of an LLM call.\n */\nexport declare abstract class BaseOutputParser<T = unknown> extends BaseLLMOutputParser<T> {\n parseResult(generations: Generation[] | ChatGeneration[], callbacks?: Callbacks): Promise<T>;\n /**\n * Parse the output of an LLM call.\n *\n * @param text - LLM output to parse.\n * @returns Parsed output.\n */\n abstract parse(text: string, callbacks?: Callbacks): Promise<T>;\n parseWithPrompt(text: string, _prompt: BasePromptValueInterface, callbacks?: Callbacks): Promise<T>;\n /**\n * Return a string describing the format of the output.\n * @returns Format instructions.\n * @param options - Options for formatting instructions.\n * @example\n * ```json\n * {\n * \"foo\": \"bar\"\n * }\n * ```\n */\n abstract getFormatInstructions(options?: FormatInstructionsOptions): string;\n /**\n * Return the string type key uniquely identifying this class of parser\n */\n _type(): string;\n}\n/**\n * Exception that output parsers should raise to signify a parsing error.\n *\n * This exists to differentiate parsing errors from other code or execution errors\n * that also may arise inside the output parser. OutputParserExceptions will be\n * available to catch and handle in ways to fix the parsing error, while other\n * errors will be raised.\n *\n * @param message - The error that's being re-raised or an error message.\n * @param llmOutput - String model output which is error-ing.\n * @param observation - String explanation of error which can be passed to a\n * model to try and remediate the issue.\n * @param sendToLLM - Whether to send the observation and llm_output back to an Agent\n * after an OutputParserException has been raised. This gives the underlying\n * model driving the agent the context that the previous output was improperly\n * structured, in the hopes that it will update the output to the correct\n * format.\n */\nexport declare class OutputParserException extends Error {\n llmOutput?: string;\n observation?: string;\n sendToLLM: boolean;\n constructor(message: string, llmOutput?: string, observation?: string, sendToLLM?: boolean);\n}\n//# sourceMappingURL=base.d.ts.map"],"mappings":";;;;;;;;;;;;;;;UASiBQ,yBAAAA;;AAAjB;AAOA;;;AASsCF,uBATRG,mBASQH,CAAAA,IAAAA,OAAAA,CAAAA,SATiCN,QASjCM,CAAAA,MAAAA,GATmDH,WASnDG,EATgEI,CAShEJ,CAAAA,CAAAA;EAAeC;;;;;;;;EASsFG,SAAAA,WAAAA,CAAAA,WAAAA,EATrGJ,UASqGI,EAAAA,GATtFH,cASsFG,EAAAA,EAAAA,SAAAA,CAAAA,EATxDL,SASwDK,CAAAA,EAT5CC,OAS4CD,CATpCA,CASoCA,CAAAA;EAARC;;;;;;;;EAlBpD,qBAAA,CAAA,WAAA,EAkBxCL,UAlBwC,EAAA,GAkBzBC,cAlByB,EAAA,EAAA,OAAA,EAkBEL,wBAlBF,EAAA,SAAA,CAAA,EAkBwCG,SAlBxC,CAAA,EAkBoDM,OAlBpD,CAkB4DD,CAlB5D,CAAA;EAoCjDE,UAAAA,oBAAgBF,CAAAA,OAAA,EAjBFP,WAiBE,CAAA,EAAA,MAAA;EAA0CO,UAAAA,2BAAAA,CAAAA,OAAAA,EAhBrCN,YAgBqCM,EAAAA,CAAAA,EAAAA,MAAAA;EAC3DJ;;;;;;;;;;EAQwEI,MAAAA,CAAAA,KAAAA,EAAAA,MAAAA,GAd1EP,WAc0EO,EAAAA,OAAAA,CAAAA,EAdnDT,cAcmDS,CAAAA,EAdlCC,OAckCD,CAd1BA,CAc0BA,CAAAA;;;;AATd;AA6ClEG,uBA7CSD,gBA6C0B,CAAA,IAAA,OAAA,CAAA,SA7CYH,mBA6CZ,CA7CgCC,CA6ChC,CAAA,CAAA;2BA5C3BJ,eAAeC,8BAA8BF,YAAYM,QAAQD;;;;;;;2CAOjDL,YAAYM,QAAQD;yCACtBR,sCAAsCG,YAAYM,QAAQD;;;;;;;;;;;;2CAYxDF;;;;;;;;;;;;;;;;;;;;;;;;cAwBxBK,qBAAAA,SAA8BC,KAAK"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes.d.cts","names":["BaseTransformOutputParser","BytesOutputParser","Uint8Array","TextEncoder","InstanceType","Promise"],"sources":["../../src/output_parsers/bytes.d.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * OutputParser that parses LLMResult into the top likely string and\n * encodes it into bytes.\n */\nexport declare class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected textEncoder: InstanceType<typeof TextEncoder>;\n parse(text: string): Promise<Uint8Array>;\n getFormatInstructions(): string;\n}\n//# sourceMappingURL=bytes.d.ts.map"],"mappings":";;;;;;AAKA;;AAI+CG,cAJ1BF,iBAAAA,SAA0BD,yBAIAG,CAJ0BD,UAI1BC,CAAAA,CAAAA;EAApBC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACMF,YAAAA,EAAAA,MAAAA,EAAAA;EAARG,eAAAA,EAAAA,OAAAA;EALsBL,UAAAA,WAAAA,EAIpBI,YAJoBJ,CAAAA,OAIAG,WAJAH,CAAAA;EAAyB,KAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAK/CK,OAL+C,CAKvCH,UALuC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes.d.ts","names":["BaseTransformOutputParser","BytesOutputParser","Uint8Array","TextEncoder","InstanceType","Promise"],"sources":["../../src/output_parsers/bytes.d.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * OutputParser that parses LLMResult into the top likely string and\n * encodes it into bytes.\n */\nexport declare class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected textEncoder: InstanceType<typeof TextEncoder>;\n parse(text: string): Promise<Uint8Array>;\n getFormatInstructions(): string;\n}\n//# sourceMappingURL=bytes.d.ts.map"],"mappings":";;;;;;AAKA;;AAI+CG,cAJ1BF,iBAAAA,SAA0BD,yBAIAG,CAJ0BD,UAI1BC,CAAAA,CAAAA;EAApBC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACMF,YAAAA,EAAAA,MAAAA,EAAAA;EAARG,eAAAA,EAAAA,OAAAA;EALsBL,UAAAA,WAAAA,EAIpBI,YAJoBJ,CAAAA,OAIAG,WAJAH,CAAAA;EAAyB,KAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAK/CK,OAL+C,CAKvCH,UALuC,CAAA"}
@@ -8,17 +8,13 @@ import { parseJsonMarkdown, parsePartialJson } from "../utils/json.cjs";
8
8
  /**
9
9
  * Class for parsing the output of an LLM into a JSON object.
10
10
  */
11
- declare class JsonOutputParser<
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- T extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {
11
+ declare class JsonOutputParser<T extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {
14
12
  static lc_name(): string;
15
13
  lc_namespace: string[];
16
14
  lc_serializable: boolean;
17
15
  /** @internal */
18
16
  _concatOutputChunks<T>(first: T, second: T): T;
19
17
  protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;
20
- // This should actually return Partial<T>, but there's no way
21
- // to specify emitted chunks as instances separate from the main output type.
22
18
  parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<T | undefined>;
23
19
  parse(text: string): Promise<T>;
24
20
  getFormatInstructions(): string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.cts","names":["BaseCumulativeTransformOutputParser","Operation","ChatGeneration","Generation","parseJsonMarkdown","parsePartialJson","JsonOutputParser","T","Record","Promise"],"sources":["../../src/output_parsers/json.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nimport { parseJsonMarkdown, parsePartialJson } from \"../utils/json.js\";\n/**\n * Class for parsing the output of an LLM into a JSON object.\n */\nexport declare class JsonOutputParser<T extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /** @internal */\n _concatOutputChunks<T>(first: T, second: T): T;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<T | undefined>;\n parse(text: string): Promise<T>;\n getFormatInstructions(): string;\n}\nexport { parsePartialJson, parseJsonMarkdown };\n//# sourceMappingURL=json.d.ts.map"],"mappings":";;;;;;;;;AAOA;AAAgDQ,cAA3BF,gBAA2BE,CAAAA,UAAAA,MAAAA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAAsBA,MAAtBA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SAAmDR,mCAAnDQ,CAAuFD,CAAvFC,CAAAA,CAAAA;EAAsBA,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAiED,YAAAA,EAAAA,MAAAA,EAAAA;EAKrGA,eAAAA,EAAAA,OAAAA;EAAWA;EAAIA,mBAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,EAAfA,CAAeA,EAAAA,MAAAA,EAAJA,CAAIA,CAAAA,EAAAA,CAAAA;EACcN,UAAAA,KAAAA,CAAAA,IAAAA,EAAAA,OAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,OAAAA,CAAAA,EAAAA,SAAAA,EAAAA,GAAAA,SAAAA;EAC3BC,kBAAAA,CAAAA,WAAAA,EAAAA,cAAAA,EAAAA,GAAmBC,UAAnBD,EAAAA,CAAAA,EAAkCO,OAAlCP,CAA0CK,CAA1CL,GAAAA,SAAAA,CAAAA;EAAmBC,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAC9BM,OAD8BN,CACtBI,CADsBJ,CAAAA;EAAuBI,qBAAAA,CAAAA,CAAAA,EAAAA,MAAAA"}
@@ -8,17 +8,13 @@ import { parseJsonMarkdown, parsePartialJson } from "../utils/json.js";
8
8
  /**
9
9
  * Class for parsing the output of an LLM into a JSON object.
10
10
  */
11
- declare class JsonOutputParser<
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- T extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {
11
+ declare class JsonOutputParser<T extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {
14
12
  static lc_name(): string;
15
13
  lc_namespace: string[];
16
14
  lc_serializable: boolean;
17
15
  /** @internal */
18
16
  _concatOutputChunks<T>(first: T, second: T): T;
19
17
  protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;
20
- // This should actually return Partial<T>, but there's no way
21
- // to specify emitted chunks as instances separate from the main output type.
22
18
  parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<T | undefined>;
23
19
  parse(text: string): Promise<T>;
24
20
  getFormatInstructions(): string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","names":["BaseCumulativeTransformOutputParser","Operation","ChatGeneration","Generation","parseJsonMarkdown","parsePartialJson","JsonOutputParser","T","Record","Promise"],"sources":["../../src/output_parsers/json.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nimport { parseJsonMarkdown, parsePartialJson } from \"../utils/json.js\";\n/**\n * Class for parsing the output of an LLM into a JSON object.\n */\nexport declare class JsonOutputParser<T extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /** @internal */\n _concatOutputChunks<T>(first: T, second: T): T;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<T | undefined>;\n parse(text: string): Promise<T>;\n getFormatInstructions(): string;\n}\nexport { parsePartialJson, parseJsonMarkdown };\n//# sourceMappingURL=json.d.ts.map"],"mappings":";;;;;;;;;AAOA;AAAgDQ,cAA3BF,gBAA2BE,CAAAA,UAAAA,MAAAA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAAsBA,MAAtBA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SAAmDR,mCAAnDQ,CAAuFD,CAAvFC,CAAAA,CAAAA;EAAsBA,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAiED,YAAAA,EAAAA,MAAAA,EAAAA;EAKrGA,eAAAA,EAAAA,OAAAA;EAAWA;EAAIA,mBAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,EAAfA,CAAeA,EAAAA,MAAAA,EAAJA,CAAIA,CAAAA,EAAAA,CAAAA;EACcN,UAAAA,KAAAA,CAAAA,IAAAA,EAAAA,OAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,OAAAA,CAAAA,EAAAA,SAAAA,EAAAA,GAAAA,SAAAA;EAC3BC,kBAAAA,CAAAA,WAAAA,EAAAA,cAAAA,EAAAA,GAAmBC,UAAnBD,EAAAA,CAAAA,EAAkCO,OAAlCP,CAA0CK,CAA1CL,GAAAA,SAAAA,CAAAA;EAAmBC,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAC9BM,OAD8BN,CACtBI,CADsBJ,CAAAA;EAAuBI,qBAAAA,CAAAA,CAAAA,EAAAA,MAAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.cts","names":["BaseMessage","BaseTransformOutputParser","ListOutputParser","RegExp","AsyncGenerator","CommaSeparatedListOutputParser","Promise","CustomListOutputParser","length","separator","NumberedListOutputParser","MarkdownListOutputParser"],"sources":["../../src/output_parsers/list.d.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport declare abstract class ListOutputParser extends BaseTransformOutputParser<string[]> {\n re?: RegExp;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<string[]>;\n}\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport declare class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport declare class CustomListOutputParser extends ListOutputParser {\n lc_namespace: string[];\n private length;\n private separator;\n constructor({ length, separator }: {\n length?: number;\n separator?: string;\n });\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\nexport declare class NumberedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\nexport declare class MarkdownListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\n//# sourceMappingURL=list.d.ts.map"],"mappings":";;;;;;;AAMA;;AAEuDA,uBAFzBE,gBAAAA,SAAyBD,yBAEAD,CAAAA,MAAAA,EAAAA,CAAAA,CAAAA;EAAxBI,EAAAA,CAAAA,EADtBD,MACsBC;EAAuCA,UAAAA,CAAAA,cAAAA,EAAvCA,cAAuCA,CAAAA,MAAAA,GAAfJ,WAAeI,CAAAA,CAAAA,EAAAA,cAAAA,CAAAA,MAAAA,EAAAA,CAAAA;;AAFU;AAQhF;AAsBA;;AAI0BK,cA1BLJ,8BAAAA,SAAuCH,gBAAgB,CA0BlDO;EAWDH,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAf2BJ,YAAAA,EAAAA,MAAAA,EAAAA;EAAgB,eAAA,EAAA,OAAA;EAwB/CQ;;;;AAAiD;AAQtE;EAKQP,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EAjDiBG,OAiDjBH,CAAAA,MAAAA,EAAAA,CAAAA;EACiBG;;AAN6C;;;;;;;;;cAhCjDC,sBAAAA,SAA+BL,gBAAAA;;;;;;;;;;;;;;;;;;uBAe3BI;;;;;;;;;cASJI,wBAAAA,SAAiCR,gBAAAA;;;;;MAK9CC;uBACiBG;;cAEJK,wBAAAA,SAAiCT,gBAAAA;;;;;MAK9CC;uBACiBG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","names":["BaseMessage","BaseTransformOutputParser","ListOutputParser","RegExp","AsyncGenerator","CommaSeparatedListOutputParser","Promise","CustomListOutputParser","length","separator","NumberedListOutputParser","MarkdownListOutputParser"],"sources":["../../src/output_parsers/list.d.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport declare abstract class ListOutputParser extends BaseTransformOutputParser<string[]> {\n re?: RegExp;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<string[]>;\n}\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport declare class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport declare class CustomListOutputParser extends ListOutputParser {\n lc_namespace: string[];\n private length;\n private separator;\n constructor({ length, separator }: {\n length?: number;\n separator?: string;\n });\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n parse(text: string): Promise<string[]>;\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string;\n}\nexport declare class NumberedListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\nexport declare class MarkdownListOutputParser extends ListOutputParser {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n getFormatInstructions(): string;\n re: RegExp;\n parse(text: string): Promise<string[]>;\n}\n//# sourceMappingURL=list.d.ts.map"],"mappings":";;;;;;;;;AAMA;AACSG,uBADqBD,gBAAAA,SAAyBD,yBAC9CE,CAAAA,MAAAA,EAAAA,CAAAA,CAAAA;EAC8CH,EAAAA,CAAAA,EAD9CG,MAC8CH;EAAxBI,UAAAA,CAAAA,cAAAA,EAAAA,cAAAA,CAAAA,MAAAA,GAAwBJ,WAAxBI,CAAAA,CAAAA,EAAuCA,cAAvCA,CAAAA,MAAAA,EAAAA,CAAAA;;;AAFiD;AAQhF;AAsBA;AAIkBI,cA1BGH,8BAAAA,SAAuCH,gBAAgB,CA0B1DM;EAAQC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAWDH,YAAAA,EAAAA,MAAAA,EAAAA;EAf2BJ,eAAAA,EAAAA,OAAAA;EAAgB;AAwBpE;;;;AAAsE;EAQjDS,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EA5CIL,OA4CoB,CAAA,MAAA,EAAA,CAAA;EAKrCH;;;AAL8D;;;;;;;;cAhCjDI,sBAAAA,SAA+BL,gBAAAA;;;;;;;;;;;;;;;;;;uBAe3BI;;;;;;;;;cASJI,wBAAAA,SAAiCR,gBAAAA;;;;;MAK9CC;uBACiBG;;cAEJK,wBAAAA,SAAiCT,gBAAAA;;;;;MAK9CC;uBACiBG"}
@@ -35,9 +35,7 @@ declare class OutputFunctionsParser extends BaseLLMOutputParser<string> {
35
35
  * Class for parsing the output of an LLM into a JSON object. Uses an
36
36
  * instance of `OutputFunctionsParser` to parse the output.
37
37
  */
38
- declare class JsonOutputFunctionsParser<
39
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
- Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {
38
+ declare class JsonOutputFunctionsParser<Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {
41
39
  static lc_name(): string;
42
40
  lc_namespace: string[];
43
41
  lc_serializable: boolean;
@@ -63,9 +61,7 @@ Output extends Record<string, any> = Record<string, any>> extends BaseCumulative
63
61
  * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`
64
62
  * to parse the output.
65
63
  */
66
- declare class JsonKeyOutputFunctionsParser<
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {
64
+ declare class JsonKeyOutputFunctionsParser<T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {
69
65
  static lc_name(): string;
70
66
  lc_namespace: string[];
71
67
  lc_serializable: boolean;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json_output_functions_parsers.d.cts","names":["Optional","Generation","ChatGeneration","BaseLLMOutputParser","BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","JsonSchema7ObjectType","Operation","JSONPatchOperation","FunctionParameters","OutputFunctionsParser","Promise","JsonOutputFunctionsParser","Output","Record","JsonKeyOutputFunctionsParser","T"],"sources":["../../../src/output_parsers/openai_functions/json_output_functions_parsers.d.ts"],"sourcesContent":["import { Optional } from \"../../types/type-utils.js\";\nimport { Generation, ChatGeneration } from \"../../outputs.js\";\nimport { BaseLLMOutputParser } from \"../base.js\";\nimport { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"../transform.js\";\nimport { JsonSchema7ObjectType } from \"../../utils/json_schema.js\";\nimport { type Operation as JSONPatchOperation } from \"../../utils/json_patch.js\";\n/**\n * Represents optional parameters for a function in a JSON Schema.\n */\nexport type FunctionParameters = Optional<JsonSchema7ObjectType, \"additionalProperties\">;\n/**\n * Class for parsing the output of an LLM. Can be configured to return\n * only the arguments of the function call in the output.\n */\nexport declare class OutputFunctionsParser extends BaseLLMOutputParser<string> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n argsOnly: boolean;\n constructor(config?: {\n argsOnly?: boolean;\n });\n /**\n * Parses the output and returns a string representation of the function\n * call or its arguments.\n * @param generations The output of the LLM to parse.\n * @returns A string representation of the function call or its arguments.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<string>;\n}\n/**\n * Class for parsing the output of an LLM into a JSON object. Uses an\n * instance of `OutputFunctionsParser` to parse the output.\n */\nexport declare class JsonOutputFunctionsParser<Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n outputParser: OutputFunctionsParser;\n argsOnly: boolean;\n constructor(config?: {\n argsOnly?: boolean;\n } & BaseCumulativeTransformOutputParserInput);\n protected _diff(prev: unknown | undefined, next: unknown): JSONPatchOperation[] | undefined;\n parsePartialResult(generations: ChatGeneration[]): Promise<Output | undefined>;\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<Output>;\n parse(text: string): Promise<Output>;\n getFormatInstructions(): string;\n}\n/**\n * Class for parsing the output of an LLM into a JSON object and returning\n * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`\n * to parse the output.\n */\nexport declare class JsonKeyOutputFunctionsParser<T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n outputParser: JsonOutputFunctionsParser<Record<string, any>>;\n attrName: string;\n get lc_aliases(): {\n attrName: string;\n };\n constructor(fields: {\n attrName: string;\n });\n /**\n * Parses the output and returns a specific attribute of the parsed JSON\n * object.\n * @param generations The output of the LLM to parse.\n * @returns The value of a specific attribute of the parsed JSON object.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<T>;\n}\n//# sourceMappingURL=json_output_functions_parsers.d.ts.map"],"mappings":";;;;;;;;;;;AASA;AAKqBU,KALTD,kBAAAA,GAAqBT,QAKS,CALAM,qBAKA,EAAA,sBAAA,CAAA;;;;;AAA4B,cAAjDI,qBAAAA,SAA8BP,mBAAmB,CAAA,MAAA,CAAA,CAAA;EAoBjDS,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAyCE,YAAAA,EAAAA,MAAAA,EAAAA;EAAsBA,eAAAA,EAAAA,OAAAA;EAAiED,QAAAA,EAAAA,OAAAA;EAInIH,WAAAA,CAAAA,MAK6CF,CAL7CE,EAAAA;IAIVL,QAAAA,CAAAA,EAAAA,OAAAA;EACuDG,CAAAA;EAC3BN;;;;;;EAO2BS,WAAAA,CAAAA,WAAAA,EAvBlCV,UAuBkCU,EAAAA,GAvBnBT,cAuBmBS,EAAAA,CAAAA,EAvBAA,OAuBAA,CAAAA,MAAAA,CAAAA;;;;AAjBqF;AA0BpJ;AAA4DG,cA1BvCF,yBA0BuCE,CAAAA,eA1BEA,MA0BFA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GA1BwBA,MA0BxBA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SA1BqDV,mCA0BrDU,CA1ByFD,MA0BzFC,CAAAA,CAAAA;EAAsBA,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAiDE,YAAAA,EAAAA,MAAAA,EAAAA;EAIvFF,eAAAA,EAAAA,OAAAA;EAA1BF,YAAAA,EA1BAF,qBA0BAE;EAcWX,QAAAA,EAAAA,OAAAA;EAAeC,WAAAA,CAAAA,MAAmBS,CAAnBT,EAAAA;IAA2Bc,QAAAA,CAAAA,EAAAA,OAAAA;EAARL,CAAAA,GApCvDN,wCAoCuDM;EAlBgDR,UAAAA,KAAAA,CAAAA,IAAAA,EAAAA,OAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,OAAAA,CAAAA,EAjBhDK,SAiBgDL,EAAAA,GAAAA,SAAAA;EAAmB,kBAAA,CAAA,WAAA,EAhB9FD,cAgB8F,EAAA,CAAA,EAhB3ES,OAgB2E,CAhBnEE,MAgBmE,GAAA,SAAA,CAAA;;;;;;;2BATrGZ,eAAeC,mBAAmBS,QAAQE;uBAC9CF,QAAQE;;;;;;;;cAQZE,uCAAuCD,sBAAsBA,6BAA6BX,oBAAoBa;;;;gBAIjHJ,0BAA0BE;;;;;;;;;;;;;;2BAcfb,eAAeC,mBAAmBS,QAAQK"}
@@ -35,9 +35,7 @@ declare class OutputFunctionsParser extends BaseLLMOutputParser<string> {
35
35
  * Class for parsing the output of an LLM into a JSON object. Uses an
36
36
  * instance of `OutputFunctionsParser` to parse the output.
37
37
  */
38
- declare class JsonOutputFunctionsParser<
39
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
- Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {
38
+ declare class JsonOutputFunctionsParser<Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {
41
39
  static lc_name(): string;
42
40
  lc_namespace: string[];
43
41
  lc_serializable: boolean;
@@ -63,9 +61,7 @@ Output extends Record<string, any> = Record<string, any>> extends BaseCumulative
63
61
  * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`
64
62
  * to parse the output.
65
63
  */
66
- declare class JsonKeyOutputFunctionsParser<
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {
64
+ declare class JsonKeyOutputFunctionsParser<T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {
69
65
  static lc_name(): string;
70
66
  lc_namespace: string[];
71
67
  lc_serializable: boolean;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json_output_functions_parsers.d.ts","names":["Optional","Generation","ChatGeneration","BaseLLMOutputParser","BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","JsonSchema7ObjectType","Operation","JSONPatchOperation","FunctionParameters","OutputFunctionsParser","Promise","JsonOutputFunctionsParser","Output","Record","JsonKeyOutputFunctionsParser","T"],"sources":["../../../src/output_parsers/openai_functions/json_output_functions_parsers.d.ts"],"sourcesContent":["import { Optional } from \"../../types/type-utils.js\";\nimport { Generation, ChatGeneration } from \"../../outputs.js\";\nimport { BaseLLMOutputParser } from \"../base.js\";\nimport { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"../transform.js\";\nimport { JsonSchema7ObjectType } from \"../../utils/json_schema.js\";\nimport { type Operation as JSONPatchOperation } from \"../../utils/json_patch.js\";\n/**\n * Represents optional parameters for a function in a JSON Schema.\n */\nexport type FunctionParameters = Optional<JsonSchema7ObjectType, \"additionalProperties\">;\n/**\n * Class for parsing the output of an LLM. Can be configured to return\n * only the arguments of the function call in the output.\n */\nexport declare class OutputFunctionsParser extends BaseLLMOutputParser<string> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n argsOnly: boolean;\n constructor(config?: {\n argsOnly?: boolean;\n });\n /**\n * Parses the output and returns a string representation of the function\n * call or its arguments.\n * @param generations The output of the LLM to parse.\n * @returns A string representation of the function call or its arguments.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<string>;\n}\n/**\n * Class for parsing the output of an LLM into a JSON object. Uses an\n * instance of `OutputFunctionsParser` to parse the output.\n */\nexport declare class JsonOutputFunctionsParser<Output extends Record<string, any> = Record<string, any>> extends BaseCumulativeTransformOutputParser<Output> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n outputParser: OutputFunctionsParser;\n argsOnly: boolean;\n constructor(config?: {\n argsOnly?: boolean;\n } & BaseCumulativeTransformOutputParserInput);\n protected _diff(prev: unknown | undefined, next: unknown): JSONPatchOperation[] | undefined;\n parsePartialResult(generations: ChatGeneration[]): Promise<Output | undefined>;\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<Output>;\n parse(text: string): Promise<Output>;\n getFormatInstructions(): string;\n}\n/**\n * Class for parsing the output of an LLM into a JSON object and returning\n * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`\n * to parse the output.\n */\nexport declare class JsonKeyOutputFunctionsParser<T extends Record<string, any> = Record<string, any>> extends BaseLLMOutputParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n outputParser: JsonOutputFunctionsParser<Record<string, any>>;\n attrName: string;\n get lc_aliases(): {\n attrName: string;\n };\n constructor(fields: {\n attrName: string;\n });\n /**\n * Parses the output and returns a specific attribute of the parsed JSON\n * object.\n * @param generations The output of the LLM to parse.\n * @returns The value of a specific attribute of the parsed JSON object.\n */\n parseResult(generations: Generation[] | ChatGeneration[]): Promise<T>;\n}\n//# sourceMappingURL=json_output_functions_parsers.d.ts.map"],"mappings":";;;;;;;;;;;;AASYS,KAAAA,kBAAAA,GAAqBT,QAASM,CAAAA,qBAATN,EAAAA,sBAAQ,CAAA;AAKzC;;;;AAAmDG,cAA9BO,qBAAAA,SAA8BP,mBAAAA,CAAAA,MAAAA,CAAAA,CAAAA;EAAmB,OAAA,OAAA,CAAA,CAAA,EAAA,MAAA;EAoBjDS,YAAAA,EAAAA,MAAAA,EAAAA;EAAyCE,eAAAA,EAAAA,OAAAA;EAAsBA,QAAAA,EAAAA,OAAAA;EAAiED,WAAAA,CAAAA,MAQ7IR,CAR6IQ,EAAAA;IAInIH,QAAAA,CAAAA,EAAAA,OAAAA;EAIVL,CAAAA;EACuDG;;;;;;EAQQK,WAAAA,CAAAA,WAAAA,EAvB1CZ,UAuB0CY,EAAAA,GAvB3BX,cAuB2BW,EAAAA,CAAAA,EAvBRF,OAuBQE,CAAAA,MAAAA,CAAAA;;;;;AAjB6E;AA0B/HE,cA1BAH,yBA0B4BI,CAAAA,eA1BaF,MA0Bb,CAAA,MAAA,EAAA,GAAA,CAAA,GA1BmCA,MA0BnC,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SA1BgEV,mCA0BhE,CA1BoGS,MA0BpG,CAAA,CAAA;EAAWC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAsBA,YAAAA,EAAAA,MAAAA,EAAAA;EAAiDE,eAAAA,EAAAA,OAAAA;EAIvFF,YAAAA,EA1B1BJ,qBA0B0BI;EAA1BF,QAAAA,EAAAA,OAAAA;EAcWX,WAAAA,CAAAA,MAA0Ce,CAA1Cf,EAAAA;IAAeC,QAAAA,CAAAA,EAAAA,OAAAA;EAA2Bc,CAAAA,GApC/DX,wCAoC+DW;EAARL,UAAAA,KAAAA,CAAAA,IAAAA,EAAAA,OAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,OAAAA,CAAAA,EAnCAH,SAmCAG,EAAAA,GAAAA,SAAAA;EAlBgDR,kBAAAA,CAAAA,WAAAA,EAhB3ED,cAgB2EC,EAAAA,CAAAA,EAhBxDQ,OAgBwDR,CAhBhDU,MAgBgDV,GAAAA,SAAAA,CAAAA;EAAmB;;;;;;2BATrGF,eAAeC,mBAAmBS,QAAQE;uBAC9CF,QAAQE;;;;;;;;cAQZE,uCAAuCD,sBAAsBA,6BAA6BX,oBAAoBa;;;;gBAIjHJ,0BAA0BE;;;;;;;;;;;;;;2BAcfb,eAAeC,mBAAmBS,QAAQK"}
@@ -9,28 +9,21 @@ import * as z4 from "zod/v4/core";
9
9
  type ParsedToolCall = {
10
10
  id?: string;
11
11
  type: string;
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
12
  args: Record<string, any>;
14
13
  };
15
14
  type JsonOutputToolsParserParams = {
16
15
  /** Whether to return the tool call id. */
17
16
  returnId?: boolean;
18
17
  } & BaseCumulativeTransformOutputParserInput;
19
- declare function parseToolCall(
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- rawToolCall: Record<string, any>, options: {
18
+ declare function parseToolCall(rawToolCall: Record<string, any>, options: {
22
19
  returnId?: boolean;
23
20
  partial: true;
24
21
  }): ToolCall | undefined;
25
- declare function parseToolCall(
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- rawToolCall: Record<string, any>, options?: {
22
+ declare function parseToolCall(rawToolCall: Record<string, any>, options?: {
28
23
  returnId?: boolean;
29
24
  partial?: false;
30
25
  }): ToolCall;
31
- declare function parseToolCall(
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- rawToolCall: Record<string, any>, options?: {
26
+ declare function parseToolCall(rawToolCall: Record<string, any>, options?: {
34
27
  returnId?: boolean;
35
28
  partial?: boolean;
36
29
  }): ToolCall | undefined;
@@ -42,9 +35,7 @@ declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {
42
35
  arguments: string;
43
36
  };
44
37
  };
45
- declare function makeInvalidToolCall(
46
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
- rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
38
+ declare function makeInvalidToolCall(rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
48
39
  /**
49
40
  * Class for parsing the output of a tool-calling LLM into a JSON object.
50
41
  */
@@ -63,40 +54,27 @@ declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputPars
63
54
  * @param generations The output of the LLM to parse.
64
55
  * @returns A JSON object representation of the function call or its arguments.
65
56
  */
66
- parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- ): Promise<any>;
57
+ parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean): Promise<any>;
69
58
  }
70
59
  type JsonOutputKeyToolsParserParamsBase = {
71
60
  keyName: string;
72
61
  returnSingle?: boolean;
73
62
  } & JsonOutputToolsParserParams;
74
- type JsonOutputKeyToolsParserParamsV3<
75
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
- T extends Record<string, any> = Record<string, any>> = {
63
+ type JsonOutputKeyToolsParserParamsV3<T extends Record<string, any> = Record<string, any>> = {
77
64
  zodSchema?: z3.ZodType<T>;
78
65
  } & JsonOutputKeyToolsParserParamsBase;
79
- type JsonOutputKeyToolsParserParamsV4<
80
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
- T extends Record<string, any> = Record<string, any>> = {
66
+ type JsonOutputKeyToolsParserParamsV4<T extends Record<string, any> = Record<string, any>> = {
82
67
  zodSchema?: z4.$ZodType<T, T>;
83
68
  } & JsonOutputKeyToolsParserParamsBase;
84
- type JsonOutputKeyToolsParserParamsInterop<
85
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
- T extends Record<string, any> = Record<string, any>> = {
69
+ type JsonOutputKeyToolsParserParamsInterop<T extends Record<string, any> = Record<string, any>> = {
87
70
  zodSchema?: InteropZodType<T>;
88
71
  } & JsonOutputKeyToolsParserParamsBase;
89
- // Use Zod 3 for backwards compatibility
90
- type JsonOutputKeyToolsParserParams<
91
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
- T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
72
+ type JsonOutputKeyToolsParserParams<T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
93
73
  /**
94
74
  * Class for parsing the output of a tool-calling LLM into a JSON object if you are
95
75
  * expecting only a single tool to be called.
96
76
  */
97
- declare class JsonOutputKeyToolsParser<
98
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
- T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
77
+ declare class JsonOutputKeyToolsParser<T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
100
78
  static lc_name(): string;
101
79
  lc_namespace: string[];
102
80
  lc_serializable: boolean;
@@ -110,9 +88,7 @@ T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsPars
110
88
  constructor(params: JsonOutputKeyToolsParserParamsV4<T>);
111
89
  constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);
112
90
  protected _validateResult(result: unknown): Promise<T>;
113
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
91
  parsePartialResult(generations: ChatGeneration[]): Promise<any>;
115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
92
  parseResult(generations: ChatGeneration[]): Promise<any>;
117
93
  }
118
94
  //#endregion
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json_output_tools_parsers.d.cts","names":["z3","z4","ChatGeneration","ChatGenerationChunk","InvalidToolCall","ToolCall","BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","InteropZodType","ParsedToolCall","Record","JsonOutputToolsParserParams","parseToolCall","convertLangChainToolCallToOpenAI","makeInvalidToolCall","JsonOutputToolsParser","T","Promise","JsonOutputKeyToolsParserParamsBase","JsonOutputKeyToolsParserParamsV3","ZodType","JsonOutputKeyToolsParserParamsV4","$ZodType","JsonOutputKeyToolsParserParamsInterop","JsonOutputKeyToolsParserParams","JsonOutputKeyToolsParser"],"sources":["../../../src/output_parsers/openai_tools/json_output_tools_parsers.d.ts"],"sourcesContent":["import type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\nimport { ChatGeneration, ChatGenerationChunk } from \"../../outputs.js\";\nimport { InvalidToolCall, ToolCall } from \"../../messages/tool.js\";\nimport { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"../transform.js\";\nimport { type InteropZodType } from \"../../utils/types/zod.js\";\nexport type ParsedToolCall = {\n id?: string;\n type: string;\n args: Record<string, any>;\n};\nexport type JsonOutputToolsParserParams = {\n /** Whether to return the tool call id. */\n returnId?: boolean;\n} & BaseCumulativeTransformOutputParserInput;\nexport declare function parseToolCall(rawToolCall: Record<string, any>, options: {\n returnId?: boolean;\n partial: true;\n}): ToolCall | undefined;\nexport declare function parseToolCall(rawToolCall: Record<string, any>, options?: {\n returnId?: boolean;\n partial?: false;\n}): ToolCall;\nexport declare function parseToolCall(rawToolCall: Record<string, any>, options?: {\n returnId?: boolean;\n partial?: boolean;\n}): ToolCall | undefined;\nexport declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {\n id: string;\n type: string;\n function: {\n name: string;\n arguments: string;\n };\n};\nexport declare function makeInvalidToolCall(rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;\n/**\n * Class for parsing the output of a tool-calling LLM into a JSON object.\n */\nexport declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name(): string;\n returnId: boolean;\n lc_namespace: string[];\n lc_serializable: boolean;\n constructor(fields?: JsonOutputToolsParserParams);\n protected _diff(): void;\n parse(): Promise<T>;\n parseResult(generations: ChatGeneration[]): Promise<T>;\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean): Promise<any>;\n}\ntype JsonOutputKeyToolsParserParamsBase = {\n keyName: string;\n returnSingle?: boolean;\n} & JsonOutputToolsParserParams;\ntype JsonOutputKeyToolsParserParamsV3<T extends Record<string, any> = Record<string, any>> = {\n zodSchema?: z3.ZodType<T>;\n} & JsonOutputKeyToolsParserParamsBase;\ntype JsonOutputKeyToolsParserParamsV4<T extends Record<string, any> = Record<string, any>> = {\n zodSchema?: z4.$ZodType<T, T>;\n} & JsonOutputKeyToolsParserParamsBase;\nexport type JsonOutputKeyToolsParserParamsInterop<T extends Record<string, any> = Record<string, any>> = {\n zodSchema?: InteropZodType<T>;\n} & JsonOutputKeyToolsParserParamsBase;\nexport type JsonOutputKeyToolsParserParams<T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;\n/**\n * Class for parsing the output of a tool-calling LLM into a JSON object if you are\n * expecting only a single tool to be called.\n */\nexport declare class JsonOutputKeyToolsParser<T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n returnId: boolean;\n /** The type of tool calls to return. */\n keyName: string;\n /** Whether to return only the first tool call. */\n returnSingle: boolean;\n zodSchema?: InteropZodType<T>;\n constructor(params: JsonOutputKeyToolsParserParamsV3<T>);\n constructor(params: JsonOutputKeyToolsParserParamsV4<T>);\n constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);\n protected _validateResult(result: unknown): Promise<T>;\n parsePartialResult(generations: ChatGeneration[]): Promise<any>;\n parseResult(generations: ChatGeneration[]): Promise<any>;\n}\nexport {};\n//# sourceMappingURL=json_output_tools_parsers.d.ts.map"],"mappings":"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"}
@@ -9,28 +9,21 @@ import * as z4 from "zod/v4/core";
9
9
  type ParsedToolCall = {
10
10
  id?: string;
11
11
  type: string;
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
12
  args: Record<string, any>;
14
13
  };
15
14
  type JsonOutputToolsParserParams = {
16
15
  /** Whether to return the tool call id. */
17
16
  returnId?: boolean;
18
17
  } & BaseCumulativeTransformOutputParserInput;
19
- declare function parseToolCall(
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- rawToolCall: Record<string, any>, options: {
18
+ declare function parseToolCall(rawToolCall: Record<string, any>, options: {
22
19
  returnId?: boolean;
23
20
  partial: true;
24
21
  }): ToolCall | undefined;
25
- declare function parseToolCall(
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- rawToolCall: Record<string, any>, options?: {
22
+ declare function parseToolCall(rawToolCall: Record<string, any>, options?: {
28
23
  returnId?: boolean;
29
24
  partial?: false;
30
25
  }): ToolCall;
31
- declare function parseToolCall(
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- rawToolCall: Record<string, any>, options?: {
26
+ declare function parseToolCall(rawToolCall: Record<string, any>, options?: {
34
27
  returnId?: boolean;
35
28
  partial?: boolean;
36
29
  }): ToolCall | undefined;
@@ -42,9 +35,7 @@ declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {
42
35
  arguments: string;
43
36
  };
44
37
  };
45
- declare function makeInvalidToolCall(
46
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
- rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
38
+ declare function makeInvalidToolCall(rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;
48
39
  /**
49
40
  * Class for parsing the output of a tool-calling LLM into a JSON object.
50
41
  */
@@ -63,40 +54,27 @@ declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputPars
63
54
  * @param generations The output of the LLM to parse.
64
55
  * @returns A JSON object representation of the function call or its arguments.
65
56
  */
66
- parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean
67
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
68
- ): Promise<any>;
57
+ parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean): Promise<any>;
69
58
  }
70
59
  type JsonOutputKeyToolsParserParamsBase = {
71
60
  keyName: string;
72
61
  returnSingle?: boolean;
73
62
  } & JsonOutputToolsParserParams;
74
- type JsonOutputKeyToolsParserParamsV3<
75
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
- T extends Record<string, any> = Record<string, any>> = {
63
+ type JsonOutputKeyToolsParserParamsV3<T extends Record<string, any> = Record<string, any>> = {
77
64
  zodSchema?: z3.ZodType<T>;
78
65
  } & JsonOutputKeyToolsParserParamsBase;
79
- type JsonOutputKeyToolsParserParamsV4<
80
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
81
- T extends Record<string, any> = Record<string, any>> = {
66
+ type JsonOutputKeyToolsParserParamsV4<T extends Record<string, any> = Record<string, any>> = {
82
67
  zodSchema?: z4.$ZodType<T, T>;
83
68
  } & JsonOutputKeyToolsParserParamsBase;
84
- type JsonOutputKeyToolsParserParamsInterop<
85
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
- T extends Record<string, any> = Record<string, any>> = {
69
+ type JsonOutputKeyToolsParserParamsInterop<T extends Record<string, any> = Record<string, any>> = {
87
70
  zodSchema?: InteropZodType<T>;
88
71
  } & JsonOutputKeyToolsParserParamsBase;
89
- // Use Zod 3 for backwards compatibility
90
- type JsonOutputKeyToolsParserParams<
91
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
- T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
72
+ type JsonOutputKeyToolsParserParams<T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;
93
73
  /**
94
74
  * Class for parsing the output of a tool-calling LLM into a JSON object if you are
95
75
  * expecting only a single tool to be called.
96
76
  */
97
- declare class JsonOutputKeyToolsParser<
98
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
- T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
77
+ declare class JsonOutputKeyToolsParser<T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {
100
78
  static lc_name(): string;
101
79
  lc_namespace: string[];
102
80
  lc_serializable: boolean;
@@ -110,9 +88,7 @@ T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsPars
110
88
  constructor(params: JsonOutputKeyToolsParserParamsV4<T>);
111
89
  constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);
112
90
  protected _validateResult(result: unknown): Promise<T>;
113
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
91
  parsePartialResult(generations: ChatGeneration[]): Promise<any>;
115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
92
  parseResult(generations: ChatGeneration[]): Promise<any>;
117
93
  }
118
94
  //#endregion
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json_output_tools_parsers.d.ts","names":["z3","z4","ChatGeneration","ChatGenerationChunk","InvalidToolCall","ToolCall","BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","InteropZodType","ParsedToolCall","Record","JsonOutputToolsParserParams","parseToolCall","convertLangChainToolCallToOpenAI","makeInvalidToolCall","JsonOutputToolsParser","T","Promise","JsonOutputKeyToolsParserParamsBase","JsonOutputKeyToolsParserParamsV3","ZodType","JsonOutputKeyToolsParserParamsV4","$ZodType","JsonOutputKeyToolsParserParamsInterop","JsonOutputKeyToolsParserParams","JsonOutputKeyToolsParser"],"sources":["../../../src/output_parsers/openai_tools/json_output_tools_parsers.d.ts"],"sourcesContent":["import type * as z3 from \"zod/v3\";\nimport type * as z4 from \"zod/v4/core\";\nimport { ChatGeneration, ChatGenerationChunk } from \"../../outputs.js\";\nimport { InvalidToolCall, ToolCall } from \"../../messages/tool.js\";\nimport { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"../transform.js\";\nimport { type InteropZodType } from \"../../utils/types/zod.js\";\nexport type ParsedToolCall = {\n id?: string;\n type: string;\n args: Record<string, any>;\n};\nexport type JsonOutputToolsParserParams = {\n /** Whether to return the tool call id. */\n returnId?: boolean;\n} & BaseCumulativeTransformOutputParserInput;\nexport declare function parseToolCall(rawToolCall: Record<string, any>, options: {\n returnId?: boolean;\n partial: true;\n}): ToolCall | undefined;\nexport declare function parseToolCall(rawToolCall: Record<string, any>, options?: {\n returnId?: boolean;\n partial?: false;\n}): ToolCall;\nexport declare function parseToolCall(rawToolCall: Record<string, any>, options?: {\n returnId?: boolean;\n partial?: boolean;\n}): ToolCall | undefined;\nexport declare function convertLangChainToolCallToOpenAI(toolCall: ToolCall): {\n id: string;\n type: string;\n function: {\n name: string;\n arguments: string;\n };\n};\nexport declare function makeInvalidToolCall(rawToolCall: Record<string, any>, errorMsg?: string): InvalidToolCall;\n/**\n * Class for parsing the output of a tool-calling LLM into a JSON object.\n */\nexport declare class JsonOutputToolsParser<T> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name(): string;\n returnId: boolean;\n lc_namespace: string[];\n lc_serializable: boolean;\n constructor(fields?: JsonOutputToolsParserParams);\n protected _diff(): void;\n parse(): Promise<T>;\n parseResult(generations: ChatGeneration[]): Promise<T>;\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n parsePartialResult(generations: ChatGenerationChunk[] | ChatGeneration[], partial?: boolean): Promise<any>;\n}\ntype JsonOutputKeyToolsParserParamsBase = {\n keyName: string;\n returnSingle?: boolean;\n} & JsonOutputToolsParserParams;\ntype JsonOutputKeyToolsParserParamsV3<T extends Record<string, any> = Record<string, any>> = {\n zodSchema?: z3.ZodType<T>;\n} & JsonOutputKeyToolsParserParamsBase;\ntype JsonOutputKeyToolsParserParamsV4<T extends Record<string, any> = Record<string, any>> = {\n zodSchema?: z4.$ZodType<T, T>;\n} & JsonOutputKeyToolsParserParamsBase;\nexport type JsonOutputKeyToolsParserParamsInterop<T extends Record<string, any> = Record<string, any>> = {\n zodSchema?: InteropZodType<T>;\n} & JsonOutputKeyToolsParserParamsBase;\nexport type JsonOutputKeyToolsParserParams<T extends Record<string, any> = Record<string, any>> = JsonOutputKeyToolsParserParamsV3<T>;\n/**\n * Class for parsing the output of a tool-calling LLM into a JSON object if you are\n * expecting only a single tool to be called.\n */\nexport declare class JsonOutputKeyToolsParser<T extends Record<string, any> = Record<string, any>> extends JsonOutputToolsParser<T> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n returnId: boolean;\n /** The type of tool calls to return. */\n keyName: string;\n /** Whether to return only the first tool call. */\n returnSingle: boolean;\n zodSchema?: InteropZodType<T>;\n constructor(params: JsonOutputKeyToolsParserParamsV3<T>);\n constructor(params: JsonOutputKeyToolsParserParamsV4<T>);\n constructor(params: JsonOutputKeyToolsParserParamsInterop<T>);\n protected _validateResult(result: unknown): Promise<T>;\n parsePartialResult(generations: ChatGeneration[]): Promise<any>;\n parseResult(generations: ChatGeneration[]): Promise<any>;\n}\nexport {};\n//# sourceMappingURL=json_output_tools_parsers.d.ts.map"],"mappings":";;;;;;;;KAMYS,cAAAA;;EAAAA,IAAAA,EAAAA,MAAAA;EAKAE,IAAAA,EAFFD,MAEEC,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;AAIZ,CAAA;AAIwBC,KARZD,2BAAAA,GAWRN;EACoBO;EAIAC,QAAAA,CAAAA,EAAAA,OAAAA;AAQxB,CAAA,GArBIN,wCAqBqDG;AAIpCK,iBAxBGH,aAAAA,CAwBkBI,WAAA,EAxBSN,MAwBT,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,OAAA,EAAA;EAAgDM,QAAAA,CAAAA,EAAAA,OAAAA;EAKjEL,OAAAA,EAAAA,IAAAA;CAEJK,CAAAA,EA5BjBX,QA4BiBW,GAAAA,SAAAA;AAARC,iBA3BWL,aAAAA,CA2BXK,WAAAA,EA3BsCP,MA2BtCO,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,EAAAA,OACmCA,CADnCA,EAAAA;EACgBf,QAAAA,CAAAA,EAAAA,OAAAA;EAA2Bc,OAAAA,CAAAA,EAAAA,KAAAA;CAARC,CAAAA,EAzB5CZ,QAyB4CY;AAOZd,iBA/BZS,aAAAA,CA+BYT,WAAAA,EA/BeO,MA+BfP,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,EAAAA,OAfkBG,CAelBH,EAAAA;EAAwBD,QAAAA,CAAAA,EAAAA,OAAAA;EAAsCe,OAAAA,CAAAA,EAAAA,OAAAA;CAf5CX,CAAAA,EAblDD,QAakDC,GAAAA,SAAAA;AAAmC,iBAZjEO,gCAAAA,CAYiE,QAAA,EAZtBR,QAYsB,CAAA,EAAA;EAiBpFa,EAAAA,EAAAA,MAAAA;EAIAC,IAAAA,EAAAA,MAAAA;EAA2CT,QAAAA,EAAAA;IAAsBA,IAAAA,EAAAA,MAAAA;IAC3CM,SAAAA,EAAAA,MAAAA;EAARI,CAAAA;CACfF;AAAkC,iBA3BdJ,mBAAAA,CA2Bc,WAAA,EA3BmBJ,MA2BnB,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,QAAA,CAAA,EAAA,MAAA,CAAA,EA3B4DN,eA2B5D;AAAA;;;AAEVY,cAzBPD,qBAyBOC,CAAAA,CAAAA,CAAAA,SAzB0BV,mCAyB1BU,CAzB8DA,CAyB9DA,CAAAA,CAAAA;EAAGA,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAZM,QAAAA,EAAAA,OAAAA;EACfJ,YAAAA,EAAAA,MAAAA,EAAAA;EAAkC,eAAA,EAAA,OAAA;EAC1BK,WAAAA,CAAAA,MAAqCP,CAArCO,EAtBaZ,2BAsBwBK;EAAWN,UAAAA,KAAAA,CAAAA,CAAAA,EAAAA,IAAAA;EAAsBA,KAAAA,CAAAA,CAAAA,EApBrEO,OAoBqEP,CApB7DM,CAoB6DN,CAAAA;EACnDM,WAAAA,CAAAA,WAAAA,EApBFd,cAoBEc,EAAAA,CAAAA,EApBiBC,OAoBjBD,CApByBA,CAoBzBA,CAAAA;EAAfR;;AACsB;AACtC;;;EAAmIQ,kBAAAA,CAAAA,WAAAA,EAf/Fb,mBAe+Fa,EAAAA,GAfvEd,cAeuEc,EAAAA,EAAAA,OAAAA,CAAAA,EAAAA,OAAAA,CAAAA,EAfjCC,OAeiCD,CAAAA,GAAAA,CAAAA;;AAAD,KAb7HE,kCAAAA,GAa6H;EAK7GO,OAAAA,EAAAA,MAAAA;EAAmCf,YAAAA,CAAAA,EAAAA,OAAAA;CAAsBA,GAf1EC,2BAe0ED;KAdzES,gCAc4HH,CAAAA,UAdjFN,MAciFM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAd3DN,MAc2DM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,GAAAA;EASlGA,SAAAA,CAAAA,EAtBfhB,EAAAA,CAAGoB,OAsBYJ,CAtBJA,CAsBIA,CAAAA;CAAfR,GArBZU,kCAqBYV;KApBXa,gCAqBoDL,CAAAA,UArBTN,MAqBSM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GArBaN,MAqBbM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,GAAAA;EAAjCG,SAAAA,CAAAA,EApBRlB,EAAAA,CAAGqB,QAoBKH,CApBIH,CAoBJG,EApBOH,CAoBPG,CAAAA;CACiCH,GApBrDE,kCAoBqDF;AAAjCK,KAnBZE,qCAmBYF,CAAAA,UAnBoCX,MAmBpCW,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAnB0DX,MAmB1DW,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,GAAAA;EACsCL,SAAAA,CAAAA,EAnB9CR,cAmB8CQ,CAnB/BA,CAmB+BA,CAAAA;CAAtCO,GAlBpBL,kCAkBoBK;AACgCP,KAlB5CQ,8BAkB4CR,CAAAA,UAlBHN,MAkBGM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAlBmBN,MAkBnBM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,GAlB0CG,gCAkB1CH,CAlB2EA,CAkB3EA,CAAAA;;;;;AAERC,cAf3BQ,wBAe2BR,CAAAA,UAfQP,MAeRO,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAf8BP,MAe9BO,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,SAf2DF,qBAe3DE,CAfiFD,CAejFC,CAAAA,CAAAA;EAf2DF,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAqB,YAAA,EAAA,MAAA,EAAA;;;;;;;cAShHP,eAAeQ;sBACPG,iCAAiCH;sBACjCK,iCAAiCL;sBACjCO,sCAAsCP;8CACdC,QAAQD;kCACpBd,mBAAmBe;2BAC1Bf,mBAAmBe"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.cts","names":["BaseTransformOutputParser","ContentBlock","StringOutputParser","Promise","Text","Data","URLContentBlock"],"sources":["../../src/output_parsers/string.d.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\nimport { ContentBlock } from \"../messages/index.js\";\n/**\n * OutputParser that parses LLMResult into the top likely string.\n * @example\n * ```typescript\n * const promptTemplate = PromptTemplate.fromTemplate(\n * \"Tell me a joke about {topic}\",\n * );\n *\n * const chain = RunnableSequence.from([\n * promptTemplate,\n * new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * new StringOutputParser(),\n * ]);\n *\n * const result = await chain.invoke({ topic: \"bears\" });\n * console.log(\"What do you call a bear with no teeth? A gummy bear!\");\n * ```\n */\nexport declare class StringOutputParser extends BaseTransformOutputParser<string> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses a string output from an LLM call. This method is meant to be\n * implemented by subclasses to define how a string output from an LLM\n * should be parsed.\n * @param text The string output from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parse(text: string): Promise<string>;\n getFormatInstructions(): string;\n protected _textContentToString(content: ContentBlock.Text): string;\n protected _imageUrlContentToString(_content: ContentBlock.Data.URLContentBlock): string;\n protected _messageContentToString(content: ContentBlock): string;\n protected _baseMessageContentToString(content: ContentBlock[]): string;\n}\n//# sourceMappingURL=string.d.ts.map"],"mappings":";;;;;;;AAoBA;;;;;;;AAAyE;;;;;;;;;cAApDE,kBAAAA,SAA2BF;;;;;;;;;;;;uBAYvBG;;0CAEmBF,YAAAA,CAAaG;+CACRH,YAAAA,CAAaI,IAAAA,CAAKC;6CACpBL;iDACIA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.ts","names":["BaseTransformOutputParser","ContentBlock","StringOutputParser","Promise","Text","Data","URLContentBlock"],"sources":["../../src/output_parsers/string.d.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\nimport { ContentBlock } from \"../messages/index.js\";\n/**\n * OutputParser that parses LLMResult into the top likely string.\n * @example\n * ```typescript\n * const promptTemplate = PromptTemplate.fromTemplate(\n * \"Tell me a joke about {topic}\",\n * );\n *\n * const chain = RunnableSequence.from([\n * promptTemplate,\n * new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * new StringOutputParser(),\n * ]);\n *\n * const result = await chain.invoke({ topic: \"bears\" });\n * console.log(\"What do you call a bear with no teeth? A gummy bear!\");\n * ```\n */\nexport declare class StringOutputParser extends BaseTransformOutputParser<string> {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n /**\n * Parses a string output from an LLM call. This method is meant to be\n * implemented by subclasses to define how a string output from an LLM\n * should be parsed.\n * @param text The string output from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parse(text: string): Promise<string>;\n getFormatInstructions(): string;\n protected _textContentToString(content: ContentBlock.Text): string;\n protected _imageUrlContentToString(_content: ContentBlock.Data.URLContentBlock): string;\n protected _messageContentToString(content: ContentBlock): string;\n protected _baseMessageContentToString(content: ContentBlock[]): string;\n}\n//# sourceMappingURL=string.d.ts.map"],"mappings":";;;;;;;;;AAoBA;;;;;;;AAAyE;;;;;;;;cAApDE,kBAAAA,SAA2BF;;;;;;;;;;;;uBAYvBG;;0CAEmBF,YAAAA,CAAaG;+CACRH,YAAAA,CAAaI,IAAAA,CAAKC;6CACpBL;iDACIA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured.d.cts","names":["z","BaseOutputParser","FormatInstructionsOptions","InteropZodType","InferInteropZodOutput","JsonMarkdownStructuredOutputParserInput","JsonMarkdownFormatInstructionsOptions","StructuredOutputParser","T","S","___load_serializable_js0","SerializedNotImplemented","ZodString","ZodTypeAny","ZodObject","Promise","JsonMarkdownStructuredOutputParser","AsymmetricStructuredOutputParserFields","AsymmetricStructuredOutputParser","Y","inputSchema"],"sources":["../../src/output_parsers/structured.d.ts"],"sourcesContent":["import { z } from \"zod/v3\";\nimport { BaseOutputParser, FormatInstructionsOptions } from \"./base.js\";\nimport { type InteropZodType, type InferInteropZodOutput } from \"../utils/types/zod.js\";\nexport type JsonMarkdownStructuredOutputParserInput = {\n interpolationDepth?: number;\n};\nexport interface JsonMarkdownFormatInstructionsOptions extends FormatInstructionsOptions {\n interpolationDepth?: number;\n}\nexport declare class StructuredOutputParser<T extends InteropZodType> extends BaseOutputParser<InferInteropZodOutput<T>> {\n schema: T;\n static lc_name(): string;\n lc_namespace: string[];\n toJSON(): import(\"../load/serializable.js\").SerializedNotImplemented;\n constructor(schema: T);\n /**\n * Creates a new StructuredOutputParser from a Zod schema.\n * @param schema The Zod schema which the output should match\n * @returns A new instance of StructuredOutputParser.\n */\n static fromZodSchema<T extends InteropZodType>(schema: T): StructuredOutputParser<T>;\n /**\n * Creates a new StructuredOutputParser from a set of names and\n * descriptions.\n * @param schemas An object where each key is a name and each value is a description\n * @returns A new instance of StructuredOutputParser.\n */\n static fromNamesAndDescriptions<S extends {\n [key: string]: string;\n }>(schemas: S): StructuredOutputParser<z.ZodObject<{\n [k: string]: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n [x: string]: string;\n }, {\n [x: string]: string;\n }>>;\n /**\n * Returns a markdown code snippet with a JSON object formatted according\n * to the schema.\n * @param options Optional. The options for formatting the instructions\n * @returns A markdown code snippet with a JSON object formatted according to the schema.\n */\n getFormatInstructions(): string;\n /**\n * Parses the given text according to the schema.\n * @param text The text to parse\n * @returns The parsed output.\n */\n parse(text: string): Promise<InferInteropZodOutput<T>>;\n}\n/**\n * A specific type of `StructuredOutputParser` that parses JSON data\n * formatted as a markdown code snippet.\n */\nexport declare class JsonMarkdownStructuredOutputParser<T extends InteropZodType> extends StructuredOutputParser<T> {\n static lc_name(): string;\n getFormatInstructions(options?: JsonMarkdownFormatInstructionsOptions): string;\n private _schemaToInstruction;\n static fromZodSchema<T extends InteropZodType>(schema: T): JsonMarkdownStructuredOutputParser<T>;\n static fromNamesAndDescriptions<S extends {\n [key: string]: string;\n }>(schemas: S): JsonMarkdownStructuredOutputParser<z.ZodObject<{\n [k: string]: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n [x: string]: string;\n }, {\n [x: string]: string;\n }>>;\n}\nexport interface AsymmetricStructuredOutputParserFields<T extends InteropZodType> {\n inputSchema: T;\n}\n/**\n * A type of `StructuredOutputParser` that handles asymmetric input and\n * output schemas.\n */\nexport declare abstract class AsymmetricStructuredOutputParser<T extends InteropZodType, Y = unknown> extends BaseOutputParser<Y> {\n private structuredInputParser;\n constructor({ inputSchema }: AsymmetricStructuredOutputParserFields<T>);\n /**\n * Processes the parsed input into the desired output format. Must be\n * implemented by subclasses.\n * @param input The parsed input\n * @returns The processed output.\n */\n abstract outputProcessor(input: InferInteropZodOutput<T>): Promise<Y>;\n parse(text: string): Promise<Y>;\n getFormatInstructions(): string;\n}\n//# sourceMappingURL=structured.d.ts.map"],"mappings":";;;;;;KAGYK,uCAAAA;;;AAAAA,UAGKC,qCAAAA,SAA8CJ,yBAHZ,CAAA;EAGlCI,kBAAAA,CAAAA,EAAAA,MAAAA;AAGjB;AAAsDH,cAAjCI,sBAAiCJ,CAAAA,UAAAA,cAAAA,CAAAA,SAAwBF,gBAAxBE,CAAyCC,qBAAzCD,CAA+DK,CAA/DL,CAAAA,CAAAA,CAAAA;EAA+DK,MAAAA,EACzGA,CADyGA;EAAtBJ,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACnFI,YAAAA,EAAAA,MAAAA,EAAAA;;EAIYA,WAAAA,CAAAA,MAAAA,EAAAA,CAAAA;EAMWL;;;;;EAUZS,OAAAA,aAAAA,CAAAA,UAVYT,cAUZS,CAAAA,CAAAA,MAAAA,EAVoCJ,CAUpCI,CAAAA,EAVwCL,sBAUxCK,CAV+DJ,CAU/DI,CAAAA;EACLC;;;;;;EAtB4DZ,OAAAA,wBAAAA,CAAAA,UAAAA;IAAgB,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,MAAA;EA6CzEe,CAAAA,CAAAA,CAAAA,OAAAA,EAzBLP,CAyBKO,CAAAA,EAzBDT,sBAyBmC,CAzBZP,CAAAA,CAAEc,SAyBUL,CAAAA;IAAWN,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAxB7CH,CAAAA,CAAEY,SAwB2CT;EAA+CK,CAAAA,EAAAA,OAAAA,EAvBjGR,CAAAA,CAAEa,UAuB+FL,EAAAA;IAE7EF,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAEDH,CAAAA,EAAAA;IAAwBK,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAuCA,CAAAA,CAAAA,CAAAA;EAAnCQ;;;;;;EAJ2BT,qBAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAsB;AAehH;AAOA;;;EAEkBa,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EA9BOL,OA8BPK,CA9BehB,qBA8BfgB,CA9BqCZ,CA8BrCY,CAAAA,CAAAA;;;;;;AAO6CL,cA/B1CC,kCA+B0CD,CAAAA,UA/BGZ,cA+BHY,CAAAA,SA/B2BR,sBA+B3BQ,CA/BkDP,CA+BlDO,CAAAA,CAAAA;EAC9BI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAARJ,qBAAAA,CAAAA,OAAAA,CAAAA,EA9BWT,qCA8BXS,CAAAA,EAAAA,MAAAA;EAVqFd,QAAAA,oBAAAA;EAAgB,OAAA,aAAA,CAAA,UAlB3FE,cAkB2F,CAAA,CAAA,MAAA,EAlBnEK,CAkBmE,CAAA,EAlB/DQ,kCAkB+D,CAlB5BR,CAkB4B,CAAA;;;cAf9GC,IAAIO,mCAAmChB,CAAAA,CAAEc;iBACpCd,CAAAA,CAAEY;cACPZ,CAAAA,CAAEa;;;;;;UAMDI,iDAAiDd;eACjDK;;;;;;uBAMaU,2CAA2Cf,qCAAqCF,iBAAiBkB;;;;KAE9FF,uCAAuCT;;;;;;;kCAOpCJ,sBAAsBI,KAAKO,QAAQI;uBAC9CJ,QAAQI"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured.d.ts","names":["z","BaseOutputParser","FormatInstructionsOptions","InteropZodType","InferInteropZodOutput","JsonMarkdownStructuredOutputParserInput","JsonMarkdownFormatInstructionsOptions","StructuredOutputParser","T","S","___load_serializable_js0","SerializedNotImplemented","ZodString","ZodTypeAny","ZodObject","Promise","JsonMarkdownStructuredOutputParser","AsymmetricStructuredOutputParserFields","AsymmetricStructuredOutputParser","Y","inputSchema"],"sources":["../../src/output_parsers/structured.d.ts"],"sourcesContent":["import { z } from \"zod/v3\";\nimport { BaseOutputParser, FormatInstructionsOptions } from \"./base.js\";\nimport { type InteropZodType, type InferInteropZodOutput } from \"../utils/types/zod.js\";\nexport type JsonMarkdownStructuredOutputParserInput = {\n interpolationDepth?: number;\n};\nexport interface JsonMarkdownFormatInstructionsOptions extends FormatInstructionsOptions {\n interpolationDepth?: number;\n}\nexport declare class StructuredOutputParser<T extends InteropZodType> extends BaseOutputParser<InferInteropZodOutput<T>> {\n schema: T;\n static lc_name(): string;\n lc_namespace: string[];\n toJSON(): import(\"../load/serializable.js\").SerializedNotImplemented;\n constructor(schema: T);\n /**\n * Creates a new StructuredOutputParser from a Zod schema.\n * @param schema The Zod schema which the output should match\n * @returns A new instance of StructuredOutputParser.\n */\n static fromZodSchema<T extends InteropZodType>(schema: T): StructuredOutputParser<T>;\n /**\n * Creates a new StructuredOutputParser from a set of names and\n * descriptions.\n * @param schemas An object where each key is a name and each value is a description\n * @returns A new instance of StructuredOutputParser.\n */\n static fromNamesAndDescriptions<S extends {\n [key: string]: string;\n }>(schemas: S): StructuredOutputParser<z.ZodObject<{\n [k: string]: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n [x: string]: string;\n }, {\n [x: string]: string;\n }>>;\n /**\n * Returns a markdown code snippet with a JSON object formatted according\n * to the schema.\n * @param options Optional. The options for formatting the instructions\n * @returns A markdown code snippet with a JSON object formatted according to the schema.\n */\n getFormatInstructions(): string;\n /**\n * Parses the given text according to the schema.\n * @param text The text to parse\n * @returns The parsed output.\n */\n parse(text: string): Promise<InferInteropZodOutput<T>>;\n}\n/**\n * A specific type of `StructuredOutputParser` that parses JSON data\n * formatted as a markdown code snippet.\n */\nexport declare class JsonMarkdownStructuredOutputParser<T extends InteropZodType> extends StructuredOutputParser<T> {\n static lc_name(): string;\n getFormatInstructions(options?: JsonMarkdownFormatInstructionsOptions): string;\n private _schemaToInstruction;\n static fromZodSchema<T extends InteropZodType>(schema: T): JsonMarkdownStructuredOutputParser<T>;\n static fromNamesAndDescriptions<S extends {\n [key: string]: string;\n }>(schemas: S): JsonMarkdownStructuredOutputParser<z.ZodObject<{\n [k: string]: z.ZodString;\n }, \"strip\", z.ZodTypeAny, {\n [x: string]: string;\n }, {\n [x: string]: string;\n }>>;\n}\nexport interface AsymmetricStructuredOutputParserFields<T extends InteropZodType> {\n inputSchema: T;\n}\n/**\n * A type of `StructuredOutputParser` that handles asymmetric input and\n * output schemas.\n */\nexport declare abstract class AsymmetricStructuredOutputParser<T extends InteropZodType, Y = unknown> extends BaseOutputParser<Y> {\n private structuredInputParser;\n constructor({ inputSchema }: AsymmetricStructuredOutputParserFields<T>);\n /**\n * Processes the parsed input into the desired output format. Must be\n * implemented by subclasses.\n * @param input The parsed input\n * @returns The processed output.\n */\n abstract outputProcessor(input: InferInteropZodOutput<T>): Promise<Y>;\n parse(text: string): Promise<Y>;\n getFormatInstructions(): string;\n}\n//# sourceMappingURL=structured.d.ts.map"],"mappings":";;;;;;KAGYK,uCAAAA;;;AAAAA,UAGKC,qCAAAA,SAA8CJ,yBAHZ,CAAA;EAGlCI,kBAAAA,CAAAA,EAAAA,MAAAA;AAGjB;AAAsDH,cAAjCI,sBAAiCJ,CAAAA,UAAAA,cAAAA,CAAAA,SAAwBF,gBAAxBE,CAAyCC,qBAAzCD,CAA+DK,CAA/DL,CAAAA,CAAAA,CAAAA;EAA+DK,MAAAA,EACzGA,CADyGA;EAAtBJ,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACnFI,YAAAA,EAAAA,MAAAA,EAAAA;;EAIYA,WAAAA,CAAAA,MAAAA,EAAAA,CAAAA;EAMWL;;;;;EAUZS,OAAAA,aAAAA,CAAAA,UAVYT,cAUZS,CAAAA,CAAAA,MAAAA,EAVoCJ,CAUpCI,CAAAA,EAVwCL,sBAUxCK,CAV+DJ,CAU/DI,CAAAA;EACLC;;;;;;EAtB4DZ,OAAAA,wBAAAA,CAAAA,UAAAA;IAAgB,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,MAAA;EA6CzEe,CAAAA,CAAAA,CAAAA,OAAAA,EAzBLP,CAyBKO,CAAAA,EAzBDT,sBAyBmC,CAzBZP,CAAAA,CAAEc,SAyBUL,CAAAA;IAAWN,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAxB7CH,CAAAA,CAAEY,SAwB2CT;EAA+CK,CAAAA,EAAAA,OAAAA,EAvBjGR,CAAAA,CAAEa,UAuB+FL,EAAAA;IAE7EF,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAEDH,CAAAA,EAAAA;IAAwBK,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAAA;EAAuCA,CAAAA,CAAAA,CAAAA;EAAnCQ;;;;;;EAJ2BT,qBAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAsB;AAehH;AAOA;;;EAEkBa,KAAAA,CAAAA,IAAAA,EAAAA,MAAAA,CAAAA,EA9BOL,OA8BPK,CA9BehB,qBA8BfgB,CA9BqCZ,CA8BrCY,CAAAA,CAAAA;;;;;;AAO6CL,cA/B1CC,kCA+B0CD,CAAAA,UA/BGZ,cA+BHY,CAAAA,SA/B2BR,sBA+B3BQ,CA/BkDP,CA+BlDO,CAAAA,CAAAA;EAC9BI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAARJ,qBAAAA,CAAAA,OAAAA,CAAAA,EA9BWT,qCA8BXS,CAAAA,EAAAA,MAAAA;EAVqFd,QAAAA,oBAAAA;EAAgB,OAAA,aAAA,CAAA,UAlB3FE,cAkB2F,CAAA,CAAA,MAAA,EAlBnEK,CAkBmE,CAAA,EAlB/DQ,kCAkB+D,CAlB5BR,CAkB4B,CAAA;;;cAf9GC,IAAIO,mCAAmChB,CAAAA,CAAEc;iBACpCd,CAAAA,CAAEY;cACPZ,CAAAA,CAAEa;;;;;;UAMDI,iDAAiDd;eACjDK;;;;;;uBAMaU,2CAA2Cf,qCAAqCF,iBAAiBkB;;;;KAE9FF,uCAAuCT;;;;;;;kCAOpCJ,sBAAsBI,KAAKO,QAAQI;uBAC9CJ,QAAQI"}
@@ -30,7 +30,6 @@ type BaseCumulativeTransformOutputParserInput = {
30
30
  declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {
31
31
  protected diff: boolean;
32
32
  constructor(fields?: BaseCumulativeTransformOutputParserInput);
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
33
  protected abstract _diff(prev: any | undefined, next: any): any;
35
34
  abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;
36
35
  _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.cts","names":["BaseOutputParser","BaseMessage","BaseCallbackConfig","Generation","ChatGeneration","BaseTransformOutputParser","T","AsyncGenerator","BaseCumulativeTransformOutputParserInput","BaseCumulativeTransformOutputParser","Promise"],"sources":["../../src/output_parsers/transform.d.ts"],"sourcesContent":["import { BaseOutputParser } from \"./base.js\";\nimport { type BaseMessage } from \"../messages/base.js\";\nimport type { BaseCallbackConfig } from \"../callbacks/manager.js\";\nimport { type Generation, type ChatGeneration } from \"../outputs.js\";\n/**\n * Class to parse the output of an LLM call that also allows streaming inputs.\n */\nexport declare abstract class BaseTransformOutputParser<T = unknown> extends BaseOutputParser<T> {\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;\n /**\n * Transforms an asynchronous generator of input into an asynchronous\n * generator of parsed output.\n * @param inputGenerator An asynchronous generator of input.\n * @param options A configuration object.\n * @returns An asynchronous generator of parsed output.\n */\n transform(inputGenerator: AsyncGenerator<string | BaseMessage>, options: BaseCallbackConfig): AsyncGenerator<T>;\n}\nexport type BaseCumulativeTransformOutputParserInput = {\n diff?: boolean;\n};\n/**\n * A base class for output parsers that can handle streaming input. It\n * extends the `BaseTransformOutputParser` class and provides a method for\n * converting parsed outputs into a diff format.\n */\nexport declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {\n protected diff: boolean;\n constructor(fields?: BaseCumulativeTransformOutputParserInput);\n protected abstract _diff(prev: any | undefined, next: any): any;\n abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;\n getFormatInstructions(): string;\n}\n//# sourceMappingURL=transform.d.ts.map"],"mappings":";;;;;;;;;AAOA;AAA8FM,uBAAhED,yBAAgEC,CAAAA,IAAAA,OAAAA,CAAAA,SAAjBN,gBAAiBM,CAAAA,CAAAA,CAAAA,CAAAA;EACvCL,UAAAA,CAAAA,cAAAA,EAAxBM,cAAwBN,CAAAA,MAAAA,GAAAA,WAAAA,CAAAA,CAAAA,EAAeM,cAAfN,CAA8BK,CAA9BL,CAAAA;EAAxBM;;;;;;;EAQmEA,SAAAA,CAAAA,cAAAA,EAApEA,cAAoEA,CAAAA,MAAAA,GAA5CN,WAA4CM,CAAAA,EAAAA,OAAAA,EAArBL,kBAAqBK,CAAAA,EAAAA,cAAAA,CAAeD,CAAfC,CAAAA;;AATL,KAWjFC,wCAAAA,GAXiF;EAWjFA,IAAAA,CAAAA,EAAAA,OAAAA;AAQZ,CAAA;;;;;;AAI+EE,uBAJjDD,mCAIiDC,CAAAA,IAAAA,OAAAA,CAAAA,SAJQL,yBAIRK,CAJkCJ,CAIlCI,CAAAA,CAAAA;EACxBT,UAAAA,IAAAA,EAAAA,OAAAA;EAAxBM,WAAAA,CAAAA,MAAAA,CAAAA,EAHNC,wCAGMD;EAAsDD,mBAAAA,KAAAA,CAAAA,IAAAA,EAAAA,GAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,GAAAA,CAAAA,EAAAA,GAAAA;EAAfC,SAAAA,kBAAAA,CAAAA,WAAAA,EADzBJ,UACyBI,EAAAA,GADVH,cACUG,EAAAA,CAAAA,EADSG,OACTH,CADiBD,CACjBC,GAAAA,SAAAA,CAAAA;EALiBF,UAAAA,CAAAA,cAAAA,EAKxDE,cALwDF,CAAAA,MAAAA,GAKhCJ,WALgCI,CAAAA,CAAAA,EAKjBE,cALiBF,CAKFC,CALED,CAAAA;EAAyB,qBAAA,CAAA,CAAA,EAAA,MAAA"}
@@ -30,7 +30,6 @@ type BaseCumulativeTransformOutputParserInput = {
30
30
  declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {
31
31
  protected diff: boolean;
32
32
  constructor(fields?: BaseCumulativeTransformOutputParserInput);
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
33
  protected abstract _diff(prev: any | undefined, next: any): any;
35
34
  abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;
36
35
  _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","names":["BaseOutputParser","BaseMessage","BaseCallbackConfig","Generation","ChatGeneration","BaseTransformOutputParser","T","AsyncGenerator","BaseCumulativeTransformOutputParserInput","BaseCumulativeTransformOutputParser","Promise"],"sources":["../../src/output_parsers/transform.d.ts"],"sourcesContent":["import { BaseOutputParser } from \"./base.js\";\nimport { type BaseMessage } from \"../messages/base.js\";\nimport type { BaseCallbackConfig } from \"../callbacks/manager.js\";\nimport { type Generation, type ChatGeneration } from \"../outputs.js\";\n/**\n * Class to parse the output of an LLM call that also allows streaming inputs.\n */\nexport declare abstract class BaseTransformOutputParser<T = unknown> extends BaseOutputParser<T> {\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;\n /**\n * Transforms an asynchronous generator of input into an asynchronous\n * generator of parsed output.\n * @param inputGenerator An asynchronous generator of input.\n * @param options A configuration object.\n * @returns An asynchronous generator of parsed output.\n */\n transform(inputGenerator: AsyncGenerator<string | BaseMessage>, options: BaseCallbackConfig): AsyncGenerator<T>;\n}\nexport type BaseCumulativeTransformOutputParserInput = {\n diff?: boolean;\n};\n/**\n * A base class for output parsers that can handle streaming input. It\n * extends the `BaseTransformOutputParser` class and provides a method for\n * converting parsed outputs into a diff format.\n */\nexport declare abstract class BaseCumulativeTransformOutputParser<T = unknown> extends BaseTransformOutputParser<T> {\n protected diff: boolean;\n constructor(fields?: BaseCumulativeTransformOutputParserInput);\n protected abstract _diff(prev: any | undefined, next: any): any;\n abstract parsePartialResult(generations: Generation[] | ChatGeneration[]): Promise<T | undefined>;\n _transform(inputGenerator: AsyncGenerator<string | BaseMessage>): AsyncGenerator<T>;\n getFormatInstructions(): string;\n}\n//# sourceMappingURL=transform.d.ts.map"],"mappings":";;;;;;;;;AAOA;AAA8FM,uBAAhED,yBAAgEC,CAAAA,IAAAA,OAAAA,CAAAA,SAAjBN,gBAAiBM,CAAAA,CAAAA,CAAAA,CAAAA;EACvCL,UAAAA,CAAAA,cAAAA,EAAxBM,cAAwBN,CAAAA,MAAAA,GAAAA,WAAAA,CAAAA,CAAAA,EAAeM,cAAfN,CAA8BK,CAA9BL,CAAAA;EAAxBM;;;;;;;EAQmEA,SAAAA,CAAAA,cAAAA,EAApEA,cAAoEA,CAAAA,MAAAA,GAA5CN,WAA4CM,CAAAA,EAAAA,OAAAA,EAArBL,kBAAqBK,CAAAA,EAAAA,cAAAA,CAAeD,CAAfC,CAAAA;;AATL,KAWjFC,wCAAAA,GAXiF;EAWjFA,IAAAA,CAAAA,EAAAA,OAAAA;AAQZ,CAAA;;;;;;AAI+EE,uBAJjDD,mCAIiDC,CAAAA,IAAAA,OAAAA,CAAAA,SAJQL,yBAIRK,CAJkCJ,CAIlCI,CAAAA,CAAAA;EACxBT,UAAAA,IAAAA,EAAAA,OAAAA;EAAxBM,WAAAA,CAAAA,MAAAA,CAAAA,EAHNC,wCAGMD;EAAsDD,mBAAAA,KAAAA,CAAAA,IAAAA,EAAAA,GAAAA,GAAAA,SAAAA,EAAAA,IAAAA,EAAAA,GAAAA,CAAAA,EAAAA,GAAAA;EAAfC,SAAAA,kBAAAA,CAAAA,WAAAA,EADzBJ,UACyBI,EAAAA,GADVH,cACUG,EAAAA,CAAAA,EADSG,OACTH,CADiBD,CACjBC,GAAAA,SAAAA,CAAAA;EALiBF,UAAAA,CAAAA,cAAAA,EAKxDE,cALwDF,CAAAA,MAAAA,GAKhCJ,WALgCI,CAAAA,CAAAA,EAKjBE,cALiBF,CAKFC,CALED,CAAAA;EAAyB,qBAAA,CAAA,CAAA,EAAA,MAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xml.d.cts","names":["BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","Operation","ChatGeneration","Generation","XML_FORMAT_INSTRUCTIONS","XMLOutputParserFields","Content","Array","XMLResult","XMLOutputParser","Promise","parseXMLMarkdown"],"sources":["../../src/output_parsers/xml.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nexport declare const XML_FORMAT_INSTRUCTIONS = \"The output should be formatted as a XML file.\\n1. Output should conform to the tags below. \\n2. If tags are not given, make them on your own.\\n3. Remember to always open and close all the tags.\\n\\nAs an example, for the tags [\\\"foo\\\", \\\"bar\\\", \\\"baz\\\"]:\\n1. String \\\"<foo>\\n <bar>\\n <baz></baz>\\n </bar>\\n</foo>\\\" is a well-formatted instance of the schema. \\n2. String \\\"<foo>\\n <bar>\\n </foo>\\\" is a badly-formatted instance.\\n3. String \\\"<foo>\\n <tag>\\n </tag>\\n</foo>\\\" is a badly-formatted instance.\\n\\nHere are the output tags:\\n```\\n{tags}\\n```\";\nexport interface XMLOutputParserFields extends BaseCumulativeTransformOutputParserInput {\n /**\n * Optional list of tags that the output should conform to.\n * Only used in formatting of the prompt.\n */\n tags?: string[];\n}\nexport type Content = string | undefined | Array<{\n [key: string]: Content;\n}>;\nexport type XMLResult = {\n [key: string]: Content;\n};\nexport declare class XMLOutputParser extends BaseCumulativeTransformOutputParser<XMLResult> {\n tags?: string[];\n constructor(fields?: XMLOutputParserFields);\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<XMLResult | undefined>;\n parse(text: string): Promise<XMLResult>;\n getFormatInstructions(): string;\n}\nexport declare function parseXMLMarkdown(s: string): XMLResult;\n//# sourceMappingURL=xml.d.ts.map"],"mappings":";;;;;cAGqBK,uBAAAA;UACJC,qBAAAA,SAA8BL;EAD1BI;AACrB;AAOA;AAGA;EAGqBK,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;;AAEIJ,KARbC,OAAAA,GAQaD,MAAAA,GAAAA,SAAAA,GARkBE,KAQlBF,CAAAA;EAIsCJ,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAX5CK,OAW4CL;CAC3BC,CAAAA;AAAmBC,KAV3CK,SAAAA,GAU2CL;EAAuBK,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAT3DF,OAS2DE;CAARE;AACrCF,cARZC,eAAAA,SAAwBV,mCAQZS,CARgDA,SAQhDA,CAAAA,CAAAA;EAARE,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EARoBX,WAAAA,CAAAA,MAAAA,CAAAA,EAEpBM,qBAFoBN;EAAmC,OAAA,OAAA,CAAA,CAAA,EAAA,MAAA;EAWxDY,YAAAA,EAAAA,MAAgB,EAAA;;6DALuBV;kCAC3BC,mBAAmBC,eAAeO,QAAQF;uBACrDE,QAAQF;;;iBAGTG,gBAAAA,aAA6BH"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xml.d.ts","names":["BaseCumulativeTransformOutputParser","BaseCumulativeTransformOutputParserInput","Operation","ChatGeneration","Generation","XML_FORMAT_INSTRUCTIONS","XMLOutputParserFields","Content","Array","XMLResult","XMLOutputParser","Promise","parseXMLMarkdown"],"sources":["../../src/output_parsers/xml.d.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from \"./transform.js\";\nimport { Operation } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nexport declare const XML_FORMAT_INSTRUCTIONS = \"The output should be formatted as a XML file.\\n1. Output should conform to the tags below. \\n2. If tags are not given, make them on your own.\\n3. Remember to always open and close all the tags.\\n\\nAs an example, for the tags [\\\"foo\\\", \\\"bar\\\", \\\"baz\\\"]:\\n1. String \\\"<foo>\\n <bar>\\n <baz></baz>\\n </bar>\\n</foo>\\\" is a well-formatted instance of the schema. \\n2. String \\\"<foo>\\n <bar>\\n </foo>\\\" is a badly-formatted instance.\\n3. String \\\"<foo>\\n <tag>\\n </tag>\\n</foo>\\\" is a badly-formatted instance.\\n\\nHere are the output tags:\\n```\\n{tags}\\n```\";\nexport interface XMLOutputParserFields extends BaseCumulativeTransformOutputParserInput {\n /**\n * Optional list of tags that the output should conform to.\n * Only used in formatting of the prompt.\n */\n tags?: string[];\n}\nexport type Content = string | undefined | Array<{\n [key: string]: Content;\n}>;\nexport type XMLResult = {\n [key: string]: Content;\n};\nexport declare class XMLOutputParser extends BaseCumulativeTransformOutputParser<XMLResult> {\n tags?: string[];\n constructor(fields?: XMLOutputParserFields);\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n protected _diff(prev: unknown | undefined, next: unknown): Operation[] | undefined;\n parsePartialResult(generations: ChatGeneration[] | Generation[]): Promise<XMLResult | undefined>;\n parse(text: string): Promise<XMLResult>;\n getFormatInstructions(): string;\n}\nexport declare function parseXMLMarkdown(s: string): XMLResult;\n//# sourceMappingURL=xml.d.ts.map"],"mappings":";;;;;cAGqBK,uBAAAA;UACJC,qBAAAA,SAA8BL;EAD1BI;AACrB;AAOA;AAGA;EAGqBK,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;;AAEIJ,KARbC,OAAAA,GAQaD,MAAAA,GAAAA,SAAAA,GARkBE,KAQlBF,CAAAA;EAIsCJ,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAX5CK,OAW4CL;CAC3BC,CAAAA;AAAmBC,KAV3CK,SAAAA,GAU2CL;EAAuBK,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAT3DF,OAS2DE;CAARE;AACrCF,cARZC,eAAAA,SAAwBV,mCAQZS,CARgDA,SAQhDA,CAAAA,CAAAA;EAARE,IAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EARoBX,WAAAA,CAAAA,MAAAA,CAAAA,EAEpBM,qBAFoBN;EAAmC,OAAA,OAAA,CAAA,CAAA,EAAA,MAAA;EAWxDY,YAAAA,EAAAA,MAAgB,EAAA;;6DALuBV;kCAC3BC,mBAAmBC,eAAeO,QAAQF;uBACrDE,QAAQF;;;iBAGTG,gBAAAA,aAA6BH"}