@langchain/classic 1.0.23 → 1.0.24-dev-1773698445534

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 (1431) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +12 -22
  2. package/dist/_virtual/_rolldown/runtime.js +12 -21
  3. package/dist/agents/agent.cjs +2 -3
  4. package/dist/agents/agent.cjs.map +1 -1
  5. package/dist/agents/agent.js +1 -2
  6. package/dist/agents/agent.js.map +1 -1
  7. package/dist/agents/chat/index.cjs +6 -7
  8. package/dist/agents/chat/index.cjs.map +1 -1
  9. package/dist/agents/chat/index.js +1 -2
  10. package/dist/agents/chat/index.js.map +1 -1
  11. package/dist/agents/chat/outputParser.cjs +5 -6
  12. package/dist/agents/chat/outputParser.cjs.map +1 -1
  13. package/dist/agents/chat/outputParser.js +2 -3
  14. package/dist/agents/chat/outputParser.js.map +1 -1
  15. package/dist/agents/chat/prompt.cjs +1 -2
  16. package/dist/agents/chat/prompt.cjs.map +1 -1
  17. package/dist/agents/chat/prompt.js +1 -1
  18. package/dist/agents/chat_convo/index.cjs +6 -7
  19. package/dist/agents/chat_convo/index.cjs.map +1 -1
  20. package/dist/agents/chat_convo/index.js +1 -2
  21. package/dist/agents/chat_convo/index.js.map +1 -1
  22. package/dist/agents/chat_convo/outputParser.cjs +5 -6
  23. package/dist/agents/chat_convo/outputParser.cjs.map +1 -1
  24. package/dist/agents/chat_convo/outputParser.js +1 -2
  25. package/dist/agents/chat_convo/outputParser.js.map +1 -1
  26. package/dist/agents/chat_convo/prompt.cjs +1 -2
  27. package/dist/agents/chat_convo/prompt.cjs.map +1 -1
  28. package/dist/agents/chat_convo/prompt.js +1 -1
  29. package/dist/agents/executor.cjs +4 -5
  30. package/dist/agents/executor.cjs.map +1 -1
  31. package/dist/agents/executor.js +1 -2
  32. package/dist/agents/executor.js.map +1 -1
  33. package/dist/agents/format_scratchpad/log.cjs +8 -10
  34. package/dist/agents/format_scratchpad/log.cjs.map +1 -1
  35. package/dist/agents/format_scratchpad/log.js +1 -2
  36. package/dist/agents/format_scratchpad/log.js.map +1 -1
  37. package/dist/agents/format_scratchpad/log_to_message.cjs +8 -9
  38. package/dist/agents/format_scratchpad/log_to_message.cjs.map +1 -1
  39. package/dist/agents/format_scratchpad/log_to_message.js +1 -2
  40. package/dist/agents/format_scratchpad/log_to_message.js.map +1 -1
  41. package/dist/agents/format_scratchpad/openai_functions.cjs +9 -10
  42. package/dist/agents/format_scratchpad/openai_functions.cjs.map +1 -1
  43. package/dist/agents/format_scratchpad/openai_functions.js +1 -2
  44. package/dist/agents/format_scratchpad/openai_functions.js.map +1 -1
  45. package/dist/agents/format_scratchpad/openai_tools.cjs +9 -10
  46. package/dist/agents/format_scratchpad/openai_tools.js +1 -2
  47. package/dist/agents/format_scratchpad/tool_calling.cjs +2 -3
  48. package/dist/agents/format_scratchpad/tool_calling.cjs.map +1 -1
  49. package/dist/agents/format_scratchpad/tool_calling.js +1 -2
  50. package/dist/agents/format_scratchpad/tool_calling.js.map +1 -1
  51. package/dist/agents/format_scratchpad/xml.cjs +8 -10
  52. package/dist/agents/format_scratchpad/xml.cjs.map +1 -1
  53. package/dist/agents/format_scratchpad/xml.js +1 -2
  54. package/dist/agents/format_scratchpad/xml.js.map +1 -1
  55. package/dist/agents/helpers.cjs +2 -3
  56. package/dist/agents/helpers.cjs.map +1 -1
  57. package/dist/agents/helpers.js +1 -2
  58. package/dist/agents/helpers.js.map +1 -1
  59. package/dist/agents/index.cjs +35 -36
  60. package/dist/agents/index.d.ts +0 -1
  61. package/dist/agents/index.js +1 -2
  62. package/dist/agents/initialize.cjs +9 -10
  63. package/dist/agents/initialize.cjs.map +1 -1
  64. package/dist/agents/initialize.js +1 -2
  65. package/dist/agents/initialize.js.map +1 -1
  66. package/dist/agents/load.cjs +12 -13
  67. package/dist/agents/load.cjs.map +1 -1
  68. package/dist/agents/load.js +1 -2
  69. package/dist/agents/load.js.map +1 -1
  70. package/dist/agents/mrkl/index.cjs +7 -8
  71. package/dist/agents/mrkl/index.cjs.map +1 -1
  72. package/dist/agents/mrkl/index.js +1 -2
  73. package/dist/agents/mrkl/index.js.map +1 -1
  74. package/dist/agents/mrkl/outputParser.cjs +5 -8
  75. package/dist/agents/mrkl/outputParser.cjs.map +1 -1
  76. package/dist/agents/mrkl/outputParser.d.cts +1 -1
  77. package/dist/agents/mrkl/outputParser.js +2 -5
  78. package/dist/agents/mrkl/outputParser.js.map +1 -1
  79. package/dist/agents/mrkl/prompt.cjs +1 -2
  80. package/dist/agents/mrkl/prompt.cjs.map +1 -1
  81. package/dist/agents/mrkl/prompt.js +1 -1
  82. package/dist/agents/openai/output_parser.cjs +10 -11
  83. package/dist/agents/openai/output_parser.js +1 -2
  84. package/dist/agents/openai_functions/index.cjs +8 -9
  85. package/dist/agents/openai_functions/index.cjs.map +1 -1
  86. package/dist/agents/openai_functions/index.d.ts +0 -1
  87. package/dist/agents/openai_functions/index.d.ts.map +1 -1
  88. package/dist/agents/openai_functions/index.js +1 -2
  89. package/dist/agents/openai_functions/index.js.map +1 -1
  90. package/dist/agents/openai_functions/output_parser.cjs +3 -4
  91. package/dist/agents/openai_functions/output_parser.cjs.map +1 -1
  92. package/dist/agents/openai_functions/output_parser.js +1 -2
  93. package/dist/agents/openai_functions/output_parser.js.map +1 -1
  94. package/dist/agents/openai_functions/prompt.cjs +1 -2
  95. package/dist/agents/openai_functions/prompt.cjs.map +1 -1
  96. package/dist/agents/openai_functions/prompt.js +1 -1
  97. package/dist/agents/openai_tools/index.cjs +6 -7
  98. package/dist/agents/openai_tools/index.cjs.map +1 -1
  99. package/dist/agents/openai_tools/index.js +1 -2
  100. package/dist/agents/openai_tools/index.js.map +1 -1
  101. package/dist/agents/openai_tools/output_parser.cjs +3 -4
  102. package/dist/agents/openai_tools/output_parser.cjs.map +1 -1
  103. package/dist/agents/openai_tools/output_parser.js +1 -2
  104. package/dist/agents/openai_tools/output_parser.js.map +1 -1
  105. package/dist/agents/react/index.cjs +6 -7
  106. package/dist/agents/react/index.cjs.map +1 -1
  107. package/dist/agents/react/index.js +1 -2
  108. package/dist/agents/react/index.js.map +1 -1
  109. package/dist/agents/react/output_parser.cjs +10 -11
  110. package/dist/agents/react/output_parser.cjs.map +1 -1
  111. package/dist/agents/react/output_parser.js +1 -2
  112. package/dist/agents/react/output_parser.js.map +1 -1
  113. package/dist/agents/react/prompt.cjs +1 -2
  114. package/dist/agents/react/prompt.cjs.map +1 -1
  115. package/dist/agents/react/prompt.js +1 -1
  116. package/dist/agents/structured_chat/index.cjs +8 -9
  117. package/dist/agents/structured_chat/index.cjs.map +1 -1
  118. package/dist/agents/structured_chat/index.js +1 -2
  119. package/dist/agents/structured_chat/index.js.map +1 -1
  120. package/dist/agents/structured_chat/outputParser.cjs +5 -6
  121. package/dist/agents/structured_chat/outputParser.cjs.map +1 -1
  122. package/dist/agents/structured_chat/outputParser.js +1 -2
  123. package/dist/agents/structured_chat/outputParser.js.map +1 -1
  124. package/dist/agents/structured_chat/prompt.cjs +1 -2
  125. package/dist/agents/structured_chat/prompt.cjs.map +1 -1
  126. package/dist/agents/structured_chat/prompt.js +1 -1
  127. package/dist/agents/tool_calling/index.cjs +5 -6
  128. package/dist/agents/tool_calling/index.cjs.map +1 -1
  129. package/dist/agents/tool_calling/index.js +1 -2
  130. package/dist/agents/tool_calling/index.js.map +1 -1
  131. package/dist/agents/tool_calling/output_parser.cjs +3 -4
  132. package/dist/agents/tool_calling/output_parser.cjs.map +1 -1
  133. package/dist/agents/tool_calling/output_parser.d.ts +0 -1
  134. package/dist/agents/tool_calling/output_parser.d.ts.map +1 -1
  135. package/dist/agents/tool_calling/output_parser.js +1 -2
  136. package/dist/agents/tool_calling/output_parser.js.map +1 -1
  137. package/dist/agents/toolkits/base.cjs +2 -2
  138. package/dist/agents/toolkits/base.js +1 -2
  139. package/dist/agents/toolkits/conversational_retrieval/openai_functions.cjs +4 -5
  140. package/dist/agents/toolkits/conversational_retrieval/openai_functions.cjs.map +1 -1
  141. package/dist/agents/toolkits/conversational_retrieval/openai_functions.js +1 -2
  142. package/dist/agents/toolkits/conversational_retrieval/openai_functions.js.map +1 -1
  143. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.cjs +4 -5
  144. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.cjs.map +1 -1
  145. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.js +1 -2
  146. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.js.map +1 -1
  147. package/dist/agents/toolkits/conversational_retrieval/tool.cjs +3 -4
  148. package/dist/agents/toolkits/conversational_retrieval/tool.cjs.map +1 -1
  149. package/dist/agents/toolkits/conversational_retrieval/tool.js +1 -2
  150. package/dist/agents/toolkits/conversational_retrieval/tool.js.map +1 -1
  151. package/dist/agents/toolkits/index.cjs +14 -15
  152. package/dist/agents/toolkits/index.js +1 -2
  153. package/dist/agents/toolkits/json/json.cjs +7 -8
  154. package/dist/agents/toolkits/json/json.cjs.map +1 -1
  155. package/dist/agents/toolkits/json/json.js +1 -2
  156. package/dist/agents/toolkits/json/json.js.map +1 -1
  157. package/dist/agents/toolkits/json/prompt.cjs +1 -2
  158. package/dist/agents/toolkits/json/prompt.cjs.map +1 -1
  159. package/dist/agents/toolkits/json/prompt.js +1 -1
  160. package/dist/agents/toolkits/openapi/openapi.cjs +8 -9
  161. package/dist/agents/toolkits/openapi/openapi.cjs.map +1 -1
  162. package/dist/agents/toolkits/openapi/openapi.js +1 -2
  163. package/dist/agents/toolkits/openapi/openapi.js.map +1 -1
  164. package/dist/agents/toolkits/openapi/prompt.cjs +1 -2
  165. package/dist/agents/toolkits/openapi/prompt.cjs.map +1 -1
  166. package/dist/agents/toolkits/openapi/prompt.js +1 -1
  167. package/dist/agents/toolkits/sql/index.cjs +10 -11
  168. package/dist/agents/toolkits/sql/index.js +1 -2
  169. package/dist/agents/toolkits/sql/prompt.cjs +1 -2
  170. package/dist/agents/toolkits/sql/prompt.cjs.map +1 -1
  171. package/dist/agents/toolkits/sql/prompt.js +1 -1
  172. package/dist/agents/toolkits/sql/sql.cjs +7 -8
  173. package/dist/agents/toolkits/sql/sql.cjs.map +1 -1
  174. package/dist/agents/toolkits/sql/sql.js +1 -2
  175. package/dist/agents/toolkits/sql/sql.js.map +1 -1
  176. package/dist/agents/toolkits/vectorstore/prompt.cjs +1 -2
  177. package/dist/agents/toolkits/vectorstore/prompt.cjs.map +1 -1
  178. package/dist/agents/toolkits/vectorstore/prompt.js +1 -1
  179. package/dist/agents/toolkits/vectorstore/vectorstore.cjs +8 -9
  180. package/dist/agents/toolkits/vectorstore/vectorstore.cjs.map +1 -1
  181. package/dist/agents/toolkits/vectorstore/vectorstore.js +1 -2
  182. package/dist/agents/toolkits/vectorstore/vectorstore.js.map +1 -1
  183. package/dist/agents/types.cjs +2 -3
  184. package/dist/agents/types.cjs.map +1 -1
  185. package/dist/agents/types.js +1 -2
  186. package/dist/agents/types.js.map +1 -1
  187. package/dist/agents/xml/index.cjs +8 -9
  188. package/dist/agents/xml/index.cjs.map +1 -1
  189. package/dist/agents/xml/index.js +1 -2
  190. package/dist/agents/xml/index.js.map +1 -1
  191. package/dist/agents/xml/output_parser.cjs +9 -10
  192. package/dist/agents/xml/output_parser.cjs.map +1 -1
  193. package/dist/agents/xml/output_parser.js +1 -2
  194. package/dist/agents/xml/output_parser.js.map +1 -1
  195. package/dist/agents/xml/prompt.cjs +1 -2
  196. package/dist/agents/xml/prompt.cjs.map +1 -1
  197. package/dist/agents/xml/prompt.js +1 -1
  198. package/dist/cache/file_system.cjs +8 -9
  199. package/dist/cache/file_system.cjs.map +1 -1
  200. package/dist/cache/file_system.js +1 -2
  201. package/dist/cache/file_system.js.map +1 -1
  202. package/dist/callbacks/handlers/console.cjs +13 -13
  203. package/dist/callbacks/handlers/console.d.cts +0 -1
  204. package/dist/callbacks/handlers/console.d.ts +0 -1
  205. package/dist/callbacks/handlers/console.js +2 -4
  206. package/dist/callbacks/handlers/run_collector.cjs +13 -13
  207. package/dist/callbacks/handlers/run_collector.d.cts +0 -1
  208. package/dist/callbacks/handlers/run_collector.d.ts +0 -1
  209. package/dist/callbacks/handlers/run_collector.js +2 -4
  210. package/dist/callbacks/handlers/tracer.cjs +13 -13
  211. package/dist/callbacks/handlers/tracer.d.cts +0 -1
  212. package/dist/callbacks/handlers/tracer.d.ts +0 -1
  213. package/dist/callbacks/handlers/tracer.js +2 -4
  214. package/dist/callbacks/handlers/tracer_langchain.cjs +13 -13
  215. package/dist/callbacks/handlers/tracer_langchain.d.cts +0 -1
  216. package/dist/callbacks/handlers/tracer_langchain.d.ts +0 -1
  217. package/dist/callbacks/handlers/tracer_langchain.js +2 -4
  218. package/dist/callbacks/index.cjs +49 -50
  219. package/dist/callbacks/index.js +1 -2
  220. package/dist/callbacks/promises.cjs +13 -13
  221. package/dist/callbacks/promises.d.cts +0 -1
  222. package/dist/callbacks/promises.d.ts +0 -1
  223. package/dist/callbacks/promises.js +2 -4
  224. package/dist/chains/analyze_documents_chain.cjs +3 -4
  225. package/dist/chains/analyze_documents_chain.cjs.map +1 -1
  226. package/dist/chains/analyze_documents_chain.js +1 -2
  227. package/dist/chains/analyze_documents_chain.js.map +1 -1
  228. package/dist/chains/api/api_chain.cjs +4 -5
  229. package/dist/chains/api/api_chain.cjs.map +1 -1
  230. package/dist/chains/api/api_chain.js +1 -2
  231. package/dist/chains/api/api_chain.js.map +1 -1
  232. package/dist/chains/api/prompts.cjs +2 -3
  233. package/dist/chains/api/prompts.cjs.map +1 -1
  234. package/dist/chains/api/prompts.js +10 -12
  235. package/dist/chains/api/prompts.js.map +1 -1
  236. package/dist/chains/base.cjs +2 -3
  237. package/dist/chains/base.cjs.map +1 -1
  238. package/dist/chains/base.js +1 -2
  239. package/dist/chains/base.js.map +1 -1
  240. package/dist/chains/chat_vector_db_chain.cjs +5 -6
  241. package/dist/chains/chat_vector_db_chain.cjs.map +1 -1
  242. package/dist/chains/chat_vector_db_chain.js +1 -2
  243. package/dist/chains/chat_vector_db_chain.js.map +1 -1
  244. package/dist/chains/combine_docs_chain.cjs +4 -5
  245. package/dist/chains/combine_docs_chain.cjs.map +1 -1
  246. package/dist/chains/combine_docs_chain.js +1 -2
  247. package/dist/chains/combine_docs_chain.js.map +1 -1
  248. package/dist/chains/combine_documents/base.cjs +2 -5
  249. package/dist/chains/combine_documents/base.cjs.map +1 -1
  250. package/dist/chains/combine_documents/base.js +2 -4
  251. package/dist/chains/combine_documents/base.js.map +1 -1
  252. package/dist/chains/combine_documents/index.cjs +9 -10
  253. package/dist/chains/combine_documents/index.js +1 -2
  254. package/dist/chains/combine_documents/reduce.cjs +8 -10
  255. package/dist/chains/combine_documents/reduce.cjs.map +1 -1
  256. package/dist/chains/combine_documents/reduce.js +1 -2
  257. package/dist/chains/combine_documents/reduce.js.map +1 -1
  258. package/dist/chains/combine_documents/stuff.cjs +5 -6
  259. package/dist/chains/combine_documents/stuff.cjs.map +1 -1
  260. package/dist/chains/combine_documents/stuff.js +4 -5
  261. package/dist/chains/combine_documents/stuff.js.map +1 -1
  262. package/dist/chains/constitutional_ai/constitutional_chain.cjs +5 -6
  263. package/dist/chains/constitutional_ai/constitutional_chain.cjs.map +1 -1
  264. package/dist/chains/constitutional_ai/constitutional_chain.js +1 -2
  265. package/dist/chains/constitutional_ai/constitutional_chain.js.map +1 -1
  266. package/dist/chains/constitutional_ai/constitutional_principle.cjs +1 -2
  267. package/dist/chains/constitutional_ai/constitutional_principle.cjs.map +1 -1
  268. package/dist/chains/constitutional_ai/constitutional_principle.js +1 -1
  269. package/dist/chains/constitutional_ai/constitutional_prompts.cjs +5 -8
  270. package/dist/chains/constitutional_ai/constitutional_prompts.cjs.map +1 -1
  271. package/dist/chains/constitutional_ai/constitutional_prompts.js +4 -7
  272. package/dist/chains/constitutional_ai/constitutional_prompts.js.map +1 -1
  273. package/dist/chains/conversation.cjs +4 -5
  274. package/dist/chains/conversation.cjs.map +1 -1
  275. package/dist/chains/conversation.js +1 -2
  276. package/dist/chains/conversation.js.map +1 -1
  277. package/dist/chains/conversational_retrieval_chain.cjs +5 -6
  278. package/dist/chains/conversational_retrieval_chain.cjs.map +1 -1
  279. package/dist/chains/conversational_retrieval_chain.js +1 -2
  280. package/dist/chains/conversational_retrieval_chain.js.map +1 -1
  281. package/dist/chains/graph_qa/cypher.cjs +12 -13
  282. package/dist/chains/graph_qa/cypher.cjs.map +1 -1
  283. package/dist/chains/graph_qa/cypher.js +1 -2
  284. package/dist/chains/graph_qa/cypher.js.map +1 -1
  285. package/dist/chains/graph_qa/prompts.cjs +8 -12
  286. package/dist/chains/graph_qa/prompts.cjs.map +1 -1
  287. package/dist/chains/graph_qa/prompts.js +7 -11
  288. package/dist/chains/graph_qa/prompts.js.map +1 -1
  289. package/dist/chains/history_aware_retriever.cjs +8 -9
  290. package/dist/chains/history_aware_retriever.cjs.map +1 -1
  291. package/dist/chains/history_aware_retriever.js +1 -2
  292. package/dist/chains/history_aware_retriever.js.map +1 -1
  293. package/dist/chains/index.cjs +32 -33
  294. package/dist/chains/index.js +1 -2
  295. package/dist/chains/llm_chain.cjs +4 -5
  296. package/dist/chains/llm_chain.cjs.map +1 -1
  297. package/dist/chains/llm_chain.js +1 -2
  298. package/dist/chains/llm_chain.js.map +1 -1
  299. package/dist/chains/load.cjs +12 -13
  300. package/dist/chains/load.cjs.map +1 -1
  301. package/dist/chains/load.js +1 -2
  302. package/dist/chains/load.js.map +1 -1
  303. package/dist/chains/openai_functions/base.cjs +3 -4
  304. package/dist/chains/openai_functions/base.cjs.map +1 -1
  305. package/dist/chains/openai_functions/base.js +1 -2
  306. package/dist/chains/openai_functions/base.js.map +1 -1
  307. package/dist/chains/openai_functions/extraction.cjs +4 -5
  308. package/dist/chains/openai_functions/extraction.cjs.map +1 -1
  309. package/dist/chains/openai_functions/extraction.js +1 -2
  310. package/dist/chains/openai_functions/extraction.js.map +1 -1
  311. package/dist/chains/openai_functions/index.cjs +12 -13
  312. package/dist/chains/openai_functions/index.js +1 -2
  313. package/dist/chains/openai_functions/openapi.cjs +7 -8
  314. package/dist/chains/openai_functions/openapi.cjs.map +1 -1
  315. package/dist/chains/openai_functions/openapi.js +1 -2
  316. package/dist/chains/openai_functions/openapi.js.map +1 -1
  317. package/dist/chains/openai_functions/tagging.cjs +4 -5
  318. package/dist/chains/openai_functions/tagging.cjs.map +1 -1
  319. package/dist/chains/openai_functions/tagging.js +1 -2
  320. package/dist/chains/openai_functions/tagging.js.map +1 -1
  321. package/dist/chains/openai_moderation.cjs +3 -4
  322. package/dist/chains/openai_moderation.cjs.map +1 -1
  323. package/dist/chains/openai_moderation.js +1 -2
  324. package/dist/chains/openai_moderation.js.map +1 -1
  325. package/dist/chains/query_constructor/index.cjs +11 -12
  326. package/dist/chains/query_constructor/index.cjs.map +1 -1
  327. package/dist/chains/query_constructor/index.js +1 -2
  328. package/dist/chains/query_constructor/index.js.map +1 -1
  329. package/dist/chains/query_constructor/ir.cjs +14 -14
  330. package/dist/chains/query_constructor/ir.js +2 -4
  331. package/dist/chains/query_constructor/parser.cjs +3 -4
  332. package/dist/chains/query_constructor/parser.cjs.map +1 -1
  333. package/dist/chains/query_constructor/parser.js +1 -2
  334. package/dist/chains/query_constructor/parser.js.map +1 -1
  335. package/dist/chains/query_constructor/prompt.cjs +23 -27
  336. package/dist/chains/query_constructor/prompt.cjs.map +1 -1
  337. package/dist/chains/query_constructor/prompt.js +22 -26
  338. package/dist/chains/query_constructor/prompt.js.map +1 -1
  339. package/dist/chains/question_answering/load.cjs +6 -7
  340. package/dist/chains/question_answering/load.cjs.map +1 -1
  341. package/dist/chains/question_answering/load.js +1 -2
  342. package/dist/chains/question_answering/load.js.map +1 -1
  343. package/dist/chains/question_answering/map_reduce_prompts.cjs +6 -10
  344. package/dist/chains/question_answering/map_reduce_prompts.cjs.map +1 -1
  345. package/dist/chains/question_answering/map_reduce_prompts.js +7 -13
  346. package/dist/chains/question_answering/map_reduce_prompts.js.map +1 -1
  347. package/dist/chains/question_answering/refine_prompts.cjs +14 -18
  348. package/dist/chains/question_answering/refine_prompts.cjs.map +1 -1
  349. package/dist/chains/question_answering/refine_prompts.js +15 -21
  350. package/dist/chains/question_answering/refine_prompts.js.map +1 -1
  351. package/dist/chains/question_answering/stuff_prompts.cjs +2 -3
  352. package/dist/chains/question_answering/stuff_prompts.cjs.map +1 -1
  353. package/dist/chains/question_answering/stuff_prompts.js +2 -4
  354. package/dist/chains/question_answering/stuff_prompts.js.map +1 -1
  355. package/dist/chains/retrieval.cjs +8 -9
  356. package/dist/chains/retrieval.cjs.map +1 -1
  357. package/dist/chains/retrieval.js +1 -2
  358. package/dist/chains/retrieval.js.map +1 -1
  359. package/dist/chains/retrieval_qa.cjs +3 -4
  360. package/dist/chains/retrieval_qa.cjs.map +1 -1
  361. package/dist/chains/retrieval_qa.js +1 -2
  362. package/dist/chains/retrieval_qa.js.map +1 -1
  363. package/dist/chains/router/llm_router.cjs +3 -4
  364. package/dist/chains/router/llm_router.cjs.map +1 -1
  365. package/dist/chains/router/llm_router.js +1 -2
  366. package/dist/chains/router/llm_router.js.map +1 -1
  367. package/dist/chains/router/multi_prompt.cjs +9 -10
  368. package/dist/chains/router/multi_prompt.cjs.map +1 -1
  369. package/dist/chains/router/multi_prompt.js +1 -2
  370. package/dist/chains/router/multi_prompt.js.map +1 -1
  371. package/dist/chains/router/multi_prompt_prompt.cjs +1 -2
  372. package/dist/chains/router/multi_prompt_prompt.cjs.map +1 -1
  373. package/dist/chains/router/multi_prompt_prompt.js +1 -1
  374. package/dist/chains/router/multi_retrieval_prompt.cjs +1 -2
  375. package/dist/chains/router/multi_retrieval_prompt.cjs.map +1 -1
  376. package/dist/chains/router/multi_retrieval_prompt.js +1 -1
  377. package/dist/chains/router/multi_retrieval_qa.cjs +9 -10
  378. package/dist/chains/router/multi_retrieval_qa.cjs.map +1 -1
  379. package/dist/chains/router/multi_retrieval_qa.js +1 -2
  380. package/dist/chains/router/multi_retrieval_qa.js.map +1 -1
  381. package/dist/chains/router/multi_route.cjs +2 -3
  382. package/dist/chains/router/multi_route.cjs.map +1 -1
  383. package/dist/chains/router/multi_route.js +1 -2
  384. package/dist/chains/router/multi_route.js.map +1 -1
  385. package/dist/chains/router/utils.cjs +1 -2
  386. package/dist/chains/router/utils.cjs.map +1 -1
  387. package/dist/chains/router/utils.js +1 -1
  388. package/dist/chains/sequential_chain.cjs +3 -4
  389. package/dist/chains/sequential_chain.cjs.map +1 -1
  390. package/dist/chains/sequential_chain.js +1 -2
  391. package/dist/chains/sequential_chain.js.map +1 -1
  392. package/dist/chains/sql_db/index.cjs +10 -11
  393. package/dist/chains/sql_db/index.js +1 -2
  394. package/dist/chains/sql_db/sql_db_chain.cjs +6 -7
  395. package/dist/chains/sql_db/sql_db_chain.cjs.map +1 -1
  396. package/dist/chains/sql_db/sql_db_chain.js +1 -2
  397. package/dist/chains/sql_db/sql_db_chain.js.map +1 -1
  398. package/dist/chains/sql_db/sql_db_prompt.cjs +2 -3
  399. package/dist/chains/sql_db/sql_db_prompt.cjs.map +1 -1
  400. package/dist/chains/sql_db/sql_db_prompt.js +1 -2
  401. package/dist/chains/sql_db/sql_db_prompt.js.map +1 -1
  402. package/dist/chains/summarization/load.cjs +5 -6
  403. package/dist/chains/summarization/load.cjs.map +1 -1
  404. package/dist/chains/summarization/load.js +1 -2
  405. package/dist/chains/summarization/load.js.map +1 -1
  406. package/dist/chains/summarization/refine_prompts.cjs +5 -9
  407. package/dist/chains/summarization/refine_prompts.cjs.map +1 -1
  408. package/dist/chains/summarization/refine_prompts.js +4 -7
  409. package/dist/chains/summarization/refine_prompts.js.map +1 -1
  410. package/dist/chains/summarization/stuff_prompts.cjs +5 -9
  411. package/dist/chains/summarization/stuff_prompts.cjs.map +1 -1
  412. package/dist/chains/summarization/stuff_prompts.js +4 -7
  413. package/dist/chains/summarization/stuff_prompts.js.map +1 -1
  414. package/dist/chains/transform.cjs +2 -3
  415. package/dist/chains/transform.cjs.map +1 -1
  416. package/dist/chains/transform.js +1 -2
  417. package/dist/chains/transform.js.map +1 -1
  418. package/dist/chains/vector_db_qa.cjs +3 -4
  419. package/dist/chains/vector_db_qa.cjs.map +1 -1
  420. package/dist/chains/vector_db_qa.js +1 -2
  421. package/dist/chains/vector_db_qa.js.map +1 -1
  422. package/dist/chat_models/universal.cjs +8 -9
  423. package/dist/chat_models/universal.cjs.map +1 -1
  424. package/dist/chat_models/universal.js +1 -2
  425. package/dist/chat_models/universal.js.map +1 -1
  426. package/dist/document.cjs +13 -14
  427. package/dist/document.js +1 -2
  428. package/dist/document_loaders/base.cjs +14 -14
  429. package/dist/document_loaders/base.js +2 -4
  430. package/dist/document_loaders/fs/buffer.cjs +8 -9
  431. package/dist/document_loaders/fs/buffer.cjs.map +1 -1
  432. package/dist/document_loaders/fs/buffer.js +1 -2
  433. package/dist/document_loaders/fs/buffer.js.map +1 -1
  434. package/dist/document_loaders/fs/directory.cjs +8 -9
  435. package/dist/document_loaders/fs/directory.cjs.map +1 -1
  436. package/dist/document_loaders/fs/directory.js +1 -2
  437. package/dist/document_loaders/fs/directory.js.map +1 -1
  438. package/dist/document_loaders/fs/json.cjs +9 -10
  439. package/dist/document_loaders/fs/json.cjs.map +1 -1
  440. package/dist/document_loaders/fs/json.js +1 -2
  441. package/dist/document_loaders/fs/json.js.map +1 -1
  442. package/dist/document_loaders/fs/multi_file.cjs +9 -10
  443. package/dist/document_loaders/fs/multi_file.cjs.map +1 -1
  444. package/dist/document_loaders/fs/multi_file.js +1 -2
  445. package/dist/document_loaders/fs/multi_file.js.map +1 -1
  446. package/dist/document_loaders/fs/text.cjs +8 -9
  447. package/dist/document_loaders/fs/text.cjs.map +1 -1
  448. package/dist/document_loaders/fs/text.js +1 -2
  449. package/dist/document_loaders/fs/text.js.map +1 -1
  450. package/dist/document_transformers/openai_functions.cjs +10 -11
  451. package/dist/document_transformers/openai_functions.cjs.map +1 -1
  452. package/dist/document_transformers/openai_functions.d.ts +0 -1
  453. package/dist/document_transformers/openai_functions.d.ts.map +1 -1
  454. package/dist/document_transformers/openai_functions.js +1 -2
  455. package/dist/document_transformers/openai_functions.js.map +1 -1
  456. package/dist/embeddings/cache_backed.cjs +9 -10
  457. package/dist/embeddings/cache_backed.cjs.map +1 -1
  458. package/dist/embeddings/cache_backed.js +1 -2
  459. package/dist/embeddings/cache_backed.js.map +1 -1
  460. package/dist/embeddings/fake.cjs +14 -14
  461. package/dist/embeddings/fake.js +2 -4
  462. package/dist/evaluation/agents/index.cjs +1 -1
  463. package/dist/evaluation/agents/index.js +2 -3
  464. package/dist/evaluation/agents/prompt.cjs +8 -10
  465. package/dist/evaluation/agents/prompt.cjs.map +1 -1
  466. package/dist/evaluation/agents/prompt.js +7 -9
  467. package/dist/evaluation/agents/prompt.js.map +1 -1
  468. package/dist/evaluation/agents/trajectory.cjs +4 -5
  469. package/dist/evaluation/agents/trajectory.cjs.map +1 -1
  470. package/dist/evaluation/agents/trajectory.js +1 -2
  471. package/dist/evaluation/agents/trajectory.js.map +1 -1
  472. package/dist/evaluation/base.cjs +4 -5
  473. package/dist/evaluation/base.cjs.map +1 -1
  474. package/dist/evaluation/base.d.ts +0 -1
  475. package/dist/evaluation/base.d.ts.map +1 -1
  476. package/dist/evaluation/base.js +1 -2
  477. package/dist/evaluation/base.js.map +1 -1
  478. package/dist/evaluation/comparison/index.cjs +1 -1
  479. package/dist/evaluation/comparison/index.js +2 -3
  480. package/dist/evaluation/comparison/pairwise.cjs +6 -7
  481. package/dist/evaluation/comparison/pairwise.cjs.map +1 -1
  482. package/dist/evaluation/comparison/pairwise.js +1 -2
  483. package/dist/evaluation/comparison/pairwise.js.map +1 -1
  484. package/dist/evaluation/comparison/prompt.cjs +16 -27
  485. package/dist/evaluation/comparison/prompt.cjs.map +1 -1
  486. package/dist/evaluation/comparison/prompt.js +15 -26
  487. package/dist/evaluation/comparison/prompt.js.map +1 -1
  488. package/dist/evaluation/criteria/criteria.cjs +5 -6
  489. package/dist/evaluation/criteria/criteria.cjs.map +1 -1
  490. package/dist/evaluation/criteria/criteria.js +1 -2
  491. package/dist/evaluation/criteria/criteria.js.map +1 -1
  492. package/dist/evaluation/criteria/index.cjs +1 -1
  493. package/dist/evaluation/criteria/index.js +2 -3
  494. package/dist/evaluation/criteria/prompt.cjs +16 -20
  495. package/dist/evaluation/criteria/prompt.cjs.map +1 -1
  496. package/dist/evaluation/criteria/prompt.js +15 -19
  497. package/dist/evaluation/criteria/prompt.js.map +1 -1
  498. package/dist/evaluation/embedding_distance/base.cjs +5 -6
  499. package/dist/evaluation/embedding_distance/base.cjs.map +1 -1
  500. package/dist/evaluation/embedding_distance/base.js +1 -2
  501. package/dist/evaluation/embedding_distance/base.js.map +1 -1
  502. package/dist/evaluation/embedding_distance/index.cjs +1 -1
  503. package/dist/evaluation/embedding_distance/index.js +2 -3
  504. package/dist/evaluation/index.cjs +19 -20
  505. package/dist/evaluation/index.d.ts +0 -5
  506. package/dist/evaluation/index.js +1 -2
  507. package/dist/evaluation/loader.cjs +10 -11
  508. package/dist/evaluation/loader.cjs.map +1 -1
  509. package/dist/evaluation/loader.d.ts +0 -2
  510. package/dist/evaluation/loader.d.ts.map +1 -1
  511. package/dist/evaluation/loader.js +1 -2
  512. package/dist/evaluation/loader.js.map +1 -1
  513. package/dist/evaluation/qa/eval_chain.cjs +3 -4
  514. package/dist/evaluation/qa/eval_chain.cjs.map +1 -1
  515. package/dist/evaluation/qa/eval_chain.js +1 -2
  516. package/dist/evaluation/qa/eval_chain.js.map +1 -1
  517. package/dist/evaluation/qa/index.cjs +1 -1
  518. package/dist/evaluation/qa/index.js +2 -3
  519. package/dist/evaluation/qa/prompt.cjs +10 -14
  520. package/dist/evaluation/qa/prompt.cjs.map +1 -1
  521. package/dist/evaluation/qa/prompt.js +9 -12
  522. package/dist/evaluation/qa/prompt.js.map +1 -1
  523. package/dist/experimental/autogpt/agent.cjs +8 -9
  524. package/dist/experimental/autogpt/agent.cjs.map +1 -1
  525. package/dist/experimental/autogpt/agent.js +3 -4
  526. package/dist/experimental/autogpt/agent.js.map +1 -1
  527. package/dist/experimental/autogpt/index.cjs +11 -12
  528. package/dist/experimental/autogpt/index.js +1 -2
  529. package/dist/experimental/autogpt/output_parser.cjs +2 -3
  530. package/dist/experimental/autogpt/output_parser.cjs.map +1 -1
  531. package/dist/experimental/autogpt/output_parser.js +1 -2
  532. package/dist/experimental/autogpt/output_parser.js.map +1 -1
  533. package/dist/experimental/autogpt/prompt.cjs +3 -4
  534. package/dist/experimental/autogpt/prompt.cjs.map +1 -1
  535. package/dist/experimental/autogpt/prompt.js +1 -2
  536. package/dist/experimental/autogpt/prompt.js.map +1 -1
  537. package/dist/experimental/autogpt/prompt_generator.cjs +3 -4
  538. package/dist/experimental/autogpt/prompt_generator.cjs.map +1 -1
  539. package/dist/experimental/autogpt/prompt_generator.js +1 -2
  540. package/dist/experimental/autogpt/prompt_generator.js.map +1 -1
  541. package/dist/experimental/autogpt/schema.cjs +1 -2
  542. package/dist/experimental/autogpt/schema.cjs.map +1 -1
  543. package/dist/experimental/autogpt/schema.js +1 -1
  544. package/dist/experimental/babyagi/agent.cjs +6 -7
  545. package/dist/experimental/babyagi/agent.cjs.map +1 -1
  546. package/dist/experimental/babyagi/agent.js +1 -2
  547. package/dist/experimental/babyagi/agent.js.map +1 -1
  548. package/dist/experimental/babyagi/index.cjs +12 -13
  549. package/dist/experimental/babyagi/index.js +1 -2
  550. package/dist/experimental/babyagi/task_creation.cjs +3 -4
  551. package/dist/experimental/babyagi/task_creation.cjs.map +1 -1
  552. package/dist/experimental/babyagi/task_creation.js +1 -2
  553. package/dist/experimental/babyagi/task_creation.js.map +1 -1
  554. package/dist/experimental/babyagi/task_execution.cjs +3 -4
  555. package/dist/experimental/babyagi/task_execution.cjs.map +1 -1
  556. package/dist/experimental/babyagi/task_execution.js +1 -2
  557. package/dist/experimental/babyagi/task_execution.js.map +1 -1
  558. package/dist/experimental/babyagi/task_prioritization.cjs +3 -4
  559. package/dist/experimental/babyagi/task_prioritization.cjs.map +1 -1
  560. package/dist/experimental/babyagi/task_prioritization.js +1 -2
  561. package/dist/experimental/babyagi/task_prioritization.js.map +1 -1
  562. package/dist/experimental/chains/violation_of_expectations/index.cjs +9 -10
  563. package/dist/experimental/chains/violation_of_expectations/index.js +1 -2
  564. package/dist/experimental/chains/violation_of_expectations/types.cjs +1 -2
  565. package/dist/experimental/chains/violation_of_expectations/types.cjs.map +1 -1
  566. package/dist/experimental/chains/violation_of_expectations/types.js +1 -1
  567. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.cjs +6 -7
  568. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.cjs.map +1 -1
  569. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.js +1 -2
  570. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.js.map +1 -1
  571. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.cjs +2 -3
  572. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.cjs.map +1 -1
  573. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.js +1 -2
  574. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.js.map +1 -1
  575. package/dist/experimental/generative_agents/generative_agent.cjs +4 -5
  576. package/dist/experimental/generative_agents/generative_agent.cjs.map +1 -1
  577. package/dist/experimental/generative_agents/generative_agent.js +1 -2
  578. package/dist/experimental/generative_agents/generative_agent.js.map +1 -1
  579. package/dist/experimental/generative_agents/generative_agent_memory.cjs +4 -5
  580. package/dist/experimental/generative_agents/generative_agent_memory.cjs.map +1 -1
  581. package/dist/experimental/generative_agents/generative_agent_memory.js +1 -2
  582. package/dist/experimental/generative_agents/generative_agent_memory.js.map +1 -1
  583. package/dist/experimental/generative_agents/index.cjs +10 -11
  584. package/dist/experimental/generative_agents/index.js +1 -2
  585. package/dist/experimental/masking/index.cjs +11 -12
  586. package/dist/experimental/masking/index.js +1 -2
  587. package/dist/experimental/masking/parser.cjs +1 -2
  588. package/dist/experimental/masking/parser.cjs.map +1 -1
  589. package/dist/experimental/masking/parser.js +1 -1
  590. package/dist/experimental/masking/parser.js.map +1 -1
  591. package/dist/experimental/masking/regex_masking_transformer.cjs +2 -3
  592. package/dist/experimental/masking/regex_masking_transformer.cjs.map +1 -1
  593. package/dist/experimental/masking/regex_masking_transformer.js +1 -2
  594. package/dist/experimental/masking/regex_masking_transformer.js.map +1 -1
  595. package/dist/experimental/masking/transformer.cjs +1 -2
  596. package/dist/experimental/masking/transformer.cjs.map +1 -1
  597. package/dist/experimental/masking/transformer.js +1 -1
  598. package/dist/experimental/openai_assistant/index.cjs +9 -10
  599. package/dist/experimental/openai_assistant/index.cjs.map +1 -1
  600. package/dist/experimental/openai_assistant/index.js +1 -2
  601. package/dist/experimental/openai_assistant/index.js.map +1 -1
  602. package/dist/experimental/openai_files/index.cjs +8 -9
  603. package/dist/experimental/openai_files/index.cjs.map +1 -1
  604. package/dist/experimental/openai_files/index.js +1 -2
  605. package/dist/experimental/openai_files/index.js.map +1 -1
  606. package/dist/experimental/plan_and_execute/agent_executor.cjs +10 -11
  607. package/dist/experimental/plan_and_execute/agent_executor.cjs.map +1 -1
  608. package/dist/experimental/plan_and_execute/agent_executor.js +1 -2
  609. package/dist/experimental/plan_and_execute/agent_executor.js.map +1 -1
  610. package/dist/experimental/plan_and_execute/base.cjs +1 -2
  611. package/dist/experimental/plan_and_execute/base.cjs.map +1 -1
  612. package/dist/experimental/plan_and_execute/base.js +1 -1
  613. package/dist/experimental/plan_and_execute/base.js.map +1 -1
  614. package/dist/experimental/plan_and_execute/index.cjs +11 -12
  615. package/dist/experimental/plan_and_execute/index.js +1 -2
  616. package/dist/experimental/plan_and_execute/outputParser.cjs +3 -4
  617. package/dist/experimental/plan_and_execute/outputParser.cjs.map +1 -1
  618. package/dist/experimental/plan_and_execute/outputParser.js +1 -2
  619. package/dist/experimental/plan_and_execute/outputParser.js.map +1 -1
  620. package/dist/experimental/plan_and_execute/prompt.cjs +2 -3
  621. package/dist/experimental/plan_and_execute/prompt.cjs.map +1 -1
  622. package/dist/experimental/plan_and_execute/prompt.js +1 -2
  623. package/dist/experimental/plan_and_execute/prompt.js.map +1 -1
  624. package/dist/experimental/prompts/custom_format.cjs +8 -9
  625. package/dist/experimental/prompts/custom_format.cjs.map +1 -1
  626. package/dist/experimental/prompts/custom_format.js +1 -2
  627. package/dist/experimental/prompts/custom_format.js.map +1 -1
  628. package/dist/experimental/prompts/handlebars.cjs +9 -10
  629. package/dist/experimental/prompts/handlebars.cjs.map +1 -1
  630. package/dist/experimental/prompts/handlebars.js +1 -2
  631. package/dist/experimental/prompts/handlebars.js.map +1 -1
  632. package/dist/hub/base.cjs +1 -2
  633. package/dist/hub/base.cjs.map +1 -1
  634. package/dist/hub/base.js +1 -1
  635. package/dist/hub/base.js.map +1 -1
  636. package/dist/hub/index.cjs +4 -5
  637. package/dist/hub/index.cjs.map +1 -1
  638. package/dist/hub/index.js +1 -2
  639. package/dist/hub/index.js.map +1 -1
  640. package/dist/hub/node.cjs +5 -6
  641. package/dist/hub/node.cjs.map +1 -1
  642. package/dist/hub/node.js +1 -2
  643. package/dist/hub/node.js.map +1 -1
  644. package/dist/index.cjs +8 -10
  645. package/dist/index.cjs.map +1 -1
  646. package/dist/index.js +1 -2
  647. package/dist/index.js.map +1 -1
  648. package/dist/indexes/index.cjs +8 -9
  649. package/dist/indexes/index.js +1 -2
  650. package/dist/load/import_constants.cjs +1 -2
  651. package/dist/load/import_constants.cjs.map +1 -1
  652. package/dist/load/import_constants.js +1 -1
  653. package/dist/load/import_map.cjs +98 -99
  654. package/dist/load/import_map.cjs.map +1 -1
  655. package/dist/load/import_map.js +1 -2
  656. package/dist/load/import_map.js.map +1 -1
  657. package/dist/load/index.cjs +5 -6
  658. package/dist/load/index.cjs.map +1 -1
  659. package/dist/load/index.js +1 -2
  660. package/dist/load/index.js.map +1 -1
  661. package/dist/load/serializable.cjs +14 -14
  662. package/dist/load/serializable.js +2 -4
  663. package/dist/memory/buffer_memory.cjs +3 -4
  664. package/dist/memory/buffer_memory.cjs.map +1 -1
  665. package/dist/memory/buffer_memory.js +1 -2
  666. package/dist/memory/buffer_memory.js.map +1 -1
  667. package/dist/memory/buffer_token_memory.cjs +3 -4
  668. package/dist/memory/buffer_token_memory.cjs.map +1 -1
  669. package/dist/memory/buffer_token_memory.js +1 -2
  670. package/dist/memory/buffer_token_memory.js.map +1 -1
  671. package/dist/memory/buffer_window_memory.cjs +3 -4
  672. package/dist/memory/buffer_window_memory.cjs.map +1 -1
  673. package/dist/memory/buffer_window_memory.js +1 -2
  674. package/dist/memory/buffer_window_memory.js.map +1 -1
  675. package/dist/memory/chat_memory.cjs +8 -9
  676. package/dist/memory/chat_memory.cjs.map +1 -1
  677. package/dist/memory/chat_memory.js +1 -2
  678. package/dist/memory/chat_memory.js.map +1 -1
  679. package/dist/memory/combined_memory.cjs +2 -3
  680. package/dist/memory/combined_memory.cjs.map +1 -1
  681. package/dist/memory/combined_memory.js +1 -2
  682. package/dist/memory/combined_memory.js.map +1 -1
  683. package/dist/memory/entity_memory.cjs +6 -7
  684. package/dist/memory/entity_memory.cjs.map +1 -1
  685. package/dist/memory/entity_memory.js +1 -2
  686. package/dist/memory/entity_memory.js.map +1 -1
  687. package/dist/memory/index.cjs +43 -44
  688. package/dist/memory/index.js +1 -2
  689. package/dist/memory/prompt.cjs +27 -33
  690. package/dist/memory/prompt.cjs.map +1 -1
  691. package/dist/memory/prompt.js +26 -32
  692. package/dist/memory/prompt.js.map +1 -1
  693. package/dist/memory/stores/entity/base.cjs +2 -3
  694. package/dist/memory/stores/entity/base.cjs.map +1 -1
  695. package/dist/memory/stores/entity/base.js +1 -2
  696. package/dist/memory/stores/entity/base.js.map +1 -1
  697. package/dist/memory/stores/entity/in_memory.cjs +2 -3
  698. package/dist/memory/stores/entity/in_memory.cjs.map +1 -1
  699. package/dist/memory/stores/entity/in_memory.js +1 -2
  700. package/dist/memory/stores/entity/in_memory.js.map +1 -1
  701. package/dist/memory/summary.cjs +5 -6
  702. package/dist/memory/summary.cjs.map +1 -1
  703. package/dist/memory/summary.js +1 -2
  704. package/dist/memory/summary.js.map +1 -1
  705. package/dist/memory/summary_buffer.cjs +3 -4
  706. package/dist/memory/summary_buffer.cjs.map +1 -1
  707. package/dist/memory/summary_buffer.js +1 -2
  708. package/dist/memory/summary_buffer.js.map +1 -1
  709. package/dist/memory/vector_store.cjs +3 -4
  710. package/dist/memory/vector_store.cjs.map +1 -1
  711. package/dist/memory/vector_store.js +1 -2
  712. package/dist/memory/vector_store.js.map +1 -1
  713. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/_runner.d.cts +1 -4
  714. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/_runner.d.ts +1 -4
  715. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.cts +1 -2
  716. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.ts +1 -2
  717. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/index.d.cts +1 -4
  718. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/index.d.ts +1 -4
  719. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/string_evaluator.d.cts +1 -1
  720. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/string_evaluator.d.ts +1 -1
  721. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.cts +0 -1
  722. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.cts.map +1 -1
  723. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.ts +0 -1
  724. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.ts.map +1 -1
  725. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.cts +0 -2
  726. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.cts.map +1 -1
  727. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.ts +0 -2
  728. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.ts.map +1 -1
  729. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/p-queue.d.cts +1 -1
  730. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/p-queue.d.ts +1 -1
  731. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/evaluation.d.cts +1 -2
  732. package/dist/node_modules/.pnpm/langsmith@0.5.9_@opentelemetry_api@1.9.0_openai@6.22.0_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/evaluation.d.ts +1 -2
  733. package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.d.cts +1 -1
  734. package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.d.ts +1 -1
  735. package/dist/output_parsers/combining.cjs +2 -3
  736. package/dist/output_parsers/combining.cjs.map +1 -1
  737. package/dist/output_parsers/combining.js +1 -2
  738. package/dist/output_parsers/combining.js.map +1 -1
  739. package/dist/output_parsers/datetime.cjs +2 -3
  740. package/dist/output_parsers/datetime.cjs.map +1 -1
  741. package/dist/output_parsers/datetime.js +1 -2
  742. package/dist/output_parsers/datetime.js.map +1 -1
  743. package/dist/output_parsers/expression.cjs +10 -11
  744. package/dist/output_parsers/expression.cjs.map +1 -1
  745. package/dist/output_parsers/expression.js +1 -2
  746. package/dist/output_parsers/expression.js.map +1 -1
  747. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs +2 -3
  748. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs.map +1 -1
  749. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js +1 -2
  750. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js.map +1 -1
  751. package/dist/output_parsers/expression_type_handlers/base.cjs +2 -3
  752. package/dist/output_parsers/expression_type_handlers/base.cjs.map +1 -1
  753. package/dist/output_parsers/expression_type_handlers/base.js +1 -2
  754. package/dist/output_parsers/expression_type_handlers/base.js.map +1 -1
  755. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs +2 -3
  756. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs.map +1 -1
  757. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js +1 -2
  758. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js.map +1 -1
  759. package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs +2 -3
  760. package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs.map +1 -1
  761. package/dist/output_parsers/expression_type_handlers/call_expression_handler.js +1 -2
  762. package/dist/output_parsers/expression_type_handlers/call_expression_handler.js.map +1 -1
  763. package/dist/output_parsers/expression_type_handlers/factory.cjs +11 -12
  764. package/dist/output_parsers/expression_type_handlers/factory.cjs.map +1 -1
  765. package/dist/output_parsers/expression_type_handlers/factory.js +1 -2
  766. package/dist/output_parsers/expression_type_handlers/factory.js.map +1 -1
  767. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs +1 -2
  768. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs.map +1 -1
  769. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.js +1 -1
  770. package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs +2 -3
  771. package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs.map +1 -1
  772. package/dist/output_parsers/expression_type_handlers/identifier_handler.js +1 -2
  773. package/dist/output_parsers/expression_type_handlers/identifier_handler.js.map +1 -1
  774. package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs +2 -3
  775. package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs.map +1 -1
  776. package/dist/output_parsers/expression_type_handlers/member_expression_handler.js +1 -2
  777. package/dist/output_parsers/expression_type_handlers/member_expression_handler.js.map +1 -1
  778. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs +2 -3
  779. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs.map +1 -1
  780. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js +1 -2
  781. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js.map +1 -1
  782. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs +3 -4
  783. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs.map +1 -1
  784. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js +1 -2
  785. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js.map +1 -1
  786. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs +2 -3
  787. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs.map +1 -1
  788. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js +1 -2
  789. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js.map +1 -1
  790. package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs +2 -3
  791. package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs.map +1 -1
  792. package/dist/output_parsers/expression_type_handlers/string_literal_handler.js +1 -2
  793. package/dist/output_parsers/expression_type_handlers/string_literal_handler.js.map +1 -1
  794. package/dist/output_parsers/fix.cjs +4 -5
  795. package/dist/output_parsers/fix.cjs.map +1 -1
  796. package/dist/output_parsers/fix.js +1 -2
  797. package/dist/output_parsers/fix.js.map +1 -1
  798. package/dist/output_parsers/http_response.cjs +2 -3
  799. package/dist/output_parsers/http_response.cjs.map +1 -1
  800. package/dist/output_parsers/http_response.js +1 -2
  801. package/dist/output_parsers/http_response.js.map +1 -1
  802. package/dist/output_parsers/index.cjs +32 -33
  803. package/dist/output_parsers/index.js +1 -2
  804. package/dist/output_parsers/noop.cjs +2 -3
  805. package/dist/output_parsers/noop.cjs.map +1 -1
  806. package/dist/output_parsers/noop.js +1 -2
  807. package/dist/output_parsers/noop.js.map +1 -1
  808. package/dist/output_parsers/openai_functions.cjs +2 -3
  809. package/dist/output_parsers/openai_functions.cjs.map +1 -1
  810. package/dist/output_parsers/openai_functions.js +1 -2
  811. package/dist/output_parsers/openai_functions.js.map +1 -1
  812. package/dist/output_parsers/openai_tools.cjs +2 -3
  813. package/dist/output_parsers/openai_tools.cjs.map +1 -1
  814. package/dist/output_parsers/openai_tools.js +1 -2
  815. package/dist/output_parsers/openai_tools.js.map +1 -1
  816. package/dist/output_parsers/prompts.cjs +4 -8
  817. package/dist/output_parsers/prompts.cjs.map +1 -1
  818. package/dist/output_parsers/prompts.js +3 -6
  819. package/dist/output_parsers/prompts.js.map +1 -1
  820. package/dist/output_parsers/regex.cjs +2 -3
  821. package/dist/output_parsers/regex.cjs.map +1 -1
  822. package/dist/output_parsers/regex.js +1 -2
  823. package/dist/output_parsers/regex.js.map +1 -1
  824. package/dist/output_parsers/router.cjs +3 -4
  825. package/dist/output_parsers/router.cjs.map +1 -1
  826. package/dist/output_parsers/router.js +1 -2
  827. package/dist/output_parsers/router.js.map +1 -1
  828. package/dist/output_parsers/structured.cjs +2 -3
  829. package/dist/output_parsers/structured.cjs.map +1 -1
  830. package/dist/output_parsers/structured.js +1 -2
  831. package/dist/output_parsers/structured.js.map +1 -1
  832. package/dist/retrievers/contextual_compression.cjs +8 -9
  833. package/dist/retrievers/contextual_compression.cjs.map +1 -1
  834. package/dist/retrievers/contextual_compression.js +1 -2
  835. package/dist/retrievers/contextual_compression.js.map +1 -1
  836. package/dist/retrievers/document_compressors/chain_extract.cjs +11 -12
  837. package/dist/retrievers/document_compressors/chain_extract.cjs.map +1 -1
  838. package/dist/retrievers/document_compressors/chain_extract.js +1 -2
  839. package/dist/retrievers/document_compressors/chain_extract.js.map +1 -1
  840. package/dist/retrievers/document_compressors/chain_extract_prompt.cjs +1 -2
  841. package/dist/retrievers/document_compressors/chain_extract_prompt.cjs.map +1 -1
  842. package/dist/retrievers/document_compressors/chain_extract_prompt.js +1 -1
  843. package/dist/retrievers/document_compressors/embeddings_filter.cjs +9 -10
  844. package/dist/retrievers/document_compressors/embeddings_filter.cjs.map +1 -1
  845. package/dist/retrievers/document_compressors/embeddings_filter.js +1 -2
  846. package/dist/retrievers/document_compressors/embeddings_filter.js.map +1 -1
  847. package/dist/retrievers/document_compressors/index.cjs +8 -10
  848. package/dist/retrievers/document_compressors/index.cjs.map +1 -1
  849. package/dist/retrievers/document_compressors/index.js +1 -2
  850. package/dist/retrievers/document_compressors/index.js.map +1 -1
  851. package/dist/retrievers/ensemble.cjs +8 -9
  852. package/dist/retrievers/ensemble.cjs.map +1 -1
  853. package/dist/retrievers/ensemble.js +1 -2
  854. package/dist/retrievers/ensemble.js.map +1 -1
  855. package/dist/retrievers/hyde.cjs +8 -9
  856. package/dist/retrievers/hyde.cjs.map +1 -1
  857. package/dist/retrievers/hyde.js +1 -2
  858. package/dist/retrievers/hyde.js.map +1 -1
  859. package/dist/retrievers/matryoshka_retriever.cjs +8 -9
  860. package/dist/retrievers/matryoshka_retriever.cjs.map +1 -1
  861. package/dist/retrievers/matryoshka_retriever.js +1 -2
  862. package/dist/retrievers/matryoshka_retriever.js.map +1 -1
  863. package/dist/retrievers/multi_query.cjs +9 -10
  864. package/dist/retrievers/multi_query.cjs.map +1 -1
  865. package/dist/retrievers/multi_query.js +1 -2
  866. package/dist/retrievers/multi_query.js.map +1 -1
  867. package/dist/retrievers/multi_vector.cjs +9 -10
  868. package/dist/retrievers/multi_vector.cjs.map +1 -1
  869. package/dist/retrievers/multi_vector.js +1 -2
  870. package/dist/retrievers/multi_vector.js.map +1 -1
  871. package/dist/retrievers/parent_document.cjs +9 -10
  872. package/dist/retrievers/parent_document.cjs.map +1 -1
  873. package/dist/retrievers/parent_document.js +1 -2
  874. package/dist/retrievers/parent_document.js.map +1 -1
  875. package/dist/retrievers/score_threshold.cjs +8 -9
  876. package/dist/retrievers/score_threshold.cjs.map +1 -1
  877. package/dist/retrievers/score_threshold.js +1 -2
  878. package/dist/retrievers/score_threshold.js.map +1 -1
  879. package/dist/retrievers/self_query/functional.cjs +13 -14
  880. package/dist/retrievers/self_query/functional.js +1 -2
  881. package/dist/retrievers/self_query/index.cjs +24 -25
  882. package/dist/retrievers/self_query/index.cjs.map +1 -1
  883. package/dist/retrievers/self_query/index.js +1 -2
  884. package/dist/retrievers/self_query/index.js.map +1 -1
  885. package/dist/retrievers/time_weighted.cjs +9 -10
  886. package/dist/retrievers/time_weighted.cjs.map +1 -1
  887. package/dist/retrievers/time_weighted.js +2 -3
  888. package/dist/retrievers/time_weighted.js.map +1 -1
  889. package/dist/schema/prompt_template.cjs +8 -10
  890. package/dist/schema/prompt_template.cjs.map +1 -1
  891. package/dist/schema/prompt_template.js +1 -2
  892. package/dist/schema/prompt_template.js.map +1 -1
  893. package/dist/schema/query_constructor.cjs +8 -10
  894. package/dist/schema/query_constructor.cjs.map +1 -1
  895. package/dist/schema/query_constructor.js +1 -2
  896. package/dist/schema/query_constructor.js.map +1 -1
  897. package/dist/smith/config.cjs +1 -2
  898. package/dist/smith/config.cjs.map +1 -1
  899. package/dist/smith/config.d.cts +0 -1
  900. package/dist/smith/config.d.cts.map +1 -1
  901. package/dist/smith/config.d.ts +0 -2
  902. package/dist/smith/config.d.ts.map +1 -1
  903. package/dist/smith/config.js +1 -1
  904. package/dist/smith/index.cjs +10 -11
  905. package/dist/smith/index.js +1 -2
  906. package/dist/smith/name_generation.cjs +1 -2
  907. package/dist/smith/name_generation.cjs.map +1 -1
  908. package/dist/smith/name_generation.js +1 -1
  909. package/dist/smith/progress.cjs +1 -2
  910. package/dist/smith/progress.cjs.map +1 -1
  911. package/dist/smith/progress.js +1 -1
  912. package/dist/smith/progress.js.map +1 -1
  913. package/dist/smith/runner_utils.cjs +6 -7
  914. package/dist/smith/runner_utils.cjs.map +1 -1
  915. package/dist/smith/runner_utils.d.cts +0 -1
  916. package/dist/smith/runner_utils.d.cts.map +1 -1
  917. package/dist/smith/runner_utils.d.ts +0 -1
  918. package/dist/smith/runner_utils.d.ts.map +1 -1
  919. package/dist/smith/runner_utils.js +1 -2
  920. package/dist/smith/runner_utils.js.map +1 -1
  921. package/dist/sql_db.cjs +9 -10
  922. package/dist/sql_db.cjs.map +1 -1
  923. package/dist/sql_db.js +1 -2
  924. package/dist/sql_db.js.map +1 -1
  925. package/dist/storage/encoder_backed.cjs +8 -9
  926. package/dist/storage/encoder_backed.cjs.map +1 -1
  927. package/dist/storage/encoder_backed.js +1 -2
  928. package/dist/storage/encoder_backed.js.map +1 -1
  929. package/dist/storage/file_system.cjs +8 -9
  930. package/dist/storage/file_system.cjs.map +1 -1
  931. package/dist/storage/file_system.js +1 -2
  932. package/dist/storage/file_system.js.map +1 -1
  933. package/dist/storage/in_memory.cjs +13 -14
  934. package/dist/storage/in_memory.js +1 -2
  935. package/dist/stores/doc/base.cjs +8 -10
  936. package/dist/stores/doc/base.cjs.map +1 -1
  937. package/dist/stores/doc/base.js +1 -2
  938. package/dist/stores/doc/base.js.map +1 -1
  939. package/dist/stores/doc/in_memory.cjs +9 -10
  940. package/dist/stores/doc/in_memory.cjs.map +1 -1
  941. package/dist/stores/doc/in_memory.js +1 -2
  942. package/dist/stores/doc/in_memory.js.map +1 -1
  943. package/dist/stores/file/base.cjs +2 -3
  944. package/dist/stores/file/base.cjs.map +1 -1
  945. package/dist/stores/file/base.js +1 -2
  946. package/dist/stores/file/base.js.map +1 -1
  947. package/dist/stores/file/in_memory.cjs +9 -10
  948. package/dist/stores/file/in_memory.cjs.map +1 -1
  949. package/dist/stores/file/in_memory.js +1 -2
  950. package/dist/stores/file/in_memory.js.map +1 -1
  951. package/dist/stores/file/node.cjs +9 -10
  952. package/dist/stores/file/node.cjs.map +1 -1
  953. package/dist/stores/file/node.js +1 -2
  954. package/dist/stores/file/node.js.map +1 -1
  955. package/dist/stores/message/in_memory.cjs +13 -14
  956. package/dist/stores/message/in_memory.js +1 -2
  957. package/dist/text_splitter.cjs +14 -14
  958. package/dist/text_splitter.d.cts +0 -1
  959. package/dist/text_splitter.d.ts +0 -1
  960. package/dist/text_splitter.js +2 -4
  961. package/dist/tools/chain.cjs +8 -9
  962. package/dist/tools/chain.cjs.map +1 -1
  963. package/dist/tools/chain.js +1 -2
  964. package/dist/tools/chain.js.map +1 -1
  965. package/dist/tools/fs.cjs +2 -3
  966. package/dist/tools/fs.cjs.map +1 -1
  967. package/dist/tools/fs.js +1 -2
  968. package/dist/tools/fs.js.map +1 -1
  969. package/dist/tools/index.cjs +33 -34
  970. package/dist/tools/index.js +1 -2
  971. package/dist/tools/json.cjs +2 -3
  972. package/dist/tools/json.cjs.map +1 -1
  973. package/dist/tools/json.js +1 -2
  974. package/dist/tools/json.js.map +1 -1
  975. package/dist/tools/render.cjs +8 -9
  976. package/dist/tools/render.cjs.map +1 -1
  977. package/dist/tools/render.js +1 -2
  978. package/dist/tools/render.js.map +1 -1
  979. package/dist/tools/requests.cjs +2 -3
  980. package/dist/tools/requests.cjs.map +1 -1
  981. package/dist/tools/requests.js +1 -2
  982. package/dist/tools/requests.js.map +1 -1
  983. package/dist/tools/retriever.cjs +9 -10
  984. package/dist/tools/retriever.cjs.map +1 -1
  985. package/dist/tools/retriever.js +1 -2
  986. package/dist/tools/retriever.js.map +1 -1
  987. package/dist/tools/sql.cjs +9 -10
  988. package/dist/tools/sql.cjs.map +1 -1
  989. package/dist/tools/sql.js +1 -2
  990. package/dist/tools/sql.js.map +1 -1
  991. package/dist/tools/vectorstore.cjs +3 -4
  992. package/dist/tools/vectorstore.cjs.map +1 -1
  993. package/dist/tools/vectorstore.js +1 -2
  994. package/dist/tools/vectorstore.js.map +1 -1
  995. package/dist/tools/webbrowser.cjs +10 -11
  996. package/dist/tools/webbrowser.cjs.map +1 -1
  997. package/dist/tools/webbrowser.js +1 -2
  998. package/dist/tools/webbrowser.js.map +1 -1
  999. package/dist/util/document.cjs +8 -10
  1000. package/dist/util/document.cjs.map +1 -1
  1001. package/dist/util/document.js +1 -2
  1002. package/dist/util/document.js.map +1 -1
  1003. package/dist/util/entrypoint_deprecation.cjs +1 -1
  1004. package/dist/util/entrypoint_deprecation.js +1 -2
  1005. package/dist/util/env.cjs +2 -2
  1006. package/dist/util/env.js +1 -2
  1007. package/dist/util/extname.cjs +1 -2
  1008. package/dist/util/extname.cjs.map +1 -1
  1009. package/dist/util/extname.js +1 -1
  1010. package/dist/util/hub.cjs +4 -5
  1011. package/dist/util/hub.cjs.map +1 -1
  1012. package/dist/util/hub.js +1 -2
  1013. package/dist/util/hub.js.map +1 -1
  1014. package/dist/util/is-network-error/index.cjs +1 -2
  1015. package/dist/util/is-network-error/index.cjs.map +1 -1
  1016. package/dist/util/is-network-error/index.js +1 -1
  1017. package/dist/util/is-network-error/index.js.map +1 -1
  1018. package/dist/util/load.cjs +1 -2
  1019. package/dist/util/load.cjs.map +1 -1
  1020. package/dist/util/load.js +1 -1
  1021. package/dist/util/math.cjs +14 -14
  1022. package/dist/util/math.js +2 -4
  1023. package/dist/util/ml-distance/distances.cjs +1 -2
  1024. package/dist/util/ml-distance/distances.cjs.map +1 -1
  1025. package/dist/util/ml-distance/distances.js +1 -1
  1026. package/dist/util/ml-distance/similarities.cjs +1 -2
  1027. package/dist/util/ml-distance/similarities.cjs.map +1 -1
  1028. package/dist/util/ml-distance/similarities.js +1 -1
  1029. package/dist/util/ml-distance-euclidean/euclidean.cjs +1 -2
  1030. package/dist/util/ml-distance-euclidean/euclidean.cjs.map +1 -1
  1031. package/dist/util/ml-distance-euclidean/euclidean.js +1 -1
  1032. package/dist/util/openapi.cjs +2 -3
  1033. package/dist/util/openapi.cjs.map +1 -1
  1034. package/dist/util/openapi.js +1 -2
  1035. package/dist/util/openapi.js.map +1 -1
  1036. package/dist/util/p-retry/index.cjs +2 -3
  1037. package/dist/util/p-retry/index.cjs.map +1 -1
  1038. package/dist/util/p-retry/index.js +1 -2
  1039. package/dist/util/p-retry/index.js.map +1 -1
  1040. package/dist/util/parse.cjs +3 -4
  1041. package/dist/util/parse.cjs.map +1 -1
  1042. package/dist/util/parse.js +1 -2
  1043. package/dist/util/parse.js.map +1 -1
  1044. package/dist/util/set.cjs +1 -2
  1045. package/dist/util/set.cjs.map +1 -1
  1046. package/dist/util/set.js +1 -1
  1047. package/dist/util/sql_utils.cjs +2 -3
  1048. package/dist/util/sql_utils.cjs.map +1 -1
  1049. package/dist/util/sql_utils.js +1 -2
  1050. package/dist/util/sql_utils.js.map +1 -1
  1051. package/dist/util/time.cjs +8 -10
  1052. package/dist/util/time.cjs.map +1 -1
  1053. package/dist/util/time.js +1 -2
  1054. package/dist/util/time.js.map +1 -1
  1055. package/dist/vectorstores/memory.cjs +9 -10
  1056. package/dist/vectorstores/memory.cjs.map +1 -1
  1057. package/dist/vectorstores/memory.js +1 -2
  1058. package/dist/vectorstores/memory.js.map +1 -1
  1059. package/package.json +21 -17
  1060. package/agents/format_scratchpad/log.cjs +0 -1
  1061. package/agents/format_scratchpad/log.d.cts +0 -1
  1062. package/agents/format_scratchpad/log.d.ts +0 -1
  1063. package/agents/format_scratchpad/log.js +0 -1
  1064. package/agents/format_scratchpad/log_to_message.cjs +0 -1
  1065. package/agents/format_scratchpad/log_to_message.d.cts +0 -1
  1066. package/agents/format_scratchpad/log_to_message.d.ts +0 -1
  1067. package/agents/format_scratchpad/log_to_message.js +0 -1
  1068. package/agents/format_scratchpad/openai_functions.cjs +0 -1
  1069. package/agents/format_scratchpad/openai_functions.d.cts +0 -1
  1070. package/agents/format_scratchpad/openai_functions.d.ts +0 -1
  1071. package/agents/format_scratchpad/openai_functions.js +0 -1
  1072. package/agents/format_scratchpad/openai_tools.cjs +0 -1
  1073. package/agents/format_scratchpad/openai_tools.d.cts +0 -1
  1074. package/agents/format_scratchpad/openai_tools.d.ts +0 -1
  1075. package/agents/format_scratchpad/openai_tools.js +0 -1
  1076. package/agents/format_scratchpad/xml.cjs +0 -1
  1077. package/agents/format_scratchpad/xml.d.cts +0 -1
  1078. package/agents/format_scratchpad/xml.d.ts +0 -1
  1079. package/agents/format_scratchpad/xml.js +0 -1
  1080. package/agents/load.cjs +0 -1
  1081. package/agents/load.d.cts +0 -1
  1082. package/agents/load.d.ts +0 -1
  1083. package/agents/load.js +0 -1
  1084. package/agents/openai/output_parser.cjs +0 -1
  1085. package/agents/openai/output_parser.d.cts +0 -1
  1086. package/agents/openai/output_parser.d.ts +0 -1
  1087. package/agents/openai/output_parser.js +0 -1
  1088. package/agents/react/output_parser.cjs +0 -1
  1089. package/agents/react/output_parser.d.cts +0 -1
  1090. package/agents/react/output_parser.d.ts +0 -1
  1091. package/agents/react/output_parser.js +0 -1
  1092. package/agents/toolkits/sql.cjs +0 -1
  1093. package/agents/toolkits/sql.d.cts +0 -1
  1094. package/agents/toolkits/sql.d.ts +0 -1
  1095. package/agents/toolkits/sql.js +0 -1
  1096. package/agents/toolkits.cjs +0 -1
  1097. package/agents/toolkits.d.cts +0 -1
  1098. package/agents/toolkits.d.ts +0 -1
  1099. package/agents/toolkits.js +0 -1
  1100. package/agents/xml/output_parser.cjs +0 -1
  1101. package/agents/xml/output_parser.d.cts +0 -1
  1102. package/agents/xml/output_parser.d.ts +0 -1
  1103. package/agents/xml/output_parser.js +0 -1
  1104. package/agents.cjs +0 -1
  1105. package/agents.d.cts +0 -1
  1106. package/agents.d.ts +0 -1
  1107. package/agents.js +0 -1
  1108. package/cache/file_system.cjs +0 -1
  1109. package/cache/file_system.d.cts +0 -1
  1110. package/cache/file_system.d.ts +0 -1
  1111. package/cache/file_system.js +0 -1
  1112. package/callbacks.cjs +0 -1
  1113. package/callbacks.d.cts +0 -1
  1114. package/callbacks.d.ts +0 -1
  1115. package/callbacks.js +0 -1
  1116. package/chains/combine_documents/reduce.cjs +0 -1
  1117. package/chains/combine_documents/reduce.d.cts +0 -1
  1118. package/chains/combine_documents/reduce.d.ts +0 -1
  1119. package/chains/combine_documents/reduce.js +0 -1
  1120. package/chains/combine_documents.cjs +0 -1
  1121. package/chains/combine_documents.d.cts +0 -1
  1122. package/chains/combine_documents.d.ts +0 -1
  1123. package/chains/combine_documents.js +0 -1
  1124. package/chains/graph_qa/cypher.cjs +0 -1
  1125. package/chains/graph_qa/cypher.d.cts +0 -1
  1126. package/chains/graph_qa/cypher.d.ts +0 -1
  1127. package/chains/graph_qa/cypher.js +0 -1
  1128. package/chains/history_aware_retriever.cjs +0 -1
  1129. package/chains/history_aware_retriever.d.cts +0 -1
  1130. package/chains/history_aware_retriever.d.ts +0 -1
  1131. package/chains/history_aware_retriever.js +0 -1
  1132. package/chains/load.cjs +0 -1
  1133. package/chains/load.d.cts +0 -1
  1134. package/chains/load.d.ts +0 -1
  1135. package/chains/load.js +0 -1
  1136. package/chains/openai_functions.cjs +0 -1
  1137. package/chains/openai_functions.d.cts +0 -1
  1138. package/chains/openai_functions.d.ts +0 -1
  1139. package/chains/openai_functions.js +0 -1
  1140. package/chains/query_constructor/ir.cjs +0 -1
  1141. package/chains/query_constructor/ir.d.cts +0 -1
  1142. package/chains/query_constructor/ir.d.ts +0 -1
  1143. package/chains/query_constructor/ir.js +0 -1
  1144. package/chains/query_constructor.cjs +0 -1
  1145. package/chains/query_constructor.d.cts +0 -1
  1146. package/chains/query_constructor.d.ts +0 -1
  1147. package/chains/query_constructor.js +0 -1
  1148. package/chains/retrieval.cjs +0 -1
  1149. package/chains/retrieval.d.cts +0 -1
  1150. package/chains/retrieval.d.ts +0 -1
  1151. package/chains/retrieval.js +0 -1
  1152. package/chains/sql_db.cjs +0 -1
  1153. package/chains/sql_db.d.cts +0 -1
  1154. package/chains/sql_db.d.ts +0 -1
  1155. package/chains/sql_db.js +0 -1
  1156. package/chains.cjs +0 -1
  1157. package/chains.d.cts +0 -1
  1158. package/chains.d.ts +0 -1
  1159. package/chains.js +0 -1
  1160. package/chat_models/universal.cjs +0 -1
  1161. package/chat_models/universal.d.cts +0 -1
  1162. package/chat_models/universal.d.ts +0 -1
  1163. package/chat_models/universal.js +0 -1
  1164. package/document.cjs +0 -1
  1165. package/document.d.cts +0 -1
  1166. package/document.d.ts +0 -1
  1167. package/document.js +0 -1
  1168. package/document_loaders/base.cjs +0 -1
  1169. package/document_loaders/base.d.cts +0 -1
  1170. package/document_loaders/base.d.ts +0 -1
  1171. package/document_loaders/base.js +0 -1
  1172. package/document_loaders/fs/buffer.cjs +0 -1
  1173. package/document_loaders/fs/buffer.d.cts +0 -1
  1174. package/document_loaders/fs/buffer.d.ts +0 -1
  1175. package/document_loaders/fs/buffer.js +0 -1
  1176. package/document_loaders/fs/directory.cjs +0 -1
  1177. package/document_loaders/fs/directory.d.cts +0 -1
  1178. package/document_loaders/fs/directory.d.ts +0 -1
  1179. package/document_loaders/fs/directory.js +0 -1
  1180. package/document_loaders/fs/json.cjs +0 -1
  1181. package/document_loaders/fs/json.d.cts +0 -1
  1182. package/document_loaders/fs/json.d.ts +0 -1
  1183. package/document_loaders/fs/json.js +0 -1
  1184. package/document_loaders/fs/multi_file.cjs +0 -1
  1185. package/document_loaders/fs/multi_file.d.cts +0 -1
  1186. package/document_loaders/fs/multi_file.d.ts +0 -1
  1187. package/document_loaders/fs/multi_file.js +0 -1
  1188. package/document_loaders/fs/text.cjs +0 -1
  1189. package/document_loaders/fs/text.d.cts +0 -1
  1190. package/document_loaders/fs/text.d.ts +0 -1
  1191. package/document_loaders/fs/text.js +0 -1
  1192. package/document_transformers/openai_functions.cjs +0 -1
  1193. package/document_transformers/openai_functions.d.cts +0 -1
  1194. package/document_transformers/openai_functions.d.ts +0 -1
  1195. package/document_transformers/openai_functions.js +0 -1
  1196. package/embeddings/cache_backed.cjs +0 -1
  1197. package/embeddings/cache_backed.d.cts +0 -1
  1198. package/embeddings/cache_backed.d.ts +0 -1
  1199. package/embeddings/cache_backed.js +0 -1
  1200. package/embeddings/fake.cjs +0 -1
  1201. package/embeddings/fake.d.cts +0 -1
  1202. package/embeddings/fake.d.ts +0 -1
  1203. package/embeddings/fake.js +0 -1
  1204. package/evaluation.cjs +0 -1
  1205. package/evaluation.d.cts +0 -1
  1206. package/evaluation.d.ts +0 -1
  1207. package/evaluation.js +0 -1
  1208. package/experimental/autogpt.cjs +0 -1
  1209. package/experimental/autogpt.d.cts +0 -1
  1210. package/experimental/autogpt.d.ts +0 -1
  1211. package/experimental/autogpt.js +0 -1
  1212. package/experimental/babyagi.cjs +0 -1
  1213. package/experimental/babyagi.d.cts +0 -1
  1214. package/experimental/babyagi.d.ts +0 -1
  1215. package/experimental/babyagi.js +0 -1
  1216. package/experimental/chains/violation_of_expectations.cjs +0 -1
  1217. package/experimental/chains/violation_of_expectations.d.cts +0 -1
  1218. package/experimental/chains/violation_of_expectations.d.ts +0 -1
  1219. package/experimental/chains/violation_of_expectations.js +0 -1
  1220. package/experimental/generative_agents.cjs +0 -1
  1221. package/experimental/generative_agents.d.cts +0 -1
  1222. package/experimental/generative_agents.d.ts +0 -1
  1223. package/experimental/generative_agents.js +0 -1
  1224. package/experimental/masking.cjs +0 -1
  1225. package/experimental/masking.d.cts +0 -1
  1226. package/experimental/masking.d.ts +0 -1
  1227. package/experimental/masking.js +0 -1
  1228. package/experimental/openai_assistant.cjs +0 -1
  1229. package/experimental/openai_assistant.d.cts +0 -1
  1230. package/experimental/openai_assistant.d.ts +0 -1
  1231. package/experimental/openai_assistant.js +0 -1
  1232. package/experimental/openai_files.cjs +0 -1
  1233. package/experimental/openai_files.d.cts +0 -1
  1234. package/experimental/openai_files.d.ts +0 -1
  1235. package/experimental/openai_files.js +0 -1
  1236. package/experimental/plan_and_execute.cjs +0 -1
  1237. package/experimental/plan_and_execute.d.cts +0 -1
  1238. package/experimental/plan_and_execute.d.ts +0 -1
  1239. package/experimental/plan_and_execute.js +0 -1
  1240. package/experimental/prompts/custom_format.cjs +0 -1
  1241. package/experimental/prompts/custom_format.d.cts +0 -1
  1242. package/experimental/prompts/custom_format.d.ts +0 -1
  1243. package/experimental/prompts/custom_format.js +0 -1
  1244. package/experimental/prompts/handlebars.cjs +0 -1
  1245. package/experimental/prompts/handlebars.d.cts +0 -1
  1246. package/experimental/prompts/handlebars.d.ts +0 -1
  1247. package/experimental/prompts/handlebars.js +0 -1
  1248. package/hub/node.cjs +0 -1
  1249. package/hub/node.d.cts +0 -1
  1250. package/hub/node.d.ts +0 -1
  1251. package/hub/node.js +0 -1
  1252. package/hub.cjs +0 -1
  1253. package/hub.d.cts +0 -1
  1254. package/hub.d.ts +0 -1
  1255. package/hub.js +0 -1
  1256. package/indexes.cjs +0 -1
  1257. package/indexes.d.cts +0 -1
  1258. package/indexes.d.ts +0 -1
  1259. package/indexes.js +0 -1
  1260. package/load/serializable.cjs +0 -1
  1261. package/load/serializable.d.cts +0 -1
  1262. package/load/serializable.d.ts +0 -1
  1263. package/load/serializable.js +0 -1
  1264. package/load.cjs +0 -1
  1265. package/load.d.cts +0 -1
  1266. package/load.d.ts +0 -1
  1267. package/load.js +0 -1
  1268. package/memory/chat_memory.cjs +0 -1
  1269. package/memory/chat_memory.d.cts +0 -1
  1270. package/memory/chat_memory.d.ts +0 -1
  1271. package/memory/chat_memory.js +0 -1
  1272. package/memory.cjs +0 -1
  1273. package/memory.d.cts +0 -1
  1274. package/memory.d.ts +0 -1
  1275. package/memory.js +0 -1
  1276. package/output_parsers/expression.cjs +0 -1
  1277. package/output_parsers/expression.d.cts +0 -1
  1278. package/output_parsers/expression.d.ts +0 -1
  1279. package/output_parsers/expression.js +0 -1
  1280. package/output_parsers.cjs +0 -1
  1281. package/output_parsers.d.cts +0 -1
  1282. package/output_parsers.d.ts +0 -1
  1283. package/output_parsers.js +0 -1
  1284. package/retrievers/contextual_compression.cjs +0 -1
  1285. package/retrievers/contextual_compression.d.cts +0 -1
  1286. package/retrievers/contextual_compression.d.ts +0 -1
  1287. package/retrievers/contextual_compression.js +0 -1
  1288. package/retrievers/document_compressors/chain_extract.cjs +0 -1
  1289. package/retrievers/document_compressors/chain_extract.d.cts +0 -1
  1290. package/retrievers/document_compressors/chain_extract.d.ts +0 -1
  1291. package/retrievers/document_compressors/chain_extract.js +0 -1
  1292. package/retrievers/document_compressors/embeddings_filter.cjs +0 -1
  1293. package/retrievers/document_compressors/embeddings_filter.d.cts +0 -1
  1294. package/retrievers/document_compressors/embeddings_filter.d.ts +0 -1
  1295. package/retrievers/document_compressors/embeddings_filter.js +0 -1
  1296. package/retrievers/document_compressors.cjs +0 -1
  1297. package/retrievers/document_compressors.d.cts +0 -1
  1298. package/retrievers/document_compressors.d.ts +0 -1
  1299. package/retrievers/document_compressors.js +0 -1
  1300. package/retrievers/ensemble.cjs +0 -1
  1301. package/retrievers/ensemble.d.cts +0 -1
  1302. package/retrievers/ensemble.d.ts +0 -1
  1303. package/retrievers/ensemble.js +0 -1
  1304. package/retrievers/hyde.cjs +0 -1
  1305. package/retrievers/hyde.d.cts +0 -1
  1306. package/retrievers/hyde.d.ts +0 -1
  1307. package/retrievers/hyde.js +0 -1
  1308. package/retrievers/matryoshka_retriever.cjs +0 -1
  1309. package/retrievers/matryoshka_retriever.d.cts +0 -1
  1310. package/retrievers/matryoshka_retriever.d.ts +0 -1
  1311. package/retrievers/matryoshka_retriever.js +0 -1
  1312. package/retrievers/multi_query.cjs +0 -1
  1313. package/retrievers/multi_query.d.cts +0 -1
  1314. package/retrievers/multi_query.d.ts +0 -1
  1315. package/retrievers/multi_query.js +0 -1
  1316. package/retrievers/multi_vector.cjs +0 -1
  1317. package/retrievers/multi_vector.d.cts +0 -1
  1318. package/retrievers/multi_vector.d.ts +0 -1
  1319. package/retrievers/multi_vector.js +0 -1
  1320. package/retrievers/parent_document.cjs +0 -1
  1321. package/retrievers/parent_document.d.cts +0 -1
  1322. package/retrievers/parent_document.d.ts +0 -1
  1323. package/retrievers/parent_document.js +0 -1
  1324. package/retrievers/score_threshold.cjs +0 -1
  1325. package/retrievers/score_threshold.d.cts +0 -1
  1326. package/retrievers/score_threshold.d.ts +0 -1
  1327. package/retrievers/score_threshold.js +0 -1
  1328. package/retrievers/self_query/functional.cjs +0 -1
  1329. package/retrievers/self_query/functional.d.cts +0 -1
  1330. package/retrievers/self_query/functional.d.ts +0 -1
  1331. package/retrievers/self_query/functional.js +0 -1
  1332. package/retrievers/self_query.cjs +0 -1
  1333. package/retrievers/self_query.d.cts +0 -1
  1334. package/retrievers/self_query.d.ts +0 -1
  1335. package/retrievers/self_query.js +0 -1
  1336. package/retrievers/time_weighted.cjs +0 -1
  1337. package/retrievers/time_weighted.d.cts +0 -1
  1338. package/retrievers/time_weighted.d.ts +0 -1
  1339. package/retrievers/time_weighted.js +0 -1
  1340. package/schema/prompt_template.cjs +0 -1
  1341. package/schema/prompt_template.d.cts +0 -1
  1342. package/schema/prompt_template.d.ts +0 -1
  1343. package/schema/prompt_template.js +0 -1
  1344. package/schema/query_constructor.cjs +0 -1
  1345. package/schema/query_constructor.d.cts +0 -1
  1346. package/schema/query_constructor.d.ts +0 -1
  1347. package/schema/query_constructor.js +0 -1
  1348. package/smith.cjs +0 -1
  1349. package/smith.d.cts +0 -1
  1350. package/smith.d.ts +0 -1
  1351. package/smith.js +0 -1
  1352. package/sql_db.cjs +0 -1
  1353. package/sql_db.d.cts +0 -1
  1354. package/sql_db.d.ts +0 -1
  1355. package/sql_db.js +0 -1
  1356. package/storage/encoder_backed.cjs +0 -1
  1357. package/storage/encoder_backed.d.cts +0 -1
  1358. package/storage/encoder_backed.d.ts +0 -1
  1359. package/storage/encoder_backed.js +0 -1
  1360. package/storage/file_system.cjs +0 -1
  1361. package/storage/file_system.d.cts +0 -1
  1362. package/storage/file_system.d.ts +0 -1
  1363. package/storage/file_system.js +0 -1
  1364. package/storage/in_memory.cjs +0 -1
  1365. package/storage/in_memory.d.cts +0 -1
  1366. package/storage/in_memory.d.ts +0 -1
  1367. package/storage/in_memory.js +0 -1
  1368. package/stores/doc/base.cjs +0 -1
  1369. package/stores/doc/base.d.cts +0 -1
  1370. package/stores/doc/base.d.ts +0 -1
  1371. package/stores/doc/base.js +0 -1
  1372. package/stores/doc/in_memory.cjs +0 -1
  1373. package/stores/doc/in_memory.d.cts +0 -1
  1374. package/stores/doc/in_memory.d.ts +0 -1
  1375. package/stores/doc/in_memory.js +0 -1
  1376. package/stores/file/in_memory.cjs +0 -1
  1377. package/stores/file/in_memory.d.cts +0 -1
  1378. package/stores/file/in_memory.d.ts +0 -1
  1379. package/stores/file/in_memory.js +0 -1
  1380. package/stores/file/node.cjs +0 -1
  1381. package/stores/file/node.d.cts +0 -1
  1382. package/stores/file/node.d.ts +0 -1
  1383. package/stores/file/node.js +0 -1
  1384. package/stores/message/in_memory.cjs +0 -1
  1385. package/stores/message/in_memory.d.cts +0 -1
  1386. package/stores/message/in_memory.d.ts +0 -1
  1387. package/stores/message/in_memory.js +0 -1
  1388. package/text_splitter.cjs +0 -1
  1389. package/text_splitter.d.cts +0 -1
  1390. package/text_splitter.d.ts +0 -1
  1391. package/text_splitter.js +0 -1
  1392. package/tools/chain.cjs +0 -1
  1393. package/tools/chain.d.cts +0 -1
  1394. package/tools/chain.d.ts +0 -1
  1395. package/tools/chain.js +0 -1
  1396. package/tools/render.cjs +0 -1
  1397. package/tools/render.d.cts +0 -1
  1398. package/tools/render.d.ts +0 -1
  1399. package/tools/render.js +0 -1
  1400. package/tools/retriever.cjs +0 -1
  1401. package/tools/retriever.d.cts +0 -1
  1402. package/tools/retriever.d.ts +0 -1
  1403. package/tools/retriever.js +0 -1
  1404. package/tools/sql.cjs +0 -1
  1405. package/tools/sql.d.cts +0 -1
  1406. package/tools/sql.d.ts +0 -1
  1407. package/tools/sql.js +0 -1
  1408. package/tools/webbrowser.cjs +0 -1
  1409. package/tools/webbrowser.d.cts +0 -1
  1410. package/tools/webbrowser.d.ts +0 -1
  1411. package/tools/webbrowser.js +0 -1
  1412. package/tools.cjs +0 -1
  1413. package/tools.d.cts +0 -1
  1414. package/tools.d.ts +0 -1
  1415. package/tools.js +0 -1
  1416. package/util/document.cjs +0 -1
  1417. package/util/document.d.cts +0 -1
  1418. package/util/document.d.ts +0 -1
  1419. package/util/document.js +0 -1
  1420. package/util/math.cjs +0 -1
  1421. package/util/math.d.cts +0 -1
  1422. package/util/math.d.ts +0 -1
  1423. package/util/math.js +0 -1
  1424. package/util/time.cjs +0 -1
  1425. package/util/time.d.cts +0 -1
  1426. package/util/time.d.ts +0 -1
  1427. package/util/time.js +0 -1
  1428. package/vectorstores/memory.cjs +0 -1
  1429. package/vectorstores/memory.d.cts +0 -1
  1430. package/vectorstores/memory.d.ts +0 -1
  1431. package/vectorstores/memory.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"encoder_backed.js","names":[],"sources":["../../src/storage/encoder_backed.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { BaseStore } from \"@langchain/core/stores\";\n\n/**\n * Class that provides a layer of abstraction over the base storage,\n * allowing for the encoding and decoding of keys and values. It extends\n * the BaseStore class.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class EncoderBackedStore<K, V, SerializedType = any> extends BaseStore<\n K,\n V\n> {\n lc_namespace = [\"langchain\", \"storage\"];\n\n store: BaseStore<string, SerializedType>;\n\n keyEncoder: (key: K) => string;\n\n valueSerializer: (value: V) => SerializedType;\n\n valueDeserializer: (value: SerializedType) => V;\n\n constructor(fields: {\n store: BaseStore<string, SerializedType>;\n keyEncoder: (key: K) => string;\n valueSerializer: (value: V) => SerializedType;\n valueDeserializer: (value: SerializedType) => V;\n }) {\n super(fields);\n this.store = fields.store;\n this.keyEncoder = fields.keyEncoder;\n this.valueSerializer = fields.valueSerializer;\n this.valueDeserializer = fields.valueDeserializer;\n }\n\n /**\n * Method to get multiple keys at once. It works with the encoded keys and\n * serialized values.\n * @param keys Array of keys to get\n * @returns Promise that resolves with an array of values or undefined for each key\n */\n async mget(keys: K[]): Promise<(V | undefined)[]> {\n const encodedKeys = keys.map(this.keyEncoder);\n const values = await this.store.mget(encodedKeys);\n return values.map((value) => {\n if (value === undefined) {\n return undefined;\n }\n return this.valueDeserializer(value);\n });\n }\n\n /**\n * Method to set multiple keys at once. It works with the encoded keys and\n * serialized values.\n * @param keyValuePairs Array of key-value pairs to set\n * @returns Promise that resolves when the operation is complete\n */\n async mset(keyValuePairs: [K, V][]): Promise<void> {\n const encodedPairs: [string, SerializedType][] = keyValuePairs.map(\n ([key, value]) => [this.keyEncoder(key), this.valueSerializer(value)]\n );\n return this.store.mset(encodedPairs);\n }\n\n /**\n * Method to delete multiple keys at once. It works with the encoded keys.\n * @param keys Array of keys to delete\n * @returns Promise that resolves when the operation is complete\n */\n async mdelete(keys: K[]): Promise<void> {\n const encodedKeys = keys.map(this.keyEncoder);\n return this.store.mdelete(encodedKeys);\n }\n\n /**\n * Method to yield keys. It works with the encoded keys.\n * @param prefix Optional prefix to filter keys\n * @returns AsyncGenerator that yields keys\n */\n async *yieldKeys(prefix?: string | undefined): AsyncGenerator<string | K> {\n yield* this.store.yieldKeys(prefix);\n }\n}\n\nexport function createDocumentStoreFromByteStore(\n store: BaseStore<string, Uint8Array>\n) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder();\n return new EncoderBackedStore({\n store,\n keyEncoder: (key: string) => key,\n valueSerializer: (doc: Document) =>\n encoder.encode(\n JSON.stringify({ pageContent: doc.pageContent, metadata: doc.metadata })\n ),\n valueDeserializer: (bytes: Uint8Array) =>\n new Document(JSON.parse(decoder.decode(bytes))),\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AASA,IAAa,qBAAb,cAAoE,UAGlE;CACA,eAAe,CAAC,aAAa,UAAU;CAEvC;CAEA;CAEA;CAEA;CAEA,YAAY,QAKT;AACD,QAAM,OAAO;AACb,OAAK,QAAQ,OAAO;AACpB,OAAK,aAAa,OAAO;AACzB,OAAK,kBAAkB,OAAO;AAC9B,OAAK,oBAAoB,OAAO;;;;;;;;CASlC,MAAM,KAAK,MAAuC;EAChD,MAAM,cAAc,KAAK,IAAI,KAAK,WAAW;AAE7C,UADe,MAAM,KAAK,MAAM,KAAK,YAAY,EACnC,KAAK,UAAU;AAC3B,OAAI,UAAU,OACZ;AAEF,UAAO,KAAK,kBAAkB,MAAM;IACpC;;;;;;;;CASJ,MAAM,KAAK,eAAwC;EACjD,MAAM,eAA2C,cAAc,KAC5D,CAAC,KAAK,WAAW,CAAC,KAAK,WAAW,IAAI,EAAE,KAAK,gBAAgB,MAAM,CAAC,CACtE;AACD,SAAO,KAAK,MAAM,KAAK,aAAa;;;;;;;CAQtC,MAAM,QAAQ,MAA0B;EACtC,MAAM,cAAc,KAAK,IAAI,KAAK,WAAW;AAC7C,SAAO,KAAK,MAAM,QAAQ,YAAY;;;;;;;CAQxC,OAAO,UAAU,QAAyD;AACxE,SAAO,KAAK,MAAM,UAAU,OAAO;;;AAIvC,SAAgB,iCACd,OACA;CACA,MAAM,UAAU,IAAI,aAAa;CACjC,MAAM,UAAU,IAAI,aAAa;AACjC,QAAO,IAAI,mBAAmB;EAC5B;EACA,aAAa,QAAgB;EAC7B,kBAAkB,QAChB,QAAQ,OACN,KAAK,UAAU;GAAE,aAAa,IAAI;GAAa,UAAU,IAAI;GAAU,CAAC,CACzE;EACH,oBAAoB,UAClB,IAAI,SAAS,KAAK,MAAM,QAAQ,OAAO,MAAM,CAAC,CAAC;EAClD,CAAC"}
1
+ {"version":3,"file":"encoder_backed.js","names":[],"sources":["../../src/storage/encoder_backed.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { BaseStore } from \"@langchain/core/stores\";\n\n/**\n * Class that provides a layer of abstraction over the base storage,\n * allowing for the encoding and decoding of keys and values. It extends\n * the BaseStore class.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class EncoderBackedStore<K, V, SerializedType = any> extends BaseStore<\n K,\n V\n> {\n lc_namespace = [\"langchain\", \"storage\"];\n\n store: BaseStore<string, SerializedType>;\n\n keyEncoder: (key: K) => string;\n\n valueSerializer: (value: V) => SerializedType;\n\n valueDeserializer: (value: SerializedType) => V;\n\n constructor(fields: {\n store: BaseStore<string, SerializedType>;\n keyEncoder: (key: K) => string;\n valueSerializer: (value: V) => SerializedType;\n valueDeserializer: (value: SerializedType) => V;\n }) {\n super(fields);\n this.store = fields.store;\n this.keyEncoder = fields.keyEncoder;\n this.valueSerializer = fields.valueSerializer;\n this.valueDeserializer = fields.valueDeserializer;\n }\n\n /**\n * Method to get multiple keys at once. It works with the encoded keys and\n * serialized values.\n * @param keys Array of keys to get\n * @returns Promise that resolves with an array of values or undefined for each key\n */\n async mget(keys: K[]): Promise<(V | undefined)[]> {\n const encodedKeys = keys.map(this.keyEncoder);\n const values = await this.store.mget(encodedKeys);\n return values.map((value) => {\n if (value === undefined) {\n return undefined;\n }\n return this.valueDeserializer(value);\n });\n }\n\n /**\n * Method to set multiple keys at once. It works with the encoded keys and\n * serialized values.\n * @param keyValuePairs Array of key-value pairs to set\n * @returns Promise that resolves when the operation is complete\n */\n async mset(keyValuePairs: [K, V][]): Promise<void> {\n const encodedPairs: [string, SerializedType][] = keyValuePairs.map(\n ([key, value]) => [this.keyEncoder(key), this.valueSerializer(value)]\n );\n return this.store.mset(encodedPairs);\n }\n\n /**\n * Method to delete multiple keys at once. It works with the encoded keys.\n * @param keys Array of keys to delete\n * @returns Promise that resolves when the operation is complete\n */\n async mdelete(keys: K[]): Promise<void> {\n const encodedKeys = keys.map(this.keyEncoder);\n return this.store.mdelete(encodedKeys);\n }\n\n /**\n * Method to yield keys. It works with the encoded keys.\n * @param prefix Optional prefix to filter keys\n * @returns AsyncGenerator that yields keys\n */\n async *yieldKeys(prefix?: string | undefined): AsyncGenerator<string | K> {\n yield* this.store.yieldKeys(prefix);\n }\n}\n\nexport function createDocumentStoreFromByteStore(\n store: BaseStore<string, Uint8Array>\n) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder();\n return new EncoderBackedStore({\n store,\n keyEncoder: (key: string) => key,\n valueSerializer: (doc: Document) =>\n encoder.encode(\n JSON.stringify({ pageContent: doc.pageContent, metadata: doc.metadata })\n ),\n valueDeserializer: (bytes: Uint8Array) =>\n new Document(JSON.parse(decoder.decode(bytes))),\n });\n}\n"],"mappings":";;;;;;;;;;;;;AASA,IAAa,qBAAb,cAAoE,UAGlE;CACA,eAAe,CAAC,aAAa,UAAU;CAEvC;CAEA;CAEA;CAEA;CAEA,YAAY,QAKT;AACD,QAAM,OAAO;AACb,OAAK,QAAQ,OAAO;AACpB,OAAK,aAAa,OAAO;AACzB,OAAK,kBAAkB,OAAO;AAC9B,OAAK,oBAAoB,OAAO;;;;;;;;CASlC,MAAM,KAAK,MAAuC;EAChD,MAAM,cAAc,KAAK,IAAI,KAAK,WAAW;AAE7C,UADe,MAAM,KAAK,MAAM,KAAK,YAAY,EACnC,KAAK,UAAU;AAC3B,OAAI,UAAU,KAAA,EACZ;AAEF,UAAO,KAAK,kBAAkB,MAAM;IACpC;;;;;;;;CASJ,MAAM,KAAK,eAAwC;EACjD,MAAM,eAA2C,cAAc,KAC5D,CAAC,KAAK,WAAW,CAAC,KAAK,WAAW,IAAI,EAAE,KAAK,gBAAgB,MAAM,CAAC,CACtE;AACD,SAAO,KAAK,MAAM,KAAK,aAAa;;;;;;;CAQtC,MAAM,QAAQ,MAA0B;EACtC,MAAM,cAAc,KAAK,IAAI,KAAK,WAAW;AAC7C,SAAO,KAAK,MAAM,QAAQ,YAAY;;;;;;;CAQxC,OAAO,UAAU,QAAyD;AACxE,SAAO,KAAK,MAAM,UAAU,OAAO;;;AAIvC,SAAgB,iCACd,OACA;CACA,MAAM,UAAU,IAAI,aAAa;CACjC,MAAM,UAAU,IAAI,aAAa;AACjC,QAAO,IAAI,mBAAmB;EAC5B;EACA,aAAa,QAAgB;EAC7B,kBAAkB,QAChB,QAAQ,OACN,KAAK,UAAU;GAAE,aAAa,IAAI;GAAa,UAAU,IAAI;GAAU,CAAC,CACzE;EACH,oBAAoB,UAClB,IAAI,SAAS,KAAK,MAAM,QAAQ,OAAO,MAAM,CAAC,CAAC;EAClD,CAAC"}
@@ -1,11 +1,10 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
3
3
  let node_path = require("node:path");
4
4
  node_path = require_runtime.__toESM(node_path);
5
5
  let node_fs_promises = require("node:fs/promises");
6
6
  node_fs_promises = require_runtime.__toESM(node_fs_promises);
7
7
  let _langchain_core_stores = require("@langchain/core/stores");
8
-
9
8
  //#region src/storage/file_system.ts
10
9
  var file_system_exports = /* @__PURE__ */ require_runtime.__exportAll({ LocalFileStore: () => LocalFileStore });
11
10
  /**
@@ -146,13 +145,13 @@ var LocalFileStore = class extends _langchain_core_stores.BaseStore {
146
145
  return new this({ rootPath });
147
146
  }
148
147
  };
149
-
150
148
  //#endregion
151
149
  exports.LocalFileStore = LocalFileStore;
152
- Object.defineProperty(exports, 'file_system_exports', {
153
- enumerable: true,
154
- get: function () {
155
- return file_system_exports;
156
- }
150
+ Object.defineProperty(exports, "file_system_exports", {
151
+ enumerable: true,
152
+ get: function() {
153
+ return file_system_exports;
154
+ }
157
155
  });
156
+
158
157
  //# sourceMappingURL=file_system.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"file_system.cjs","names":["BaseStore","fs","path"],"sources":["../../src/storage/file_system.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { BaseStore } from \"@langchain/core/stores\";\n\n/**\n * File system implementation of the BaseStore using a dictionary. Used for\n * storing key-value pairs in the file system.\n * @example\n * ```typescript\n * const store = await LocalFileStore.fromPath(\"./messages\");\n * await store.mset(\n * Array.from({ length: 5 }).map((_, index) => [\n * `message:id:${index}`,\n * new TextEncoder().encode(\n * JSON.stringify(\n * index % 2 === 0\n * ? new AIMessage(\"ai stuff...\")\n * : new HumanMessage(\"human stuff...\"),\n * ),\n * ),\n * ]),\n * );\n * const retrievedMessages = await store.mget([\"message:id:0\", \"message:id:1\"]);\n * console.log(retrievedMessages.map((v) => new TextDecoder().decode(v)));\n * for await (const key of store.yieldKeys(\"message:id:\")) {\n * await store.mdelete([key]);\n * }\n * ```\n *\n * @security **Security Notice** This file store\n * can alter any text file in the provided directory and any subfolders.\n * Make sure that the path you specify when initializing the store is free\n * of other files.\n */\nexport class LocalFileStore extends BaseStore<string, Uint8Array> {\n lc_namespace = [\"langchain\", \"storage\"];\n\n rootPath: string;\n\n constructor(fields: { rootPath: string }) {\n super(fields);\n this.rootPath = fields.rootPath;\n }\n\n /**\n * Read and parse the file at the given path.\n * @param key The key to read the file for.\n * @returns Promise that resolves to the parsed file content.\n */\n private async getParsedFile(key: string): Promise<Uint8Array | undefined> {\n // Validate the key to prevent path traversal\n if (!/^[a-zA-Z0-9_\\-:.]+$/.test(key)) {\n throw new Error(\n \"Invalid key. Only alphanumeric characters, underscores, hyphens, colons, and periods are allowed.\"\n );\n }\n try {\n const fileContent = await fs.readFile(this.getFullPath(key));\n if (!fileContent) {\n return undefined;\n }\n return fileContent;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (e: any) {\n // File does not exist yet.\n if (\"code\" in e && e.code === \"ENOENT\") {\n return undefined;\n }\n throw new Error(\n `Error reading and parsing file at path: ${\n this.rootPath\n }.\\nError: ${JSON.stringify(e)}`\n );\n }\n }\n\n /**\n * Writes the given key-value pairs to the file at the given path.\n * @param fileContent An object with the key-value pairs to be written to the file.\n */\n private async setFileContent(content: Uint8Array, key: string) {\n try {\n await fs.writeFile(this.getFullPath(key), content);\n } catch (error) {\n throw new Error(\n `Error writing file at path: ${this.getFullPath(\n key\n )}.\\nError: ${JSON.stringify(error)}`\n );\n }\n }\n\n /**\n * Returns the full path of the file where the value of the given key is stored.\n * @param key the key to get the full path for\n */\n private getFullPath(key: string): string {\n try {\n const keyAsTxtFile = `${key}.txt`;\n\n // Validate the key to prevent path traversal\n if (!/^[a-zA-Z0-9_.\\-/]+$/.test(key)) {\n throw new Error(`Invalid characters in key: ${key}`);\n }\n\n const fullPath = path.resolve(this.rootPath, keyAsTxtFile);\n const commonPath = path.resolve(this.rootPath);\n\n if (!fullPath.startsWith(commonPath)) {\n throw new Error(\n `Invalid key: ${key}. Key should be relative to the root path. ` +\n `Root path: ${this.rootPath}, Full path: ${fullPath}`\n );\n }\n\n return fullPath;\n } catch (e) {\n throw new Error(\n `Error getting full path for key: ${key}.\\nError: ${String(e)}`\n );\n }\n }\n\n /**\n * Retrieves the values associated with the given keys from the store.\n * @param keys Keys to retrieve values for.\n * @returns Array of values associated with the given keys.\n */\n async mget(keys: string[]) {\n const values: (Uint8Array | undefined)[] = [];\n for (const key of keys) {\n const fileContent = await this.getParsedFile(key);\n values.push(fileContent);\n }\n return values;\n }\n\n /**\n * Sets the values for the given keys in the store.\n * @param keyValuePairs Array of key-value pairs to set in the store.\n * @returns Promise that resolves when all key-value pairs have been set.\n */\n async mset(keyValuePairs: [string, Uint8Array][]): Promise<void> {\n await Promise.all(\n keyValuePairs.map(([key, value]) => this.setFileContent(value, key))\n );\n }\n\n /**\n * Deletes the given keys and their associated values from the store.\n * @param keys Keys to delete from the store.\n * @returns Promise that resolves when all keys have been deleted.\n */\n async mdelete(keys: string[]): Promise<void> {\n await Promise.all(keys.map((key) => fs.unlink(this.getFullPath(key))));\n }\n\n /**\n * Asynchronous generator that yields keys from the store. If a prefix is\n * provided, it only yields keys that start with the prefix.\n * @param prefix Optional prefix to filter keys.\n * @returns AsyncGenerator that yields keys from the store.\n */\n async *yieldKeys(prefix?: string): AsyncGenerator<string> {\n const allFiles = await fs.readdir(this.rootPath);\n const allKeys = allFiles.map((file) => file.replace(\".txt\", \"\"));\n for (const key of allKeys) {\n if (prefix === undefined || key.startsWith(prefix)) {\n yield key;\n }\n }\n }\n\n /**\n * Static method for initializing the class.\n * Preforms a check to see if the directory exists, and if not, creates it.\n * @param path Path to the directory.\n * @returns Promise that resolves to an instance of the class.\n */\n static async fromPath(rootPath: string): Promise<LocalFileStore> {\n try {\n // Verifies the directory exists at the provided path, and that it is readable and writable.\n await fs.access(rootPath, fs.constants.R_OK | fs.constants.W_OK);\n } catch {\n try {\n // Directory does not exist, create it.\n await fs.mkdir(rootPath, { recursive: true });\n } catch (error) {\n throw new Error(\n `An error occurred creating directory at: ${rootPath}.\\nError: ${JSON.stringify(\n error\n )}`\n );\n }\n }\n\n return new this({ rootPath });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,iBAAb,cAAoCA,iCAA8B;CAChE,eAAe,CAAC,aAAa,UAAU;CAEvC;CAEA,YAAY,QAA8B;AACxC,QAAM,OAAO;AACb,OAAK,WAAW,OAAO;;;;;;;CAQzB,MAAc,cAAc,KAA8C;AAExE,MAAI,CAAC,sBAAsB,KAAK,IAAI,CAClC,OAAM,IAAI,MACR,oGACD;AAEH,MAAI;GACF,MAAM,cAAc,MAAMC,iBAAG,SAAS,KAAK,YAAY,IAAI,CAAC;AAC5D,OAAI,CAAC,YACH;AAEF,UAAO;WAEA,GAAQ;AAEf,OAAI,UAAU,KAAK,EAAE,SAAS,SAC5B;AAEF,SAAM,IAAI,MACR,2CACE,KAAK,SACN,YAAY,KAAK,UAAU,EAAE,GAC/B;;;;;;;CAQL,MAAc,eAAe,SAAqB,KAAa;AAC7D,MAAI;AACF,SAAMA,iBAAG,UAAU,KAAK,YAAY,IAAI,EAAE,QAAQ;WAC3C,OAAO;AACd,SAAM,IAAI,MACR,+BAA+B,KAAK,YAClC,IACD,CAAC,YAAY,KAAK,UAAU,MAAM,GACpC;;;;;;;CAQL,AAAQ,YAAY,KAAqB;AACvC,MAAI;GACF,MAAM,eAAe,GAAG,IAAI;AAG5B,OAAI,CAAC,sBAAsB,KAAK,IAAI,CAClC,OAAM,IAAI,MAAM,8BAA8B,MAAM;GAGtD,MAAM,WAAWC,UAAK,QAAQ,KAAK,UAAU,aAAa;GAC1D,MAAM,aAAaA,UAAK,QAAQ,KAAK,SAAS;AAE9C,OAAI,CAAC,SAAS,WAAW,WAAW,CAClC,OAAM,IAAI,MACR,gBAAgB,IAAI,wDACJ,KAAK,SAAS,eAAe,WAC9C;AAGH,UAAO;WACA,GAAG;AACV,SAAM,IAAI,MACR,oCAAoC,IAAI,YAAY,OAAO,EAAE,GAC9D;;;;;;;;CASL,MAAM,KAAK,MAAgB;EACzB,MAAM,SAAqC,EAAE;AAC7C,OAAK,MAAM,OAAO,MAAM;GACtB,MAAM,cAAc,MAAM,KAAK,cAAc,IAAI;AACjD,UAAO,KAAK,YAAY;;AAE1B,SAAO;;;;;;;CAQT,MAAM,KAAK,eAAsD;AAC/D,QAAM,QAAQ,IACZ,cAAc,KAAK,CAAC,KAAK,WAAW,KAAK,eAAe,OAAO,IAAI,CAAC,CACrE;;;;;;;CAQH,MAAM,QAAQ,MAA+B;AAC3C,QAAM,QAAQ,IAAI,KAAK,KAAK,QAAQD,iBAAG,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC;;;;;;;;CASxE,OAAO,UAAU,QAAyC;EAExD,MAAM,WADW,MAAMA,iBAAG,QAAQ,KAAK,SAAS,EACvB,KAAK,SAAS,KAAK,QAAQ,QAAQ,GAAG,CAAC;AAChE,OAAK,MAAM,OAAO,QAChB,KAAI,WAAW,UAAa,IAAI,WAAW,OAAO,CAChD,OAAM;;;;;;;;CAWZ,aAAa,SAAS,UAA2C;AAC/D,MAAI;AAEF,SAAMA,iBAAG,OAAO,UAAUA,iBAAG,UAAU,OAAOA,iBAAG,UAAU,KAAK;UAC1D;AACN,OAAI;AAEF,UAAMA,iBAAG,MAAM,UAAU,EAAE,WAAW,MAAM,CAAC;YACtC,OAAO;AACd,UAAM,IAAI,MACR,4CAA4C,SAAS,YAAY,KAAK,UACpE,MACD,GACF;;;AAIL,SAAO,IAAI,KAAK,EAAE,UAAU,CAAC"}
1
+ {"version":3,"file":"file_system.cjs","names":["BaseStore","fs","path"],"sources":["../../src/storage/file_system.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { BaseStore } from \"@langchain/core/stores\";\n\n/**\n * File system implementation of the BaseStore using a dictionary. Used for\n * storing key-value pairs in the file system.\n * @example\n * ```typescript\n * const store = await LocalFileStore.fromPath(\"./messages\");\n * await store.mset(\n * Array.from({ length: 5 }).map((_, index) => [\n * `message:id:${index}`,\n * new TextEncoder().encode(\n * JSON.stringify(\n * index % 2 === 0\n * ? new AIMessage(\"ai stuff...\")\n * : new HumanMessage(\"human stuff...\"),\n * ),\n * ),\n * ]),\n * );\n * const retrievedMessages = await store.mget([\"message:id:0\", \"message:id:1\"]);\n * console.log(retrievedMessages.map((v) => new TextDecoder().decode(v)));\n * for await (const key of store.yieldKeys(\"message:id:\")) {\n * await store.mdelete([key]);\n * }\n * ```\n *\n * @security **Security Notice** This file store\n * can alter any text file in the provided directory and any subfolders.\n * Make sure that the path you specify when initializing the store is free\n * of other files.\n */\nexport class LocalFileStore extends BaseStore<string, Uint8Array> {\n lc_namespace = [\"langchain\", \"storage\"];\n\n rootPath: string;\n\n constructor(fields: { rootPath: string }) {\n super(fields);\n this.rootPath = fields.rootPath;\n }\n\n /**\n * Read and parse the file at the given path.\n * @param key The key to read the file for.\n * @returns Promise that resolves to the parsed file content.\n */\n private async getParsedFile(key: string): Promise<Uint8Array | undefined> {\n // Validate the key to prevent path traversal\n if (!/^[a-zA-Z0-9_\\-:.]+$/.test(key)) {\n throw new Error(\n \"Invalid key. Only alphanumeric characters, underscores, hyphens, colons, and periods are allowed.\"\n );\n }\n try {\n const fileContent = await fs.readFile(this.getFullPath(key));\n if (!fileContent) {\n return undefined;\n }\n return fileContent;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (e: any) {\n // File does not exist yet.\n if (\"code\" in e && e.code === \"ENOENT\") {\n return undefined;\n }\n throw new Error(\n `Error reading and parsing file at path: ${\n this.rootPath\n }.\\nError: ${JSON.stringify(e)}`\n );\n }\n }\n\n /**\n * Writes the given key-value pairs to the file at the given path.\n * @param fileContent An object with the key-value pairs to be written to the file.\n */\n private async setFileContent(content: Uint8Array, key: string) {\n try {\n await fs.writeFile(this.getFullPath(key), content);\n } catch (error) {\n throw new Error(\n `Error writing file at path: ${this.getFullPath(\n key\n )}.\\nError: ${JSON.stringify(error)}`\n );\n }\n }\n\n /**\n * Returns the full path of the file where the value of the given key is stored.\n * @param key the key to get the full path for\n */\n private getFullPath(key: string): string {\n try {\n const keyAsTxtFile = `${key}.txt`;\n\n // Validate the key to prevent path traversal\n if (!/^[a-zA-Z0-9_.\\-/]+$/.test(key)) {\n throw new Error(`Invalid characters in key: ${key}`);\n }\n\n const fullPath = path.resolve(this.rootPath, keyAsTxtFile);\n const commonPath = path.resolve(this.rootPath);\n\n if (!fullPath.startsWith(commonPath)) {\n throw new Error(\n `Invalid key: ${key}. Key should be relative to the root path. ` +\n `Root path: ${this.rootPath}, Full path: ${fullPath}`\n );\n }\n\n return fullPath;\n } catch (e) {\n throw new Error(\n `Error getting full path for key: ${key}.\\nError: ${String(e)}`\n );\n }\n }\n\n /**\n * Retrieves the values associated with the given keys from the store.\n * @param keys Keys to retrieve values for.\n * @returns Array of values associated with the given keys.\n */\n async mget(keys: string[]) {\n const values: (Uint8Array | undefined)[] = [];\n for (const key of keys) {\n const fileContent = await this.getParsedFile(key);\n values.push(fileContent);\n }\n return values;\n }\n\n /**\n * Sets the values for the given keys in the store.\n * @param keyValuePairs Array of key-value pairs to set in the store.\n * @returns Promise that resolves when all key-value pairs have been set.\n */\n async mset(keyValuePairs: [string, Uint8Array][]): Promise<void> {\n await Promise.all(\n keyValuePairs.map(([key, value]) => this.setFileContent(value, key))\n );\n }\n\n /**\n * Deletes the given keys and their associated values from the store.\n * @param keys Keys to delete from the store.\n * @returns Promise that resolves when all keys have been deleted.\n */\n async mdelete(keys: string[]): Promise<void> {\n await Promise.all(keys.map((key) => fs.unlink(this.getFullPath(key))));\n }\n\n /**\n * Asynchronous generator that yields keys from the store. If a prefix is\n * provided, it only yields keys that start with the prefix.\n * @param prefix Optional prefix to filter keys.\n * @returns AsyncGenerator that yields keys from the store.\n */\n async *yieldKeys(prefix?: string): AsyncGenerator<string> {\n const allFiles = await fs.readdir(this.rootPath);\n const allKeys = allFiles.map((file) => file.replace(\".txt\", \"\"));\n for (const key of allKeys) {\n if (prefix === undefined || key.startsWith(prefix)) {\n yield key;\n }\n }\n }\n\n /**\n * Static method for initializing the class.\n * Preforms a check to see if the directory exists, and if not, creates it.\n * @param path Path to the directory.\n * @returns Promise that resolves to an instance of the class.\n */\n static async fromPath(rootPath: string): Promise<LocalFileStore> {\n try {\n // Verifies the directory exists at the provided path, and that it is readable and writable.\n await fs.access(rootPath, fs.constants.R_OK | fs.constants.W_OK);\n } catch {\n try {\n // Directory does not exist, create it.\n await fs.mkdir(rootPath, { recursive: true });\n } catch (error) {\n throw new Error(\n `An error occurred creating directory at: ${rootPath}.\\nError: ${JSON.stringify(\n error\n )}`\n );\n }\n }\n\n return new this({ rootPath });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,iBAAb,cAAoCA,uBAAAA,UAA8B;CAChE,eAAe,CAAC,aAAa,UAAU;CAEvC;CAEA,YAAY,QAA8B;AACxC,QAAM,OAAO;AACb,OAAK,WAAW,OAAO;;;;;;;CAQzB,MAAc,cAAc,KAA8C;AAExE,MAAI,CAAC,sBAAsB,KAAK,IAAI,CAClC,OAAM,IAAI,MACR,oGACD;AAEH,MAAI;GACF,MAAM,cAAc,MAAMC,iBAAG,SAAS,KAAK,YAAY,IAAI,CAAC;AAC5D,OAAI,CAAC,YACH;AAEF,UAAO;WAEA,GAAQ;AAEf,OAAI,UAAU,KAAK,EAAE,SAAS,SAC5B;AAEF,SAAM,IAAI,MACR,2CACE,KAAK,SACN,YAAY,KAAK,UAAU,EAAE,GAC/B;;;;;;;CAQL,MAAc,eAAe,SAAqB,KAAa;AAC7D,MAAI;AACF,SAAMA,iBAAG,UAAU,KAAK,YAAY,IAAI,EAAE,QAAQ;WAC3C,OAAO;AACd,SAAM,IAAI,MACR,+BAA+B,KAAK,YAClC,IACD,CAAC,YAAY,KAAK,UAAU,MAAM,GACpC;;;;;;;CAQL,YAAoB,KAAqB;AACvC,MAAI;GACF,MAAM,eAAe,GAAG,IAAI;AAG5B,OAAI,CAAC,sBAAsB,KAAK,IAAI,CAClC,OAAM,IAAI,MAAM,8BAA8B,MAAM;GAGtD,MAAM,WAAWC,UAAK,QAAQ,KAAK,UAAU,aAAa;GAC1D,MAAM,aAAaA,UAAK,QAAQ,KAAK,SAAS;AAE9C,OAAI,CAAC,SAAS,WAAW,WAAW,CAClC,OAAM,IAAI,MACR,gBAAgB,IAAI,wDACJ,KAAK,SAAS,eAAe,WAC9C;AAGH,UAAO;WACA,GAAG;AACV,SAAM,IAAI,MACR,oCAAoC,IAAI,YAAY,OAAO,EAAE,GAC9D;;;;;;;;CASL,MAAM,KAAK,MAAgB;EACzB,MAAM,SAAqC,EAAE;AAC7C,OAAK,MAAM,OAAO,MAAM;GACtB,MAAM,cAAc,MAAM,KAAK,cAAc,IAAI;AACjD,UAAO,KAAK,YAAY;;AAE1B,SAAO;;;;;;;CAQT,MAAM,KAAK,eAAsD;AAC/D,QAAM,QAAQ,IACZ,cAAc,KAAK,CAAC,KAAK,WAAW,KAAK,eAAe,OAAO,IAAI,CAAC,CACrE;;;;;;;CAQH,MAAM,QAAQ,MAA+B;AAC3C,QAAM,QAAQ,IAAI,KAAK,KAAK,QAAQD,iBAAG,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC;;;;;;;;CASxE,OAAO,UAAU,QAAyC;EAExD,MAAM,WADW,MAAMA,iBAAG,QAAQ,KAAK,SAAS,EACvB,KAAK,SAAS,KAAK,QAAQ,QAAQ,GAAG,CAAC;AAChE,OAAK,MAAM,OAAO,QAChB,KAAI,WAAW,KAAA,KAAa,IAAI,WAAW,OAAO,CAChD,OAAM;;;;;;;;CAWZ,aAAa,SAAS,UAA2C;AAC/D,MAAI;AAEF,SAAMA,iBAAG,OAAO,UAAUA,iBAAG,UAAU,OAAOA,iBAAG,UAAU,KAAK;UAC1D;AACN,OAAI;AAEF,UAAMA,iBAAG,MAAM,UAAU,EAAE,WAAW,MAAM,CAAC;YACtC,OAAO;AACd,UAAM,IAAI,MACR,4CAA4C,SAAS,YAAY,KAAK,UACpE,MACD,GACF;;;AAIL,SAAO,IAAI,KAAK,EAAE,UAAU,CAAC"}
@@ -2,7 +2,6 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import * as path$1 from "node:path";
3
3
  import * as fs$1 from "node:fs/promises";
4
4
  import { BaseStore } from "@langchain/core/stores";
5
-
6
5
  //#region src/storage/file_system.ts
7
6
  var file_system_exports = /* @__PURE__ */ __exportAll({ LocalFileStore: () => LocalFileStore });
8
7
  /**
@@ -143,7 +142,7 @@ var LocalFileStore = class extends BaseStore {
143
142
  return new this({ rootPath });
144
143
  }
145
144
  };
146
-
147
145
  //#endregion
148
146
  export { LocalFileStore, file_system_exports };
147
+
149
148
  //# sourceMappingURL=file_system.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file_system.js","names":["fs","path"],"sources":["../../src/storage/file_system.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { BaseStore } from \"@langchain/core/stores\";\n\n/**\n * File system implementation of the BaseStore using a dictionary. Used for\n * storing key-value pairs in the file system.\n * @example\n * ```typescript\n * const store = await LocalFileStore.fromPath(\"./messages\");\n * await store.mset(\n * Array.from({ length: 5 }).map((_, index) => [\n * `message:id:${index}`,\n * new TextEncoder().encode(\n * JSON.stringify(\n * index % 2 === 0\n * ? new AIMessage(\"ai stuff...\")\n * : new HumanMessage(\"human stuff...\"),\n * ),\n * ),\n * ]),\n * );\n * const retrievedMessages = await store.mget([\"message:id:0\", \"message:id:1\"]);\n * console.log(retrievedMessages.map((v) => new TextDecoder().decode(v)));\n * for await (const key of store.yieldKeys(\"message:id:\")) {\n * await store.mdelete([key]);\n * }\n * ```\n *\n * @security **Security Notice** This file store\n * can alter any text file in the provided directory and any subfolders.\n * Make sure that the path you specify when initializing the store is free\n * of other files.\n */\nexport class LocalFileStore extends BaseStore<string, Uint8Array> {\n lc_namespace = [\"langchain\", \"storage\"];\n\n rootPath: string;\n\n constructor(fields: { rootPath: string }) {\n super(fields);\n this.rootPath = fields.rootPath;\n }\n\n /**\n * Read and parse the file at the given path.\n * @param key The key to read the file for.\n * @returns Promise that resolves to the parsed file content.\n */\n private async getParsedFile(key: string): Promise<Uint8Array | undefined> {\n // Validate the key to prevent path traversal\n if (!/^[a-zA-Z0-9_\\-:.]+$/.test(key)) {\n throw new Error(\n \"Invalid key. Only alphanumeric characters, underscores, hyphens, colons, and periods are allowed.\"\n );\n }\n try {\n const fileContent = await fs.readFile(this.getFullPath(key));\n if (!fileContent) {\n return undefined;\n }\n return fileContent;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (e: any) {\n // File does not exist yet.\n if (\"code\" in e && e.code === \"ENOENT\") {\n return undefined;\n }\n throw new Error(\n `Error reading and parsing file at path: ${\n this.rootPath\n }.\\nError: ${JSON.stringify(e)}`\n );\n }\n }\n\n /**\n * Writes the given key-value pairs to the file at the given path.\n * @param fileContent An object with the key-value pairs to be written to the file.\n */\n private async setFileContent(content: Uint8Array, key: string) {\n try {\n await fs.writeFile(this.getFullPath(key), content);\n } catch (error) {\n throw new Error(\n `Error writing file at path: ${this.getFullPath(\n key\n )}.\\nError: ${JSON.stringify(error)}`\n );\n }\n }\n\n /**\n * Returns the full path of the file where the value of the given key is stored.\n * @param key the key to get the full path for\n */\n private getFullPath(key: string): string {\n try {\n const keyAsTxtFile = `${key}.txt`;\n\n // Validate the key to prevent path traversal\n if (!/^[a-zA-Z0-9_.\\-/]+$/.test(key)) {\n throw new Error(`Invalid characters in key: ${key}`);\n }\n\n const fullPath = path.resolve(this.rootPath, keyAsTxtFile);\n const commonPath = path.resolve(this.rootPath);\n\n if (!fullPath.startsWith(commonPath)) {\n throw new Error(\n `Invalid key: ${key}. Key should be relative to the root path. ` +\n `Root path: ${this.rootPath}, Full path: ${fullPath}`\n );\n }\n\n return fullPath;\n } catch (e) {\n throw new Error(\n `Error getting full path for key: ${key}.\\nError: ${String(e)}`\n );\n }\n }\n\n /**\n * Retrieves the values associated with the given keys from the store.\n * @param keys Keys to retrieve values for.\n * @returns Array of values associated with the given keys.\n */\n async mget(keys: string[]) {\n const values: (Uint8Array | undefined)[] = [];\n for (const key of keys) {\n const fileContent = await this.getParsedFile(key);\n values.push(fileContent);\n }\n return values;\n }\n\n /**\n * Sets the values for the given keys in the store.\n * @param keyValuePairs Array of key-value pairs to set in the store.\n * @returns Promise that resolves when all key-value pairs have been set.\n */\n async mset(keyValuePairs: [string, Uint8Array][]): Promise<void> {\n await Promise.all(\n keyValuePairs.map(([key, value]) => this.setFileContent(value, key))\n );\n }\n\n /**\n * Deletes the given keys and their associated values from the store.\n * @param keys Keys to delete from the store.\n * @returns Promise that resolves when all keys have been deleted.\n */\n async mdelete(keys: string[]): Promise<void> {\n await Promise.all(keys.map((key) => fs.unlink(this.getFullPath(key))));\n }\n\n /**\n * Asynchronous generator that yields keys from the store. If a prefix is\n * provided, it only yields keys that start with the prefix.\n * @param prefix Optional prefix to filter keys.\n * @returns AsyncGenerator that yields keys from the store.\n */\n async *yieldKeys(prefix?: string): AsyncGenerator<string> {\n const allFiles = await fs.readdir(this.rootPath);\n const allKeys = allFiles.map((file) => file.replace(\".txt\", \"\"));\n for (const key of allKeys) {\n if (prefix === undefined || key.startsWith(prefix)) {\n yield key;\n }\n }\n }\n\n /**\n * Static method for initializing the class.\n * Preforms a check to see if the directory exists, and if not, creates it.\n * @param path Path to the directory.\n * @returns Promise that resolves to an instance of the class.\n */\n static async fromPath(rootPath: string): Promise<LocalFileStore> {\n try {\n // Verifies the directory exists at the provided path, and that it is readable and writable.\n await fs.access(rootPath, fs.constants.R_OK | fs.constants.W_OK);\n } catch {\n try {\n // Directory does not exist, create it.\n await fs.mkdir(rootPath, { recursive: true });\n } catch (error) {\n throw new Error(\n `An error occurred creating directory at: ${rootPath}.\\nError: ${JSON.stringify(\n error\n )}`\n );\n }\n }\n\n return new this({ rootPath });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,iBAAb,cAAoC,UAA8B;CAChE,eAAe,CAAC,aAAa,UAAU;CAEvC;CAEA,YAAY,QAA8B;AACxC,QAAM,OAAO;AACb,OAAK,WAAW,OAAO;;;;;;;CAQzB,MAAc,cAAc,KAA8C;AAExE,MAAI,CAAC,sBAAsB,KAAK,IAAI,CAClC,OAAM,IAAI,MACR,oGACD;AAEH,MAAI;GACF,MAAM,cAAc,MAAMA,KAAG,SAAS,KAAK,YAAY,IAAI,CAAC;AAC5D,OAAI,CAAC,YACH;AAEF,UAAO;WAEA,GAAQ;AAEf,OAAI,UAAU,KAAK,EAAE,SAAS,SAC5B;AAEF,SAAM,IAAI,MACR,2CACE,KAAK,SACN,YAAY,KAAK,UAAU,EAAE,GAC/B;;;;;;;CAQL,MAAc,eAAe,SAAqB,KAAa;AAC7D,MAAI;AACF,SAAMA,KAAG,UAAU,KAAK,YAAY,IAAI,EAAE,QAAQ;WAC3C,OAAO;AACd,SAAM,IAAI,MACR,+BAA+B,KAAK,YAClC,IACD,CAAC,YAAY,KAAK,UAAU,MAAM,GACpC;;;;;;;CAQL,AAAQ,YAAY,KAAqB;AACvC,MAAI;GACF,MAAM,eAAe,GAAG,IAAI;AAG5B,OAAI,CAAC,sBAAsB,KAAK,IAAI,CAClC,OAAM,IAAI,MAAM,8BAA8B,MAAM;GAGtD,MAAM,WAAWC,OAAK,QAAQ,KAAK,UAAU,aAAa;GAC1D,MAAM,aAAaA,OAAK,QAAQ,KAAK,SAAS;AAE9C,OAAI,CAAC,SAAS,WAAW,WAAW,CAClC,OAAM,IAAI,MACR,gBAAgB,IAAI,wDACJ,KAAK,SAAS,eAAe,WAC9C;AAGH,UAAO;WACA,GAAG;AACV,SAAM,IAAI,MACR,oCAAoC,IAAI,YAAY,OAAO,EAAE,GAC9D;;;;;;;;CASL,MAAM,KAAK,MAAgB;EACzB,MAAM,SAAqC,EAAE;AAC7C,OAAK,MAAM,OAAO,MAAM;GACtB,MAAM,cAAc,MAAM,KAAK,cAAc,IAAI;AACjD,UAAO,KAAK,YAAY;;AAE1B,SAAO;;;;;;;CAQT,MAAM,KAAK,eAAsD;AAC/D,QAAM,QAAQ,IACZ,cAAc,KAAK,CAAC,KAAK,WAAW,KAAK,eAAe,OAAO,IAAI,CAAC,CACrE;;;;;;;CAQH,MAAM,QAAQ,MAA+B;AAC3C,QAAM,QAAQ,IAAI,KAAK,KAAK,QAAQD,KAAG,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC;;;;;;;;CASxE,OAAO,UAAU,QAAyC;EAExD,MAAM,WADW,MAAMA,KAAG,QAAQ,KAAK,SAAS,EACvB,KAAK,SAAS,KAAK,QAAQ,QAAQ,GAAG,CAAC;AAChE,OAAK,MAAM,OAAO,QAChB,KAAI,WAAW,UAAa,IAAI,WAAW,OAAO,CAChD,OAAM;;;;;;;;CAWZ,aAAa,SAAS,UAA2C;AAC/D,MAAI;AAEF,SAAMA,KAAG,OAAO,UAAUA,KAAG,UAAU,OAAOA,KAAG,UAAU,KAAK;UAC1D;AACN,OAAI;AAEF,UAAMA,KAAG,MAAM,UAAU,EAAE,WAAW,MAAM,CAAC;YACtC,OAAO;AACd,UAAM,IAAI,MACR,4CAA4C,SAAS,YAAY,KAAK,UACpE,MACD,GACF;;;AAIL,SAAO,IAAI,KAAK,EAAE,UAAU,CAAC"}
1
+ {"version":3,"file":"file_system.js","names":["fs","path"],"sources":["../../src/storage/file_system.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { BaseStore } from \"@langchain/core/stores\";\n\n/**\n * File system implementation of the BaseStore using a dictionary. Used for\n * storing key-value pairs in the file system.\n * @example\n * ```typescript\n * const store = await LocalFileStore.fromPath(\"./messages\");\n * await store.mset(\n * Array.from({ length: 5 }).map((_, index) => [\n * `message:id:${index}`,\n * new TextEncoder().encode(\n * JSON.stringify(\n * index % 2 === 0\n * ? new AIMessage(\"ai stuff...\")\n * : new HumanMessage(\"human stuff...\"),\n * ),\n * ),\n * ]),\n * );\n * const retrievedMessages = await store.mget([\"message:id:0\", \"message:id:1\"]);\n * console.log(retrievedMessages.map((v) => new TextDecoder().decode(v)));\n * for await (const key of store.yieldKeys(\"message:id:\")) {\n * await store.mdelete([key]);\n * }\n * ```\n *\n * @security **Security Notice** This file store\n * can alter any text file in the provided directory and any subfolders.\n * Make sure that the path you specify when initializing the store is free\n * of other files.\n */\nexport class LocalFileStore extends BaseStore<string, Uint8Array> {\n lc_namespace = [\"langchain\", \"storage\"];\n\n rootPath: string;\n\n constructor(fields: { rootPath: string }) {\n super(fields);\n this.rootPath = fields.rootPath;\n }\n\n /**\n * Read and parse the file at the given path.\n * @param key The key to read the file for.\n * @returns Promise that resolves to the parsed file content.\n */\n private async getParsedFile(key: string): Promise<Uint8Array | undefined> {\n // Validate the key to prevent path traversal\n if (!/^[a-zA-Z0-9_\\-:.]+$/.test(key)) {\n throw new Error(\n \"Invalid key. Only alphanumeric characters, underscores, hyphens, colons, and periods are allowed.\"\n );\n }\n try {\n const fileContent = await fs.readFile(this.getFullPath(key));\n if (!fileContent) {\n return undefined;\n }\n return fileContent;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (e: any) {\n // File does not exist yet.\n if (\"code\" in e && e.code === \"ENOENT\") {\n return undefined;\n }\n throw new Error(\n `Error reading and parsing file at path: ${\n this.rootPath\n }.\\nError: ${JSON.stringify(e)}`\n );\n }\n }\n\n /**\n * Writes the given key-value pairs to the file at the given path.\n * @param fileContent An object with the key-value pairs to be written to the file.\n */\n private async setFileContent(content: Uint8Array, key: string) {\n try {\n await fs.writeFile(this.getFullPath(key), content);\n } catch (error) {\n throw new Error(\n `Error writing file at path: ${this.getFullPath(\n key\n )}.\\nError: ${JSON.stringify(error)}`\n );\n }\n }\n\n /**\n * Returns the full path of the file where the value of the given key is stored.\n * @param key the key to get the full path for\n */\n private getFullPath(key: string): string {\n try {\n const keyAsTxtFile = `${key}.txt`;\n\n // Validate the key to prevent path traversal\n if (!/^[a-zA-Z0-9_.\\-/]+$/.test(key)) {\n throw new Error(`Invalid characters in key: ${key}`);\n }\n\n const fullPath = path.resolve(this.rootPath, keyAsTxtFile);\n const commonPath = path.resolve(this.rootPath);\n\n if (!fullPath.startsWith(commonPath)) {\n throw new Error(\n `Invalid key: ${key}. Key should be relative to the root path. ` +\n `Root path: ${this.rootPath}, Full path: ${fullPath}`\n );\n }\n\n return fullPath;\n } catch (e) {\n throw new Error(\n `Error getting full path for key: ${key}.\\nError: ${String(e)}`\n );\n }\n }\n\n /**\n * Retrieves the values associated with the given keys from the store.\n * @param keys Keys to retrieve values for.\n * @returns Array of values associated with the given keys.\n */\n async mget(keys: string[]) {\n const values: (Uint8Array | undefined)[] = [];\n for (const key of keys) {\n const fileContent = await this.getParsedFile(key);\n values.push(fileContent);\n }\n return values;\n }\n\n /**\n * Sets the values for the given keys in the store.\n * @param keyValuePairs Array of key-value pairs to set in the store.\n * @returns Promise that resolves when all key-value pairs have been set.\n */\n async mset(keyValuePairs: [string, Uint8Array][]): Promise<void> {\n await Promise.all(\n keyValuePairs.map(([key, value]) => this.setFileContent(value, key))\n );\n }\n\n /**\n * Deletes the given keys and their associated values from the store.\n * @param keys Keys to delete from the store.\n * @returns Promise that resolves when all keys have been deleted.\n */\n async mdelete(keys: string[]): Promise<void> {\n await Promise.all(keys.map((key) => fs.unlink(this.getFullPath(key))));\n }\n\n /**\n * Asynchronous generator that yields keys from the store. If a prefix is\n * provided, it only yields keys that start with the prefix.\n * @param prefix Optional prefix to filter keys.\n * @returns AsyncGenerator that yields keys from the store.\n */\n async *yieldKeys(prefix?: string): AsyncGenerator<string> {\n const allFiles = await fs.readdir(this.rootPath);\n const allKeys = allFiles.map((file) => file.replace(\".txt\", \"\"));\n for (const key of allKeys) {\n if (prefix === undefined || key.startsWith(prefix)) {\n yield key;\n }\n }\n }\n\n /**\n * Static method for initializing the class.\n * Preforms a check to see if the directory exists, and if not, creates it.\n * @param path Path to the directory.\n * @returns Promise that resolves to an instance of the class.\n */\n static async fromPath(rootPath: string): Promise<LocalFileStore> {\n try {\n // Verifies the directory exists at the provided path, and that it is readable and writable.\n await fs.access(rootPath, fs.constants.R_OK | fs.constants.W_OK);\n } catch {\n try {\n // Directory does not exist, create it.\n await fs.mkdir(rootPath, { recursive: true });\n } catch (error) {\n throw new Error(\n `An error occurred creating directory at: ${rootPath}.\\nError: ${JSON.stringify(\n error\n )}`\n );\n }\n }\n\n return new this({ rootPath });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,iBAAb,cAAoC,UAA8B;CAChE,eAAe,CAAC,aAAa,UAAU;CAEvC;CAEA,YAAY,QAA8B;AACxC,QAAM,OAAO;AACb,OAAK,WAAW,OAAO;;;;;;;CAQzB,MAAc,cAAc,KAA8C;AAExE,MAAI,CAAC,sBAAsB,KAAK,IAAI,CAClC,OAAM,IAAI,MACR,oGACD;AAEH,MAAI;GACF,MAAM,cAAc,MAAMA,KAAG,SAAS,KAAK,YAAY,IAAI,CAAC;AAC5D,OAAI,CAAC,YACH;AAEF,UAAO;WAEA,GAAQ;AAEf,OAAI,UAAU,KAAK,EAAE,SAAS,SAC5B;AAEF,SAAM,IAAI,MACR,2CACE,KAAK,SACN,YAAY,KAAK,UAAU,EAAE,GAC/B;;;;;;;CAQL,MAAc,eAAe,SAAqB,KAAa;AAC7D,MAAI;AACF,SAAMA,KAAG,UAAU,KAAK,YAAY,IAAI,EAAE,QAAQ;WAC3C,OAAO;AACd,SAAM,IAAI,MACR,+BAA+B,KAAK,YAClC,IACD,CAAC,YAAY,KAAK,UAAU,MAAM,GACpC;;;;;;;CAQL,YAAoB,KAAqB;AACvC,MAAI;GACF,MAAM,eAAe,GAAG,IAAI;AAG5B,OAAI,CAAC,sBAAsB,KAAK,IAAI,CAClC,OAAM,IAAI,MAAM,8BAA8B,MAAM;GAGtD,MAAM,WAAWC,OAAK,QAAQ,KAAK,UAAU,aAAa;GAC1D,MAAM,aAAaA,OAAK,QAAQ,KAAK,SAAS;AAE9C,OAAI,CAAC,SAAS,WAAW,WAAW,CAClC,OAAM,IAAI,MACR,gBAAgB,IAAI,wDACJ,KAAK,SAAS,eAAe,WAC9C;AAGH,UAAO;WACA,GAAG;AACV,SAAM,IAAI,MACR,oCAAoC,IAAI,YAAY,OAAO,EAAE,GAC9D;;;;;;;;CASL,MAAM,KAAK,MAAgB;EACzB,MAAM,SAAqC,EAAE;AAC7C,OAAK,MAAM,OAAO,MAAM;GACtB,MAAM,cAAc,MAAM,KAAK,cAAc,IAAI;AACjD,UAAO,KAAK,YAAY;;AAE1B,SAAO;;;;;;;CAQT,MAAM,KAAK,eAAsD;AAC/D,QAAM,QAAQ,IACZ,cAAc,KAAK,CAAC,KAAK,WAAW,KAAK,eAAe,OAAO,IAAI,CAAC,CACrE;;;;;;;CAQH,MAAM,QAAQ,MAA+B;AAC3C,QAAM,QAAQ,IAAI,KAAK,KAAK,QAAQD,KAAG,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC;;;;;;;;CASxE,OAAO,UAAU,QAAyC;EAExD,MAAM,WADW,MAAMA,KAAG,QAAQ,KAAK,SAAS,EACvB,KAAK,SAAS,KAAK,QAAQ,QAAQ,GAAG,CAAC;AAChE,OAAK,MAAM,OAAO,QAChB,KAAI,WAAW,KAAA,KAAa,IAAI,WAAW,OAAO,CAChD,OAAM;;;;;;;;CAWZ,aAAa,SAAS,UAA2C;AAC/D,MAAI;AAEF,SAAMA,KAAG,OAAO,UAAUA,KAAG,UAAU,OAAOA,KAAG,UAAU,KAAK;UAC1D;AACN,OAAI;AAEF,UAAMA,KAAG,MAAM,UAAU,EAAE,WAAW,MAAM,CAAC;YACtC,OAAO;AACd,UAAM,IAAI,MACR,4CAA4C,SAAS,YAAY,KAAK,UACpE,MACD,GACF;;;AAIL,SAAO,IAAI,KAAK,EAAE,UAAU,CAAC"}
@@ -1,21 +1,20 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
3
3
  let _langchain_core_stores = require("@langchain/core/stores");
4
-
5
4
  //#region src/storage/in_memory.ts
6
5
  var in_memory_exports = /* @__PURE__ */ require_runtime.__exportAll({ InMemoryStore: () => _langchain_core_stores.InMemoryStore });
7
-
8
6
  //#endregion
9
- Object.defineProperty(exports, 'InMemoryStore', {
10
- enumerable: true,
11
- get: function () {
12
- return _langchain_core_stores.InMemoryStore;
13
- }
7
+ Object.defineProperty(exports, "InMemoryStore", {
8
+ enumerable: true,
9
+ get: function() {
10
+ return _langchain_core_stores.InMemoryStore;
11
+ }
14
12
  });
15
- Object.defineProperty(exports, 'in_memory_exports', {
16
- enumerable: true,
17
- get: function () {
18
- return in_memory_exports;
19
- }
13
+ Object.defineProperty(exports, "in_memory_exports", {
14
+ enumerable: true,
15
+ get: function() {
16
+ return in_memory_exports;
17
+ }
20
18
  });
19
+
21
20
  //# sourceMappingURL=in_memory.cjs.map
@@ -1,9 +1,8 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { InMemoryStore } from "@langchain/core/stores";
3
-
4
3
  //#region src/storage/in_memory.ts
5
4
  var in_memory_exports = /* @__PURE__ */ __exportAll({ InMemoryStore: () => InMemoryStore });
6
-
7
5
  //#endregion
8
6
  export { InMemoryStore, in_memory_exports };
7
+
9
8
  //# sourceMappingURL=in_memory.js.map
@@ -1,20 +1,18 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
2
  //#region src/stores/doc/base.ts
5
- var base_exports = /* @__PURE__ */ require_runtime.__exportAll({ Docstore: () => Docstore });
3
+ var base_exports = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__exportAll({ Docstore: () => Docstore });
6
4
  /**
7
5
  * Abstract class for a document store. All document stores should extend
8
6
  * this class.
9
7
  */
10
8
  var Docstore = class {};
11
-
12
9
  //#endregion
13
10
  exports.Docstore = Docstore;
14
- Object.defineProperty(exports, 'base_exports', {
15
- enumerable: true,
16
- get: function () {
17
- return base_exports;
18
- }
11
+ Object.defineProperty(exports, "base_exports", {
12
+ enumerable: true,
13
+ get: function() {
14
+ return base_exports;
15
+ }
19
16
  });
17
+
20
18
  //# sourceMappingURL=base.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.cjs","names":[],"sources":["../../../src/stores/doc/base.ts"],"sourcesContent":["import { type Document } from \"@langchain/core/documents\";\n\n/**\n * Abstract class for a document store. All document stores should extend\n * this class.\n */\nexport abstract class Docstore {\n abstract search(search: string): Promise<Document>;\n\n abstract add(texts: Record<string, Document>): Promise<void>;\n}\n"],"mappings":";;;;;;;;;AAMA,IAAsB,WAAtB,MAA+B"}
1
+ {"version":3,"file":"base.cjs","names":[],"sources":["../../../src/stores/doc/base.ts"],"sourcesContent":["import { type Document } from \"@langchain/core/documents\";\n\n/**\n * Abstract class for a document store. All document stores should extend\n * this class.\n */\nexport abstract class Docstore {\n abstract search(search: string): Promise<Document>;\n\n abstract add(texts: Record<string, Document>): Promise<void>;\n}\n"],"mappings":";;;;;;;AAMA,IAAsB,WAAtB,MAA+B"}
@@ -1,5 +1,4 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
-
3
2
  //#region src/stores/doc/base.ts
4
3
  var base_exports = /* @__PURE__ */ __exportAll({ Docstore: () => Docstore });
5
4
  /**
@@ -7,7 +6,7 @@ var base_exports = /* @__PURE__ */ __exportAll({ Docstore: () => Docstore });
7
6
  * this class.
8
7
  */
9
8
  var Docstore = class {};
10
-
11
9
  //#endregion
12
10
  export { Docstore, base_exports };
11
+
13
12
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":[],"sources":["../../../src/stores/doc/base.ts"],"sourcesContent":["import { type Document } from \"@langchain/core/documents\";\n\n/**\n * Abstract class for a document store. All document stores should extend\n * this class.\n */\nexport abstract class Docstore {\n abstract search(search: string): Promise<Document>;\n\n abstract add(texts: Record<string, Document>): Promise<void>;\n}\n"],"mappings":";;;;;;;;AAMA,IAAsB,WAAtB,MAA+B"}
1
+ {"version":3,"file":"base.js","names":[],"sources":["../../../src/stores/doc/base.ts"],"sourcesContent":["import { type Document } from \"@langchain/core/documents\";\n\n/**\n * Abstract class for a document store. All document stores should extend\n * this class.\n */\nexport abstract class Docstore {\n abstract search(search: string): Promise<Document>;\n\n abstract add(texts: Record<string, Document>): Promise<void>;\n}\n"],"mappings":";;;;;;;AAMA,IAAsB,WAAtB,MAA+B"}
@@ -1,7 +1,6 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
- const require_stores_doc_base = require('./base.cjs');
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
3
+ const require_stores_doc_base = require("./base.cjs");
5
4
  //#region src/stores/doc/in_memory.ts
6
5
  var in_memory_exports = /* @__PURE__ */ require_runtime.__exportAll({
7
6
  InMemoryDocstore: () => InMemoryDocstore,
@@ -81,14 +80,14 @@ var SynchronousInMemoryDocstore = class {
81
80
  for (const [key, value] of Object.entries(texts)) this._docs.set(key, value);
82
81
  }
83
82
  };
84
-
85
83
  //#endregion
86
84
  exports.InMemoryDocstore = InMemoryDocstore;
87
85
  exports.SynchronousInMemoryDocstore = SynchronousInMemoryDocstore;
88
- Object.defineProperty(exports, 'in_memory_exports', {
89
- enumerable: true,
90
- get: function () {
91
- return in_memory_exports;
92
- }
86
+ Object.defineProperty(exports, "in_memory_exports", {
87
+ enumerable: true,
88
+ get: function() {
89
+ return in_memory_exports;
90
+ }
93
91
  });
92
+
94
93
  //# sourceMappingURL=in_memory.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"in_memory.cjs","names":["Docstore"],"sources":["../../../src/stores/doc/in_memory.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { BaseStoreInterface } from \"@langchain/core/stores\";\nimport { Docstore } from \"./base.js\";\n\n/**\n * Class for storing and retrieving documents in memory asynchronously.\n * Extends the Docstore class.\n */\nexport class InMemoryDocstore\n extends Docstore\n implements BaseStoreInterface<string, Document>\n{\n _docs: Map<string, Document>;\n\n constructor(docs?: Map<string, Document>) {\n super();\n this._docs = docs ?? new Map();\n }\n\n /**\n * Searches for a document in the store based on its ID.\n * @param search The ID of the document to search for.\n * @returns The document with the given ID.\n */\n async search(search: string): Promise<Document> {\n const result = this._docs.get(search);\n if (!result) {\n throw new Error(`ID ${search} not found.`);\n } else {\n return result;\n }\n }\n\n /**\n * Adds new documents to the store.\n * @param texts An object where the keys are document IDs and the values are the documents themselves.\n * @returns Void\n */\n async add(texts: Record<string, Document>): Promise<void> {\n const keys = [...this._docs.keys()];\n const overlapping = Object.keys(texts).filter((x) => keys.includes(x));\n\n if (overlapping.length > 0) {\n throw new Error(`Tried to add ids that already exist: ${overlapping}`);\n }\n\n for (const [key, value] of Object.entries(texts)) {\n this._docs.set(key, value);\n }\n }\n\n async mget(keys: string[]): Promise<Document[]> {\n return Promise.all(keys.map((key) => this.search(key)));\n }\n\n async mset(keyValuePairs: [string, Document][]): Promise<void> {\n await Promise.all(\n keyValuePairs.map(([key, value]) => this.add({ [key]: value }))\n );\n }\n\n async mdelete(_keys: string[]): Promise<void> {\n throw new Error(\"Not implemented.\");\n }\n\n // eslint-disable-next-line require-yield\n async *yieldKeys(_prefix?: string): AsyncGenerator<string> {\n throw new Error(\"Not implemented\");\n }\n}\n\n/**\n * Class for storing and retrieving documents in memory synchronously.\n */\nexport class SynchronousInMemoryDocstore {\n _docs: Map<string, Document>;\n\n constructor(docs?: Map<string, Document>) {\n this._docs = docs ?? new Map();\n }\n\n /**\n * Searches for a document in the store based on its ID.\n * @param search The ID of the document to search for.\n * @returns The document with the given ID.\n */\n search(search: string): Document {\n const result = this._docs.get(search);\n if (!result) {\n throw new Error(`ID ${search} not found.`);\n } else {\n return result;\n }\n }\n\n /**\n * Adds new documents to the store.\n * @param texts An object where the keys are document IDs and the values are the documents themselves.\n * @returns Void\n */\n add(texts: Record<string, Document>): void {\n const keys = [...this._docs.keys()];\n const overlapping = Object.keys(texts).filter((x) => keys.includes(x));\n\n if (overlapping.length > 0) {\n throw new Error(`Tried to add ids that already exist: ${overlapping}`);\n }\n\n for (const [key, value] of Object.entries(texts)) {\n this._docs.set(key, value);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAQA,IAAa,mBAAb,cACUA,iCAEV;CACE;CAEA,YAAY,MAA8B;AACxC,SAAO;AACP,OAAK,QAAQ,wBAAQ,IAAI,KAAK;;;;;;;CAQhC,MAAM,OAAO,QAAmC;EAC9C,MAAM,SAAS,KAAK,MAAM,IAAI,OAAO;AACrC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,MAAM,OAAO,aAAa;MAE1C,QAAO;;;;;;;CASX,MAAM,IAAI,OAAgD;EACxD,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC;EACnC,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE,CAAC;AAEtE,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MAAM,wCAAwC,cAAc;AAGxE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,MAAK,MAAM,IAAI,KAAK,MAAM;;CAI9B,MAAM,KAAK,MAAqC;AAC9C,SAAO,QAAQ,IAAI,KAAK,KAAK,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC;;CAGzD,MAAM,KAAK,eAAoD;AAC7D,QAAM,QAAQ,IACZ,cAAc,KAAK,CAAC,KAAK,WAAW,KAAK,IAAI,GAAG,MAAM,OAAO,CAAC,CAAC,CAChE;;CAGH,MAAM,QAAQ,OAAgC;AAC5C,QAAM,IAAI,MAAM,mBAAmB;;CAIrC,OAAO,UAAU,SAA0C;AACzD,QAAM,IAAI,MAAM,kBAAkB;;;;;;AAOtC,IAAa,8BAAb,MAAyC;CACvC;CAEA,YAAY,MAA8B;AACxC,OAAK,QAAQ,wBAAQ,IAAI,KAAK;;;;;;;CAQhC,OAAO,QAA0B;EAC/B,MAAM,SAAS,KAAK,MAAM,IAAI,OAAO;AACrC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,MAAM,OAAO,aAAa;MAE1C,QAAO;;;;;;;CASX,IAAI,OAAuC;EACzC,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC;EACnC,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE,CAAC;AAEtE,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MAAM,wCAAwC,cAAc;AAGxE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,MAAK,MAAM,IAAI,KAAK,MAAM"}
1
+ {"version":3,"file":"in_memory.cjs","names":["Docstore"],"sources":["../../../src/stores/doc/in_memory.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { BaseStoreInterface } from \"@langchain/core/stores\";\nimport { Docstore } from \"./base.js\";\n\n/**\n * Class for storing and retrieving documents in memory asynchronously.\n * Extends the Docstore class.\n */\nexport class InMemoryDocstore\n extends Docstore\n implements BaseStoreInterface<string, Document>\n{\n _docs: Map<string, Document>;\n\n constructor(docs?: Map<string, Document>) {\n super();\n this._docs = docs ?? new Map();\n }\n\n /**\n * Searches for a document in the store based on its ID.\n * @param search The ID of the document to search for.\n * @returns The document with the given ID.\n */\n async search(search: string): Promise<Document> {\n const result = this._docs.get(search);\n if (!result) {\n throw new Error(`ID ${search} not found.`);\n } else {\n return result;\n }\n }\n\n /**\n * Adds new documents to the store.\n * @param texts An object where the keys are document IDs and the values are the documents themselves.\n * @returns Void\n */\n async add(texts: Record<string, Document>): Promise<void> {\n const keys = [...this._docs.keys()];\n const overlapping = Object.keys(texts).filter((x) => keys.includes(x));\n\n if (overlapping.length > 0) {\n throw new Error(`Tried to add ids that already exist: ${overlapping}`);\n }\n\n for (const [key, value] of Object.entries(texts)) {\n this._docs.set(key, value);\n }\n }\n\n async mget(keys: string[]): Promise<Document[]> {\n return Promise.all(keys.map((key) => this.search(key)));\n }\n\n async mset(keyValuePairs: [string, Document][]): Promise<void> {\n await Promise.all(\n keyValuePairs.map(([key, value]) => this.add({ [key]: value }))\n );\n }\n\n async mdelete(_keys: string[]): Promise<void> {\n throw new Error(\"Not implemented.\");\n }\n\n // eslint-disable-next-line require-yield\n async *yieldKeys(_prefix?: string): AsyncGenerator<string> {\n throw new Error(\"Not implemented\");\n }\n}\n\n/**\n * Class for storing and retrieving documents in memory synchronously.\n */\nexport class SynchronousInMemoryDocstore {\n _docs: Map<string, Document>;\n\n constructor(docs?: Map<string, Document>) {\n this._docs = docs ?? new Map();\n }\n\n /**\n * Searches for a document in the store based on its ID.\n * @param search The ID of the document to search for.\n * @returns The document with the given ID.\n */\n search(search: string): Document {\n const result = this._docs.get(search);\n if (!result) {\n throw new Error(`ID ${search} not found.`);\n } else {\n return result;\n }\n }\n\n /**\n * Adds new documents to the store.\n * @param texts An object where the keys are document IDs and the values are the documents themselves.\n * @returns Void\n */\n add(texts: Record<string, Document>): void {\n const keys = [...this._docs.keys()];\n const overlapping = Object.keys(texts).filter((x) => keys.includes(x));\n\n if (overlapping.length > 0) {\n throw new Error(`Tried to add ids that already exist: ${overlapping}`);\n }\n\n for (const [key, value] of Object.entries(texts)) {\n this._docs.set(key, value);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAQA,IAAa,mBAAb,cACUA,wBAAAA,SAEV;CACE;CAEA,YAAY,MAA8B;AACxC,SAAO;AACP,OAAK,QAAQ,wBAAQ,IAAI,KAAK;;;;;;;CAQhC,MAAM,OAAO,QAAmC;EAC9C,MAAM,SAAS,KAAK,MAAM,IAAI,OAAO;AACrC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,MAAM,OAAO,aAAa;MAE1C,QAAO;;;;;;;CASX,MAAM,IAAI,OAAgD;EACxD,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC;EACnC,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE,CAAC;AAEtE,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MAAM,wCAAwC,cAAc;AAGxE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,MAAK,MAAM,IAAI,KAAK,MAAM;;CAI9B,MAAM,KAAK,MAAqC;AAC9C,SAAO,QAAQ,IAAI,KAAK,KAAK,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC;;CAGzD,MAAM,KAAK,eAAoD;AAC7D,QAAM,QAAQ,IACZ,cAAc,KAAK,CAAC,KAAK,WAAW,KAAK,IAAI,GAAG,MAAM,OAAO,CAAC,CAAC,CAChE;;CAGH,MAAM,QAAQ,OAAgC;AAC5C,QAAM,IAAI,MAAM,mBAAmB;;CAIrC,OAAO,UAAU,SAA0C;AACzD,QAAM,IAAI,MAAM,kBAAkB;;;;;;AAOtC,IAAa,8BAAb,MAAyC;CACvC;CAEA,YAAY,MAA8B;AACxC,OAAK,QAAQ,wBAAQ,IAAI,KAAK;;;;;;;CAQhC,OAAO,QAA0B;EAC/B,MAAM,SAAS,KAAK,MAAM,IAAI,OAAO;AACrC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,MAAM,OAAO,aAAa;MAE1C,QAAO;;;;;;;CASX,IAAI,OAAuC;EACzC,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC;EACnC,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE,CAAC;AAEtE,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MAAM,wCAAwC,cAAc;AAGxE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,MAAK,MAAM,IAAI,KAAK,MAAM"}
@@ -1,6 +1,5 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
2
  import { Docstore } from "./base.js";
3
-
4
3
  //#region src/stores/doc/in_memory.ts
5
4
  var in_memory_exports = /* @__PURE__ */ __exportAll({
6
5
  InMemoryDocstore: () => InMemoryDocstore,
@@ -80,7 +79,7 @@ var SynchronousInMemoryDocstore = class {
80
79
  for (const [key, value] of Object.entries(texts)) this._docs.set(key, value);
81
80
  }
82
81
  };
83
-
84
82
  //#endregion
85
83
  export { InMemoryDocstore, SynchronousInMemoryDocstore, in_memory_exports };
84
+
86
85
  //# sourceMappingURL=in_memory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"in_memory.js","names":[],"sources":["../../../src/stores/doc/in_memory.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { BaseStoreInterface } from \"@langchain/core/stores\";\nimport { Docstore } from \"./base.js\";\n\n/**\n * Class for storing and retrieving documents in memory asynchronously.\n * Extends the Docstore class.\n */\nexport class InMemoryDocstore\n extends Docstore\n implements BaseStoreInterface<string, Document>\n{\n _docs: Map<string, Document>;\n\n constructor(docs?: Map<string, Document>) {\n super();\n this._docs = docs ?? new Map();\n }\n\n /**\n * Searches for a document in the store based on its ID.\n * @param search The ID of the document to search for.\n * @returns The document with the given ID.\n */\n async search(search: string): Promise<Document> {\n const result = this._docs.get(search);\n if (!result) {\n throw new Error(`ID ${search} not found.`);\n } else {\n return result;\n }\n }\n\n /**\n * Adds new documents to the store.\n * @param texts An object where the keys are document IDs and the values are the documents themselves.\n * @returns Void\n */\n async add(texts: Record<string, Document>): Promise<void> {\n const keys = [...this._docs.keys()];\n const overlapping = Object.keys(texts).filter((x) => keys.includes(x));\n\n if (overlapping.length > 0) {\n throw new Error(`Tried to add ids that already exist: ${overlapping}`);\n }\n\n for (const [key, value] of Object.entries(texts)) {\n this._docs.set(key, value);\n }\n }\n\n async mget(keys: string[]): Promise<Document[]> {\n return Promise.all(keys.map((key) => this.search(key)));\n }\n\n async mset(keyValuePairs: [string, Document][]): Promise<void> {\n await Promise.all(\n keyValuePairs.map(([key, value]) => this.add({ [key]: value }))\n );\n }\n\n async mdelete(_keys: string[]): Promise<void> {\n throw new Error(\"Not implemented.\");\n }\n\n // eslint-disable-next-line require-yield\n async *yieldKeys(_prefix?: string): AsyncGenerator<string> {\n throw new Error(\"Not implemented\");\n }\n}\n\n/**\n * Class for storing and retrieving documents in memory synchronously.\n */\nexport class SynchronousInMemoryDocstore {\n _docs: Map<string, Document>;\n\n constructor(docs?: Map<string, Document>) {\n this._docs = docs ?? new Map();\n }\n\n /**\n * Searches for a document in the store based on its ID.\n * @param search The ID of the document to search for.\n * @returns The document with the given ID.\n */\n search(search: string): Document {\n const result = this._docs.get(search);\n if (!result) {\n throw new Error(`ID ${search} not found.`);\n } else {\n return result;\n }\n }\n\n /**\n * Adds new documents to the store.\n * @param texts An object where the keys are document IDs and the values are the documents themselves.\n * @returns Void\n */\n add(texts: Record<string, Document>): void {\n const keys = [...this._docs.keys()];\n const overlapping = Object.keys(texts).filter((x) => keys.includes(x));\n\n if (overlapping.length > 0) {\n throw new Error(`Tried to add ids that already exist: ${overlapping}`);\n }\n\n for (const [key, value] of Object.entries(texts)) {\n this._docs.set(key, value);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAQA,IAAa,mBAAb,cACU,SAEV;CACE;CAEA,YAAY,MAA8B;AACxC,SAAO;AACP,OAAK,QAAQ,wBAAQ,IAAI,KAAK;;;;;;;CAQhC,MAAM,OAAO,QAAmC;EAC9C,MAAM,SAAS,KAAK,MAAM,IAAI,OAAO;AACrC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,MAAM,OAAO,aAAa;MAE1C,QAAO;;;;;;;CASX,MAAM,IAAI,OAAgD;EACxD,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC;EACnC,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE,CAAC;AAEtE,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MAAM,wCAAwC,cAAc;AAGxE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,MAAK,MAAM,IAAI,KAAK,MAAM;;CAI9B,MAAM,KAAK,MAAqC;AAC9C,SAAO,QAAQ,IAAI,KAAK,KAAK,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC;;CAGzD,MAAM,KAAK,eAAoD;AAC7D,QAAM,QAAQ,IACZ,cAAc,KAAK,CAAC,KAAK,WAAW,KAAK,IAAI,GAAG,MAAM,OAAO,CAAC,CAAC,CAChE;;CAGH,MAAM,QAAQ,OAAgC;AAC5C,QAAM,IAAI,MAAM,mBAAmB;;CAIrC,OAAO,UAAU,SAA0C;AACzD,QAAM,IAAI,MAAM,kBAAkB;;;;;;AAOtC,IAAa,8BAAb,MAAyC;CACvC;CAEA,YAAY,MAA8B;AACxC,OAAK,QAAQ,wBAAQ,IAAI,KAAK;;;;;;;CAQhC,OAAO,QAA0B;EAC/B,MAAM,SAAS,KAAK,MAAM,IAAI,OAAO;AACrC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,MAAM,OAAO,aAAa;MAE1C,QAAO;;;;;;;CASX,IAAI,OAAuC;EACzC,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC;EACnC,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE,CAAC;AAEtE,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MAAM,wCAAwC,cAAc;AAGxE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,MAAK,MAAM,IAAI,KAAK,MAAM"}
1
+ {"version":3,"file":"in_memory.js","names":[],"sources":["../../../src/stores/doc/in_memory.ts"],"sourcesContent":["import { Document } from \"@langchain/core/documents\";\nimport { BaseStoreInterface } from \"@langchain/core/stores\";\nimport { Docstore } from \"./base.js\";\n\n/**\n * Class for storing and retrieving documents in memory asynchronously.\n * Extends the Docstore class.\n */\nexport class InMemoryDocstore\n extends Docstore\n implements BaseStoreInterface<string, Document>\n{\n _docs: Map<string, Document>;\n\n constructor(docs?: Map<string, Document>) {\n super();\n this._docs = docs ?? new Map();\n }\n\n /**\n * Searches for a document in the store based on its ID.\n * @param search The ID of the document to search for.\n * @returns The document with the given ID.\n */\n async search(search: string): Promise<Document> {\n const result = this._docs.get(search);\n if (!result) {\n throw new Error(`ID ${search} not found.`);\n } else {\n return result;\n }\n }\n\n /**\n * Adds new documents to the store.\n * @param texts An object where the keys are document IDs and the values are the documents themselves.\n * @returns Void\n */\n async add(texts: Record<string, Document>): Promise<void> {\n const keys = [...this._docs.keys()];\n const overlapping = Object.keys(texts).filter((x) => keys.includes(x));\n\n if (overlapping.length > 0) {\n throw new Error(`Tried to add ids that already exist: ${overlapping}`);\n }\n\n for (const [key, value] of Object.entries(texts)) {\n this._docs.set(key, value);\n }\n }\n\n async mget(keys: string[]): Promise<Document[]> {\n return Promise.all(keys.map((key) => this.search(key)));\n }\n\n async mset(keyValuePairs: [string, Document][]): Promise<void> {\n await Promise.all(\n keyValuePairs.map(([key, value]) => this.add({ [key]: value }))\n );\n }\n\n async mdelete(_keys: string[]): Promise<void> {\n throw new Error(\"Not implemented.\");\n }\n\n // eslint-disable-next-line require-yield\n async *yieldKeys(_prefix?: string): AsyncGenerator<string> {\n throw new Error(\"Not implemented\");\n }\n}\n\n/**\n * Class for storing and retrieving documents in memory synchronously.\n */\nexport class SynchronousInMemoryDocstore {\n _docs: Map<string, Document>;\n\n constructor(docs?: Map<string, Document>) {\n this._docs = docs ?? new Map();\n }\n\n /**\n * Searches for a document in the store based on its ID.\n * @param search The ID of the document to search for.\n * @returns The document with the given ID.\n */\n search(search: string): Document {\n const result = this._docs.get(search);\n if (!result) {\n throw new Error(`ID ${search} not found.`);\n } else {\n return result;\n }\n }\n\n /**\n * Adds new documents to the store.\n * @param texts An object where the keys are document IDs and the values are the documents themselves.\n * @returns Void\n */\n add(texts: Record<string, Document>): void {\n const keys = [...this._docs.keys()];\n const overlapping = Object.keys(texts).filter((x) => keys.includes(x));\n\n if (overlapping.length > 0) {\n throw new Error(`Tried to add ids that already exist: ${overlapping}`);\n }\n\n for (const [key, value] of Object.entries(texts)) {\n this._docs.set(key, value);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAQA,IAAa,mBAAb,cACU,SAEV;CACE;CAEA,YAAY,MAA8B;AACxC,SAAO;AACP,OAAK,QAAQ,wBAAQ,IAAI,KAAK;;;;;;;CAQhC,MAAM,OAAO,QAAmC;EAC9C,MAAM,SAAS,KAAK,MAAM,IAAI,OAAO;AACrC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,MAAM,OAAO,aAAa;MAE1C,QAAO;;;;;;;CASX,MAAM,IAAI,OAAgD;EACxD,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC;EACnC,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE,CAAC;AAEtE,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MAAM,wCAAwC,cAAc;AAGxE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,MAAK,MAAM,IAAI,KAAK,MAAM;;CAI9B,MAAM,KAAK,MAAqC;AAC9C,SAAO,QAAQ,IAAI,KAAK,KAAK,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC;;CAGzD,MAAM,KAAK,eAAoD;AAC7D,QAAM,QAAQ,IACZ,cAAc,KAAK,CAAC,KAAK,WAAW,KAAK,IAAI,GAAG,MAAM,OAAO,CAAC,CAAC,CAChE;;CAGH,MAAM,QAAQ,OAAgC;AAC5C,QAAM,IAAI,MAAM,mBAAmB;;CAIrC,OAAO,UAAU,SAA0C;AACzD,QAAM,IAAI,MAAM,kBAAkB;;;;;;AAOtC,IAAa,8BAAb,MAAyC;CACvC;CAEA,YAAY,MAA8B;AACxC,OAAK,QAAQ,wBAAQ,IAAI,KAAK;;;;;;;CAQhC,OAAO,QAA0B;EAC/B,MAAM,SAAS,KAAK,MAAM,IAAI,OAAO;AACrC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,MAAM,OAAO,aAAa;MAE1C,QAAO;;;;;;;CASX,IAAI,OAAuC;EACzC,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,MAAM,CAAC;EACnC,MAAM,cAAc,OAAO,KAAK,MAAM,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE,CAAC;AAEtE,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MAAM,wCAAwC,cAAc;AAGxE,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,MAAK,MAAM,IAAI,KAAK,MAAM"}
@@ -1,13 +1,12 @@
1
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
1
+ require("../../_virtual/_rolldown/runtime.cjs");
2
2
  let _langchain_core_load_serializable = require("@langchain/core/load/serializable");
3
-
4
3
  //#region src/stores/file/base.ts
5
4
  /**
6
5
  * Base class for all file stores. All file stores should extend this
7
6
  * class.
8
7
  */
9
8
  var BaseFileStore = class extends _langchain_core_load_serializable.Serializable {};
10
-
11
9
  //#endregion
12
10
  exports.BaseFileStore = BaseFileStore;
11
+
13
12
  //# sourceMappingURL=base.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.cjs","names":["Serializable"],"sources":["../../../src/stores/file/base.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n\n/**\n * Base class for all file stores. All file stores should extend this\n * class.\n */\nexport abstract class BaseFileStore extends Serializable {\n abstract readFile(path: string): Promise<string>;\n\n abstract writeFile(path: string, contents: string): Promise<void>;\n}\n"],"mappings":";;;;;;;;AAMA,IAAsB,gBAAtB,cAA4CA,+CAAa"}
1
+ {"version":3,"file":"base.cjs","names":["Serializable"],"sources":["../../../src/stores/file/base.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n\n/**\n * Base class for all file stores. All file stores should extend this\n * class.\n */\nexport abstract class BaseFileStore extends Serializable {\n abstract readFile(path: string): Promise<string>;\n\n abstract writeFile(path: string, contents: string): Promise<void>;\n}\n"],"mappings":";;;;;;;AAMA,IAAsB,gBAAtB,cAA4CA,kCAAAA,aAAa"}
@@ -1,12 +1,11 @@
1
1
  import { Serializable } from "@langchain/core/load/serializable";
2
-
3
2
  //#region src/stores/file/base.ts
4
3
  /**
5
4
  * Base class for all file stores. All file stores should extend this
6
5
  * class.
7
6
  */
8
7
  var BaseFileStore = class extends Serializable {};
9
-
10
8
  //#endregion
11
9
  export { BaseFileStore };
10
+
12
11
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":[],"sources":["../../../src/stores/file/base.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n\n/**\n * Base class for all file stores. All file stores should extend this\n * class.\n */\nexport abstract class BaseFileStore extends Serializable {\n abstract readFile(path: string): Promise<string>;\n\n abstract writeFile(path: string, contents: string): Promise<void>;\n}\n"],"mappings":";;;;;;;AAMA,IAAsB,gBAAtB,cAA4C,aAAa"}
1
+ {"version":3,"file":"base.js","names":[],"sources":["../../../src/stores/file/base.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n\n/**\n * Base class for all file stores. All file stores should extend this\n * class.\n */\nexport abstract class BaseFileStore extends Serializable {\n abstract readFile(path: string): Promise<string>;\n\n abstract writeFile(path: string, contents: string): Promise<void>;\n}\n"],"mappings":";;;;;;AAMA,IAAsB,gBAAtB,cAA4C,aAAa"}
@@ -1,7 +1,6 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
- const require_base = require('./base.cjs');
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
3
+ const require_base = require("./base.cjs");
5
4
  //#region src/stores/file/in_memory.ts
6
5
  var in_memory_exports = /* @__PURE__ */ require_runtime.__exportAll({ InMemoryFileStore: () => InMemoryFileStore });
7
6
  /**
@@ -41,13 +40,13 @@ var InMemoryFileStore = class extends require_base.BaseFileStore {
41
40
  this.files.set(path, contents);
42
41
  }
43
42
  };
44
-
45
43
  //#endregion
46
44
  exports.InMemoryFileStore = InMemoryFileStore;
47
- Object.defineProperty(exports, 'in_memory_exports', {
48
- enumerable: true,
49
- get: function () {
50
- return in_memory_exports;
51
- }
45
+ Object.defineProperty(exports, "in_memory_exports", {
46
+ enumerable: true,
47
+ get: function() {
48
+ return in_memory_exports;
49
+ }
52
50
  });
51
+
53
52
  //# sourceMappingURL=in_memory.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"in_memory.cjs","names":["BaseFileStore"],"sources":["../../../src/stores/file/in_memory.ts"],"sourcesContent":["import { BaseFileStore } from \"./base.js\";\n\n/**\n * Class that provides an in-memory file storage system. It extends the\n * BaseFileStore class and implements its readFile and writeFile methods.\n * This class is typically used in scenarios where temporary, in-memory\n * file storage is needed, such as during testing or for caching files in\n * memory for quick access.\n */\nexport class InMemoryFileStore extends BaseFileStore {\n lc_namespace = [\"langchain\", \"stores\", \"file\", \"in_memory\"];\n\n private files: Map<string, string> = new Map();\n\n /**\n * Retrieves the contents of a file given its path. If the file does not\n * exist, it throws an error.\n * @param path The path of the file to read.\n * @returns The contents of the file as a string.\n */\n async readFile(path: string): Promise<string> {\n const contents = this.files.get(path);\n if (contents === undefined) {\n throw new Error(`File not found: ${path}`);\n }\n return contents;\n }\n\n /**\n * Writes contents to a file at a given path. If the file already exists,\n * it overwrites the existing contents.\n * @param path The path of the file to write.\n * @param contents The contents to write to the file.\n * @returns Void\n */\n async writeFile(path: string, contents: string): Promise<void> {\n this.files.set(path, contents);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AASA,IAAa,oBAAb,cAAuCA,2BAAc;CACnD,eAAe;EAAC;EAAa;EAAU;EAAQ;EAAY;CAE3D,AAAQ,wBAA6B,IAAI,KAAK;;;;;;;CAQ9C,MAAM,SAAS,MAA+B;EAC5C,MAAM,WAAW,KAAK,MAAM,IAAI,KAAK;AACrC,MAAI,aAAa,OACf,OAAM,IAAI,MAAM,mBAAmB,OAAO;AAE5C,SAAO;;;;;;;;;CAUT,MAAM,UAAU,MAAc,UAAiC;AAC7D,OAAK,MAAM,IAAI,MAAM,SAAS"}
1
+ {"version":3,"file":"in_memory.cjs","names":["BaseFileStore"],"sources":["../../../src/stores/file/in_memory.ts"],"sourcesContent":["import { BaseFileStore } from \"./base.js\";\n\n/**\n * Class that provides an in-memory file storage system. It extends the\n * BaseFileStore class and implements its readFile and writeFile methods.\n * This class is typically used in scenarios where temporary, in-memory\n * file storage is needed, such as during testing or for caching files in\n * memory for quick access.\n */\nexport class InMemoryFileStore extends BaseFileStore {\n lc_namespace = [\"langchain\", \"stores\", \"file\", \"in_memory\"];\n\n private files: Map<string, string> = new Map();\n\n /**\n * Retrieves the contents of a file given its path. If the file does not\n * exist, it throws an error.\n * @param path The path of the file to read.\n * @returns The contents of the file as a string.\n */\n async readFile(path: string): Promise<string> {\n const contents = this.files.get(path);\n if (contents === undefined) {\n throw new Error(`File not found: ${path}`);\n }\n return contents;\n }\n\n /**\n * Writes contents to a file at a given path. If the file already exists,\n * it overwrites the existing contents.\n * @param path The path of the file to write.\n * @param contents The contents to write to the file.\n * @returns Void\n */\n async writeFile(path: string, contents: string): Promise<void> {\n this.files.set(path, contents);\n }\n}\n"],"mappings":";;;;;;;;;;;;AASA,IAAa,oBAAb,cAAuCA,aAAAA,cAAc;CACnD,eAAe;EAAC;EAAa;EAAU;EAAQ;EAAY;CAE3D,wBAAqC,IAAI,KAAK;;;;;;;CAQ9C,MAAM,SAAS,MAA+B;EAC5C,MAAM,WAAW,KAAK,MAAM,IAAI,KAAK;AACrC,MAAI,aAAa,KAAA,EACf,OAAM,IAAI,MAAM,mBAAmB,OAAO;AAE5C,SAAO;;;;;;;;;CAUT,MAAM,UAAU,MAAc,UAAiC;AAC7D,OAAK,MAAM,IAAI,MAAM,SAAS"}
@@ -1,6 +1,5 @@
1
1
  import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
2
  import { BaseFileStore } from "./base.js";
3
-
4
3
  //#region src/stores/file/in_memory.ts
5
4
  var in_memory_exports = /* @__PURE__ */ __exportAll({ InMemoryFileStore: () => InMemoryFileStore });
6
5
  /**
@@ -40,7 +39,7 @@ var InMemoryFileStore = class extends BaseFileStore {
40
39
  this.files.set(path, contents);
41
40
  }
42
41
  };
43
-
44
42
  //#endregion
45
43
  export { InMemoryFileStore, in_memory_exports };
44
+
46
45
  //# sourceMappingURL=in_memory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"in_memory.js","names":[],"sources":["../../../src/stores/file/in_memory.ts"],"sourcesContent":["import { BaseFileStore } from \"./base.js\";\n\n/**\n * Class that provides an in-memory file storage system. It extends the\n * BaseFileStore class and implements its readFile and writeFile methods.\n * This class is typically used in scenarios where temporary, in-memory\n * file storage is needed, such as during testing or for caching files in\n * memory for quick access.\n */\nexport class InMemoryFileStore extends BaseFileStore {\n lc_namespace = [\"langchain\", \"stores\", \"file\", \"in_memory\"];\n\n private files: Map<string, string> = new Map();\n\n /**\n * Retrieves the contents of a file given its path. If the file does not\n * exist, it throws an error.\n * @param path The path of the file to read.\n * @returns The contents of the file as a string.\n */\n async readFile(path: string): Promise<string> {\n const contents = this.files.get(path);\n if (contents === undefined) {\n throw new Error(`File not found: ${path}`);\n }\n return contents;\n }\n\n /**\n * Writes contents to a file at a given path. If the file already exists,\n * it overwrites the existing contents.\n * @param path The path of the file to write.\n * @param contents The contents to write to the file.\n * @returns Void\n */\n async writeFile(path: string, contents: string): Promise<void> {\n this.files.set(path, contents);\n }\n}\n"],"mappings":";;;;;;;;;;;;AASA,IAAa,oBAAb,cAAuC,cAAc;CACnD,eAAe;EAAC;EAAa;EAAU;EAAQ;EAAY;CAE3D,AAAQ,wBAA6B,IAAI,KAAK;;;;;;;CAQ9C,MAAM,SAAS,MAA+B;EAC5C,MAAM,WAAW,KAAK,MAAM,IAAI,KAAK;AACrC,MAAI,aAAa,OACf,OAAM,IAAI,MAAM,mBAAmB,OAAO;AAE5C,SAAO;;;;;;;;;CAUT,MAAM,UAAU,MAAc,UAAiC;AAC7D,OAAK,MAAM,IAAI,MAAM,SAAS"}
1
+ {"version":3,"file":"in_memory.js","names":[],"sources":["../../../src/stores/file/in_memory.ts"],"sourcesContent":["import { BaseFileStore } from \"./base.js\";\n\n/**\n * Class that provides an in-memory file storage system. It extends the\n * BaseFileStore class and implements its readFile and writeFile methods.\n * This class is typically used in scenarios where temporary, in-memory\n * file storage is needed, such as during testing or for caching files in\n * memory for quick access.\n */\nexport class InMemoryFileStore extends BaseFileStore {\n lc_namespace = [\"langchain\", \"stores\", \"file\", \"in_memory\"];\n\n private files: Map<string, string> = new Map();\n\n /**\n * Retrieves the contents of a file given its path. If the file does not\n * exist, it throws an error.\n * @param path The path of the file to read.\n * @returns The contents of the file as a string.\n */\n async readFile(path: string): Promise<string> {\n const contents = this.files.get(path);\n if (contents === undefined) {\n throw new Error(`File not found: ${path}`);\n }\n return contents;\n }\n\n /**\n * Writes contents to a file at a given path. If the file already exists,\n * it overwrites the existing contents.\n * @param path The path of the file to write.\n * @param contents The contents to write to the file.\n * @returns Void\n */\n async writeFile(path: string, contents: string): Promise<void> {\n this.files.set(path, contents);\n }\n}\n"],"mappings":";;;;;;;;;;;AASA,IAAa,oBAAb,cAAuC,cAAc;CACnD,eAAe;EAAC;EAAa;EAAU;EAAQ;EAAY;CAE3D,wBAAqC,IAAI,KAAK;;;;;;;CAQ9C,MAAM,SAAS,MAA+B;EAC5C,MAAM,WAAW,KAAK,MAAM,IAAI,KAAK;AACrC,MAAI,aAAa,KAAA,EACf,OAAM,IAAI,MAAM,mBAAmB,OAAO;AAE5C,SAAO;;;;;;;;;CAUT,MAAM,UAAU,MAAc,UAAiC;AAC7D,OAAK,MAAM,IAAI,MAAM,SAAS"}
@@ -1,11 +1,10 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
- const require_base = require('./base.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
3
+ const require_base = require("./base.cjs");
4
4
  let node_path = require("node:path");
5
5
  let node_fs_promises = require("node:fs/promises");
6
6
  node_fs_promises = require_runtime.__toESM(node_fs_promises);
7
7
  let node_fs = require("node:fs");
8
-
9
8
  //#region src/stores/file/node.ts
10
9
  var node_exports = /* @__PURE__ */ require_runtime.__exportAll({ NodeFileStore: () => NodeFileStore });
11
10
  /**
@@ -41,13 +40,13 @@ var NodeFileStore = class extends require_base.BaseFileStore {
41
40
  await node_fs_promises.writeFile((0, node_path.join)(this.basePath, path), contents, "utf8");
42
41
  }
43
42
  };
44
-
45
43
  //#endregion
46
44
  exports.NodeFileStore = NodeFileStore;
47
- Object.defineProperty(exports, 'node_exports', {
48
- enumerable: true,
49
- get: function () {
50
- return node_exports;
51
- }
45
+ Object.defineProperty(exports, "node_exports", {
46
+ enumerable: true,
47
+ get: function() {
48
+ return node_exports;
49
+ }
52
50
  });
51
+
53
52
  //# sourceMappingURL=node.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.cjs","names":["BaseFileStore","fs"],"sources":["../../../src/stores/file/node.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { mkdtempSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { BaseFileStore } from \"./base.js\";\n\n/**\n * Specific implementation of the `BaseFileStore` class for Node.js.\n * Provides methods to read and write files in a specific base path.\n */\nexport class NodeFileStore extends BaseFileStore {\n lc_namespace = [\"langchain\", \"stores\", \"file\", \"node\"];\n\n constructor(public basePath: string = mkdtempSync(\"langchain-\")) {\n super();\n }\n\n /**\n * Reads the contents of a file at the given path.\n * @param path Path of the file to read.\n * @returns The contents of the file as a string.\n */\n async readFile(path: string): Promise<string> {\n return await fs.readFile(join(this.basePath, path), \"utf8\");\n }\n\n /**\n * Writes the given contents to a file at the specified path.\n * @param path Path of the file to write to.\n * @param contents Contents to write to the file.\n * @returns Promise that resolves when the file has been written.\n */\n async writeFile(path: string, contents: string): Promise<void> {\n await fs.writeFile(join(this.basePath, path), contents, \"utf8\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAUA,IAAa,gBAAb,cAAmCA,2BAAc;CAC/C,eAAe;EAAC;EAAa;EAAU;EAAQ;EAAO;CAEtD,YAAY,AAAO,oCAA+B,aAAa,EAAE;AAC/D,SAAO;EADU;;;;;;;CASnB,MAAM,SAAS,MAA+B;AAC5C,SAAO,MAAMC,iBAAG,6BAAc,KAAK,UAAU,KAAK,EAAE,OAAO;;;;;;;;CAS7D,MAAM,UAAU,MAAc,UAAiC;AAC7D,QAAMA,iBAAG,8BAAe,KAAK,UAAU,KAAK,EAAE,UAAU,OAAO"}
1
+ {"version":3,"file":"node.cjs","names":["BaseFileStore","fs"],"sources":["../../../src/stores/file/node.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { mkdtempSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { BaseFileStore } from \"./base.js\";\n\n/**\n * Specific implementation of the `BaseFileStore` class for Node.js.\n * Provides methods to read and write files in a specific base path.\n */\nexport class NodeFileStore extends BaseFileStore {\n lc_namespace = [\"langchain\", \"stores\", \"file\", \"node\"];\n\n constructor(public basePath: string = mkdtempSync(\"langchain-\")) {\n super();\n }\n\n /**\n * Reads the contents of a file at the given path.\n * @param path Path of the file to read.\n * @returns The contents of the file as a string.\n */\n async readFile(path: string): Promise<string> {\n return await fs.readFile(join(this.basePath, path), \"utf8\");\n }\n\n /**\n * Writes the given contents to a file at the specified path.\n * @param path Path of the file to write to.\n * @param contents Contents to write to the file.\n * @returns Promise that resolves when the file has been written.\n */\n async writeFile(path: string, contents: string): Promise<void> {\n await fs.writeFile(join(this.basePath, path), contents, \"utf8\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAUA,IAAa,gBAAb,cAAmCA,aAAAA,cAAc;CAC/C,eAAe;EAAC;EAAa;EAAU;EAAQ;EAAO;CAEtD,YAAY,YAAO,GAAA,QAAA,aAA+B,aAAa,EAAE;AAC/D,SAAO;AADU,OAAA,WAAA;;;;;;;CASnB,MAAM,SAAS,MAA+B;AAC5C,SAAO,MAAMC,iBAAG,UAAA,GAAA,UAAA,MAAc,KAAK,UAAU,KAAK,EAAE,OAAO;;;;;;;;CAS7D,MAAM,UAAU,MAAc,UAAiC;AAC7D,QAAMA,iBAAG,WAAA,GAAA,UAAA,MAAe,KAAK,UAAU,KAAK,EAAE,UAAU,OAAO"}
@@ -3,7 +3,6 @@ import { BaseFileStore } from "./base.js";
3
3
  import { join } from "node:path";
4
4
  import * as fs$1 from "node:fs/promises";
5
5
  import { mkdtempSync } from "node:fs";
6
-
7
6
  //#region src/stores/file/node.ts
8
7
  var node_exports = /* @__PURE__ */ __exportAll({ NodeFileStore: () => NodeFileStore });
9
8
  /**
@@ -39,7 +38,7 @@ var NodeFileStore = class extends BaseFileStore {
39
38
  await fs$1.writeFile(join(this.basePath, path), contents, "utf8");
40
39
  }
41
40
  };
42
-
43
41
  //#endregion
44
42
  export { NodeFileStore, node_exports };
43
+
45
44
  //# sourceMappingURL=node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","names":["fs"],"sources":["../../../src/stores/file/node.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { mkdtempSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { BaseFileStore } from \"./base.js\";\n\n/**\n * Specific implementation of the `BaseFileStore` class for Node.js.\n * Provides methods to read and write files in a specific base path.\n */\nexport class NodeFileStore extends BaseFileStore {\n lc_namespace = [\"langchain\", \"stores\", \"file\", \"node\"];\n\n constructor(public basePath: string = mkdtempSync(\"langchain-\")) {\n super();\n }\n\n /**\n * Reads the contents of a file at the given path.\n * @param path Path of the file to read.\n * @returns The contents of the file as a string.\n */\n async readFile(path: string): Promise<string> {\n return await fs.readFile(join(this.basePath, path), \"utf8\");\n }\n\n /**\n * Writes the given contents to a file at the specified path.\n * @param path Path of the file to write to.\n * @param contents Contents to write to the file.\n * @returns Promise that resolves when the file has been written.\n */\n async writeFile(path: string, contents: string): Promise<void> {\n await fs.writeFile(join(this.basePath, path), contents, \"utf8\");\n }\n}\n"],"mappings":";;;;;;;;;;;;AAUA,IAAa,gBAAb,cAAmC,cAAc;CAC/C,eAAe;EAAC;EAAa;EAAU;EAAQ;EAAO;CAEtD,YAAY,AAAO,WAAmB,YAAY,aAAa,EAAE;AAC/D,SAAO;EADU;;;;;;;CASnB,MAAM,SAAS,MAA+B;AAC5C,SAAO,MAAMA,KAAG,SAAS,KAAK,KAAK,UAAU,KAAK,EAAE,OAAO;;;;;;;;CAS7D,MAAM,UAAU,MAAc,UAAiC;AAC7D,QAAMA,KAAG,UAAU,KAAK,KAAK,UAAU,KAAK,EAAE,UAAU,OAAO"}
1
+ {"version":3,"file":"node.js","names":["fs"],"sources":["../../../src/stores/file/node.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport { mkdtempSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { BaseFileStore } from \"./base.js\";\n\n/**\n * Specific implementation of the `BaseFileStore` class for Node.js.\n * Provides methods to read and write files in a specific base path.\n */\nexport class NodeFileStore extends BaseFileStore {\n lc_namespace = [\"langchain\", \"stores\", \"file\", \"node\"];\n\n constructor(public basePath: string = mkdtempSync(\"langchain-\")) {\n super();\n }\n\n /**\n * Reads the contents of a file at the given path.\n * @param path Path of the file to read.\n * @returns The contents of the file as a string.\n */\n async readFile(path: string): Promise<string> {\n return await fs.readFile(join(this.basePath, path), \"utf8\");\n }\n\n /**\n * Writes the given contents to a file at the specified path.\n * @param path Path of the file to write to.\n * @param contents Contents to write to the file.\n * @returns Promise that resolves when the file has been written.\n */\n async writeFile(path: string, contents: string): Promise<void> {\n await fs.writeFile(join(this.basePath, path), contents, \"utf8\");\n }\n}\n"],"mappings":";;;;;;;;;;;AAUA,IAAa,gBAAb,cAAmC,cAAc;CAC/C,eAAe;EAAC;EAAa;EAAU;EAAQ;EAAO;CAEtD,YAAY,WAA0B,YAAY,aAAa,EAAE;AAC/D,SAAO;AADU,OAAA,WAAA;;;;;;;CASnB,MAAM,SAAS,MAA+B;AAC5C,SAAO,MAAMA,KAAG,SAAS,KAAK,KAAK,UAAU,KAAK,EAAE,OAAO;;;;;;;;CAS7D,MAAM,UAAU,MAAc,UAAiC;AAC7D,QAAMA,KAAG,UAAU,KAAK,KAAK,UAAU,KAAK,EAAE,UAAU,OAAO"}
@@ -1,21 +1,20 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
3
3
  let _langchain_core_chat_history = require("@langchain/core/chat_history");
4
-
5
4
  //#region src/stores/message/in_memory.ts
6
5
  var in_memory_exports = /* @__PURE__ */ require_runtime.__exportAll({ ChatMessageHistory: () => _langchain_core_chat_history.InMemoryChatMessageHistory });
7
-
8
6
  //#endregion
9
- Object.defineProperty(exports, 'ChatMessageHistory', {
10
- enumerable: true,
11
- get: function () {
12
- return _langchain_core_chat_history.InMemoryChatMessageHistory;
13
- }
7
+ Object.defineProperty(exports, "ChatMessageHistory", {
8
+ enumerable: true,
9
+ get: function() {
10
+ return _langchain_core_chat_history.InMemoryChatMessageHistory;
11
+ }
14
12
  });
15
- Object.defineProperty(exports, 'in_memory_exports', {
16
- enumerable: true,
17
- get: function () {
18
- return in_memory_exports;
19
- }
13
+ Object.defineProperty(exports, "in_memory_exports", {
14
+ enumerable: true,
15
+ get: function() {
16
+ return in_memory_exports;
17
+ }
20
18
  });
19
+
21
20
  //# sourceMappingURL=in_memory.cjs.map