@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":"entity_memory.cjs","names":["BaseChatMemory","LLMChain","ENTITY_EXTRACTION_PROMPT","ENTITY_SUMMARIZATION_PROMPT","InMemoryEntityStore"],"sources":["../../src/memory/entity_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\n\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n getPromptInputKey,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { InMemoryEntityStore } from \"./stores/entity/in_memory.js\";\nimport { LLMChain } from \"../chains/llm_chain.js\";\nimport {\n ENTITY_EXTRACTION_PROMPT,\n ENTITY_SUMMARIZATION_PROMPT,\n} from \"./prompt.js\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters required by the EntityMemory class.\n */\nexport interface EntityMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n humanPrefix?: string;\n aiPrefix?: string;\n entityExtractionPrompt?: PromptTemplate;\n entitySummarizationPrompt?: PromptTemplate;\n entityCache?: string[];\n k?: number;\n chatHistoryKey?: string;\n entitiesKey?: string;\n entityStore?: BaseEntityStore;\n}\n\n// Entity extractor & summarizer to memory.\n/**\n * Class for managing entity extraction and summarization to memory in\n * chatbot applications. Extends the BaseChatMemory class and implements\n * the EntityMemoryInput interface.\n * @example\n * ```typescript\n * const memory = new EntityMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0 }),\n * chatHistoryKey: \"history\",\n * entitiesKey: \"entities\",\n * });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n * const chain = new LLMChain({\n * llm: model,\n * prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n * memory,\n * });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({\n * res1,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * const res2 = await chain.call({\n * input: \"I work in construction. What about you?\",\n * });\n * console.log({\n * res2,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * ```\n */\nexport class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain: LLMChain;\n\n private entitySummarizationChain: LLMChain;\n\n entityStore: BaseEntityStore;\n\n entityCache: string[] = [];\n\n k = 3;\n\n chatHistoryKey = \"history\";\n\n llm: BaseLanguageModelInterface;\n\n entitiesKey = \"entities\";\n\n humanPrefix?: string;\n\n aiPrefix?: string;\n\n constructor(fields: EntityMemoryInput) {\n super({\n chatHistory: fields.chatHistory,\n returnMessages: fields.returnMessages ?? false,\n inputKey: fields.inputKey,\n outputKey: fields.outputKey,\n });\n this.llm = fields.llm;\n this.humanPrefix = fields.humanPrefix;\n this.aiPrefix = fields.aiPrefix;\n this.chatHistoryKey = fields.chatHistoryKey ?? this.chatHistoryKey;\n this.entitiesKey = fields.entitiesKey ?? this.entitiesKey;\n this.entityExtractionChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entityExtractionPrompt ?? ENTITY_EXTRACTION_PROMPT,\n });\n this.entitySummarizationChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entitySummarizationPrompt ?? ENTITY_SUMMARIZATION_PROMPT,\n });\n this.entityStore = fields.entityStore ?? new InMemoryEntityStore();\n this.entityCache = fields.entityCache ?? this.entityCache;\n this.k = fields.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.chatHistoryKey];\n }\n\n // Will always return list of memory variables.\n get memoryVariables(): string[] {\n return [this.entitiesKey, this.chatHistoryKey];\n }\n\n // Return history buffer.\n /**\n * Method to load memory variables and perform entity extraction.\n * @param inputs Input values for the method.\n * @returns Promise resolving to an object containing memory variables.\n */\n async loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables> {\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const output = await this.entityExtractionChain.predict({\n history: serializedMessages,\n input: inputs[promptInputKey],\n });\n const entities: string[] =\n output.trim() === \"NONE\" ? [] : output.split(\",\").map((w) => w.trim());\n const entitySummaries: { [key: string]: string | undefined } = {};\n\n for (const entity of entities) {\n entitySummaries[entity] = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n }\n this.entityCache = [...entities];\n const buffer = this.returnMessages\n ? messages.slice(-this.k * 2)\n : serializedMessages;\n\n return {\n [this.chatHistoryKey]: buffer,\n [this.entitiesKey]: entitySummaries,\n };\n }\n\n // Save context from this conversation to buffer.\n /**\n * Method to save the context from a conversation to a buffer and perform\n * entity summarization.\n * @param inputs Input values for the method.\n * @param outputs Output values from the method.\n * @returns Promise resolving to void.\n */\n async saveContext(inputs: InputValues, outputs: OutputValues): Promise<void> {\n await super.saveContext(inputs, outputs);\n\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const inputData = inputs[promptInputKey];\n\n for (const entity of this.entityCache) {\n const existingSummary = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n const output = await this.entitySummarizationChain.predict({\n summary: existingSummary,\n entity,\n history: serializedMessages,\n input: inputData,\n });\n if (output.trim() !== \"UNCHANGED\") {\n await this.entityStore.set(entity, output.trim());\n }\n }\n }\n\n // Clear memory contents.\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n async clear() {\n await super.clear();\n await this.entityStore.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAa,eAAb,cAAkCA,0CAA4C;CAC5E,AAAQ;CAER,AAAQ;CAER;CAEA,cAAwB,EAAE;CAE1B,IAAI;CAEJ,iBAAiB;CAEjB;CAEA,cAAc;CAEd;CAEA;CAEA,YAAY,QAA2B;AACrC,QAAM;GACJ,aAAa,OAAO;GACpB,gBAAgB,OAAO,kBAAkB;GACzC,UAAU,OAAO;GACjB,WAAW,OAAO;GACnB,CAAC;AACF,OAAK,MAAM,OAAO;AAClB,OAAK,cAAc,OAAO;AAC1B,OAAK,WAAW,OAAO;AACvB,OAAK,iBAAiB,OAAO,kBAAkB,KAAK;AACpD,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,wBAAwB,IAAIC,2BAAS;GACxC,KAAK,KAAK;GACV,QAAQ,OAAO,0BAA0BC;GAC1C,CAAC;AACF,OAAK,2BAA2B,IAAID,2BAAS;GAC3C,KAAK,KAAK;GACV,QAAQ,OAAO,6BAA6BE;GAC7C,CAAC;AACF,OAAK,cAAc,OAAO,eAAe,IAAIC,uCAAqB;AAClE,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,IAAI,OAAO,KAAK,KAAK;;CAG5B,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,eAAe;;CAI9B,IAAI,kBAA4B;AAC9B,SAAO,CAAC,KAAK,aAAa,KAAK,eAAe;;;;;;;CAShD,MAAM,oBAAoB,QAA+C;EACvE,MAAM,iBACJ,KAAK,0DAA8B,QAAQ,KAAK,gBAAgB;EAClE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,MAAM,mEACJ,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,SAAS,MAAM,KAAK,sBAAsB,QAAQ;GACtD,SAAS;GACT,OAAO,OAAO;GACf,CAAC;EACF,MAAM,WACJ,OAAO,MAAM,KAAK,SAAS,EAAE,GAAG,OAAO,MAAM,IAAI,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC;EACxE,MAAM,kBAAyD,EAAE;AAEjE,OAAK,MAAM,UAAU,SACnB,iBAAgB,UAAU,MAAM,KAAK,YAAY,IAC/C,QACA,gCACD;AAEH,OAAK,cAAc,CAAC,GAAG,SAAS;EAChC,MAAM,SAAS,KAAK,iBAChB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,GAC3B;AAEJ,SAAO;IACJ,KAAK,iBAAiB;IACtB,KAAK,cAAc;GACrB;;;;;;;;;CAWH,MAAM,YAAY,QAAqB,SAAsC;AAC3E,QAAM,MAAM,YAAY,QAAQ,QAAQ;EAExC,MAAM,iBACJ,KAAK,0DAA8B,QAAQ,KAAK,gBAAgB;EAElE,MAAM,oEADW,MAAM,KAAK,YAAY,aAAa,EAE1C,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,YAAY,OAAO;AAEzB,OAAK,MAAM,UAAU,KAAK,aAAa;GACrC,MAAM,kBAAkB,MAAM,KAAK,YAAY,IAC7C,QACA,gCACD;GACD,MAAM,SAAS,MAAM,KAAK,yBAAyB,QAAQ;IACzD,SAAS;IACT;IACA,SAAS;IACT,OAAO;IACR,CAAC;AACF,OAAI,OAAO,MAAM,KAAK,YACpB,OAAM,KAAK,YAAY,IAAI,QAAQ,OAAO,MAAM,CAAC;;;;;;;CAUvD,MAAM,QAAQ;AACZ,QAAM,MAAM,OAAO;AACnB,QAAM,KAAK,YAAY,OAAO"}
1
+ {"version":3,"file":"entity_memory.cjs","names":["BaseChatMemory","LLMChain","ENTITY_EXTRACTION_PROMPT","ENTITY_SUMMARIZATION_PROMPT","InMemoryEntityStore"],"sources":["../../src/memory/entity_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\n\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n getPromptInputKey,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { InMemoryEntityStore } from \"./stores/entity/in_memory.js\";\nimport { LLMChain } from \"../chains/llm_chain.js\";\nimport {\n ENTITY_EXTRACTION_PROMPT,\n ENTITY_SUMMARIZATION_PROMPT,\n} from \"./prompt.js\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters required by the EntityMemory class.\n */\nexport interface EntityMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n humanPrefix?: string;\n aiPrefix?: string;\n entityExtractionPrompt?: PromptTemplate;\n entitySummarizationPrompt?: PromptTemplate;\n entityCache?: string[];\n k?: number;\n chatHistoryKey?: string;\n entitiesKey?: string;\n entityStore?: BaseEntityStore;\n}\n\n// Entity extractor & summarizer to memory.\n/**\n * Class for managing entity extraction and summarization to memory in\n * chatbot applications. Extends the BaseChatMemory class and implements\n * the EntityMemoryInput interface.\n * @example\n * ```typescript\n * const memory = new EntityMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0 }),\n * chatHistoryKey: \"history\",\n * entitiesKey: \"entities\",\n * });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n * const chain = new LLMChain({\n * llm: model,\n * prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n * memory,\n * });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({\n * res1,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * const res2 = await chain.call({\n * input: \"I work in construction. What about you?\",\n * });\n * console.log({\n * res2,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * ```\n */\nexport class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain: LLMChain;\n\n private entitySummarizationChain: LLMChain;\n\n entityStore: BaseEntityStore;\n\n entityCache: string[] = [];\n\n k = 3;\n\n chatHistoryKey = \"history\";\n\n llm: BaseLanguageModelInterface;\n\n entitiesKey = \"entities\";\n\n humanPrefix?: string;\n\n aiPrefix?: string;\n\n constructor(fields: EntityMemoryInput) {\n super({\n chatHistory: fields.chatHistory,\n returnMessages: fields.returnMessages ?? false,\n inputKey: fields.inputKey,\n outputKey: fields.outputKey,\n });\n this.llm = fields.llm;\n this.humanPrefix = fields.humanPrefix;\n this.aiPrefix = fields.aiPrefix;\n this.chatHistoryKey = fields.chatHistoryKey ?? this.chatHistoryKey;\n this.entitiesKey = fields.entitiesKey ?? this.entitiesKey;\n this.entityExtractionChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entityExtractionPrompt ?? ENTITY_EXTRACTION_PROMPT,\n });\n this.entitySummarizationChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entitySummarizationPrompt ?? ENTITY_SUMMARIZATION_PROMPT,\n });\n this.entityStore = fields.entityStore ?? new InMemoryEntityStore();\n this.entityCache = fields.entityCache ?? this.entityCache;\n this.k = fields.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.chatHistoryKey];\n }\n\n // Will always return list of memory variables.\n get memoryVariables(): string[] {\n return [this.entitiesKey, this.chatHistoryKey];\n }\n\n // Return history buffer.\n /**\n * Method to load memory variables and perform entity extraction.\n * @param inputs Input values for the method.\n * @returns Promise resolving to an object containing memory variables.\n */\n async loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables> {\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const output = await this.entityExtractionChain.predict({\n history: serializedMessages,\n input: inputs[promptInputKey],\n });\n const entities: string[] =\n output.trim() === \"NONE\" ? [] : output.split(\",\").map((w) => w.trim());\n const entitySummaries: { [key: string]: string | undefined } = {};\n\n for (const entity of entities) {\n entitySummaries[entity] = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n }\n this.entityCache = [...entities];\n const buffer = this.returnMessages\n ? messages.slice(-this.k * 2)\n : serializedMessages;\n\n return {\n [this.chatHistoryKey]: buffer,\n [this.entitiesKey]: entitySummaries,\n };\n }\n\n // Save context from this conversation to buffer.\n /**\n * Method to save the context from a conversation to a buffer and perform\n * entity summarization.\n * @param inputs Input values for the method.\n * @param outputs Output values from the method.\n * @returns Promise resolving to void.\n */\n async saveContext(inputs: InputValues, outputs: OutputValues): Promise<void> {\n await super.saveContext(inputs, outputs);\n\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const inputData = inputs[promptInputKey];\n\n for (const entity of this.entityCache) {\n const existingSummary = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n const output = await this.entitySummarizationChain.predict({\n summary: existingSummary,\n entity,\n history: serializedMessages,\n input: inputData,\n });\n if (output.trim() !== \"UNCHANGED\") {\n await this.entityStore.set(entity, output.trim());\n }\n }\n }\n\n // Clear memory contents.\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n async clear() {\n await super.clear();\n await this.entityStore.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAa,eAAb,cAAkCA,2BAAAA,eAA4C;CAC5E;CAEA;CAEA;CAEA,cAAwB,EAAE;CAE1B,IAAI;CAEJ,iBAAiB;CAEjB;CAEA,cAAc;CAEd;CAEA;CAEA,YAAY,QAA2B;AACrC,QAAM;GACJ,aAAa,OAAO;GACpB,gBAAgB,OAAO,kBAAkB;GACzC,UAAU,OAAO;GACjB,WAAW,OAAO;GACnB,CAAC;AACF,OAAK,MAAM,OAAO;AAClB,OAAK,cAAc,OAAO;AAC1B,OAAK,WAAW,OAAO;AACvB,OAAK,iBAAiB,OAAO,kBAAkB,KAAK;AACpD,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,wBAAwB,IAAIC,kBAAAA,SAAS;GACxC,KAAK,KAAK;GACV,QAAQ,OAAO,0BAA0BC,eAAAA;GAC1C,CAAC;AACF,OAAK,2BAA2B,IAAID,kBAAAA,SAAS;GAC3C,KAAK,KAAK;GACV,QAAQ,OAAO,6BAA6BE,eAAAA;GAC7C,CAAC;AACF,OAAK,cAAc,OAAO,eAAe,IAAIC,kBAAAA,qBAAqB;AAClE,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,IAAI,OAAO,KAAK,KAAK;;CAG5B,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,eAAe;;CAI9B,IAAI,kBAA4B;AAC9B,SAAO,CAAC,KAAK,aAAa,KAAK,eAAe;;;;;;;CAShD,MAAM,oBAAoB,QAA+C;EACvE,MAAM,iBACJ,KAAK,aAAA,GAAA,uBAAA,mBAA8B,QAAQ,KAAK,gBAAgB;EAClE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,MAAM,sBAAA,GAAA,yBAAA,iBACJ,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,SAAS,MAAM,KAAK,sBAAsB,QAAQ;GACtD,SAAS;GACT,OAAO,OAAO;GACf,CAAC;EACF,MAAM,WACJ,OAAO,MAAM,KAAK,SAAS,EAAE,GAAG,OAAO,MAAM,IAAI,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC;EACxE,MAAM,kBAAyD,EAAE;AAEjE,OAAK,MAAM,UAAU,SACnB,iBAAgB,UAAU,MAAM,KAAK,YAAY,IAC/C,QACA,gCACD;AAEH,OAAK,cAAc,CAAC,GAAG,SAAS;EAChC,MAAM,SAAS,KAAK,iBAChB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,GAC3B;AAEJ,SAAO;IACJ,KAAK,iBAAiB;IACtB,KAAK,cAAc;GACrB;;;;;;;;;CAWH,MAAM,YAAY,QAAqB,SAAsC;AAC3E,QAAM,MAAM,YAAY,QAAQ,QAAQ;EAExC,MAAM,iBACJ,KAAK,aAAA,GAAA,uBAAA,mBAA8B,QAAQ,KAAK,gBAAgB;EAElE,MAAM,sBAAA,GAAA,yBAAA,kBADW,MAAM,KAAK,YAAY,aAAa,EAE1C,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,YAAY,OAAO;AAEzB,OAAK,MAAM,UAAU,KAAK,aAAa;GACrC,MAAM,kBAAkB,MAAM,KAAK,YAAY,IAC7C,QACA,gCACD;GACD,MAAM,SAAS,MAAM,KAAK,yBAAyB,QAAQ;IACzD,SAAS;IACT;IACA,SAAS;IACT,OAAO;IACR,CAAC;AACF,OAAI,OAAO,MAAM,KAAK,YACpB,OAAM,KAAK,YAAY,IAAI,QAAQ,OAAO,MAAM,CAAC;;;;;;;CAUvD,MAAM,QAAQ;AACZ,QAAM,MAAM,OAAO;AACnB,QAAM,KAAK,YAAY,OAAO"}
@@ -4,7 +4,6 @@ import { BaseChatMemory } from "./chat_memory.js";
4
4
  import { InMemoryEntityStore } from "./stores/entity/in_memory.js";
5
5
  import { getBufferString } from "@langchain/core/messages";
6
6
  import { getPromptInputKey } from "@langchain/core/memory";
7
-
8
7
  //#region src/memory/entity_memory.ts
9
8
  /**
10
9
  * Class for managing entity extraction and summarization to memory in
@@ -136,7 +135,7 @@ var EntityMemory = class extends BaseChatMemory {
136
135
  await this.entityStore.clear();
137
136
  }
138
137
  };
139
-
140
138
  //#endregion
141
139
  export { EntityMemory };
140
+
142
141
  //# sourceMappingURL=entity_memory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity_memory.js","names":[],"sources":["../../src/memory/entity_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\n\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n getPromptInputKey,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { InMemoryEntityStore } from \"./stores/entity/in_memory.js\";\nimport { LLMChain } from \"../chains/llm_chain.js\";\nimport {\n ENTITY_EXTRACTION_PROMPT,\n ENTITY_SUMMARIZATION_PROMPT,\n} from \"./prompt.js\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters required by the EntityMemory class.\n */\nexport interface EntityMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n humanPrefix?: string;\n aiPrefix?: string;\n entityExtractionPrompt?: PromptTemplate;\n entitySummarizationPrompt?: PromptTemplate;\n entityCache?: string[];\n k?: number;\n chatHistoryKey?: string;\n entitiesKey?: string;\n entityStore?: BaseEntityStore;\n}\n\n// Entity extractor & summarizer to memory.\n/**\n * Class for managing entity extraction and summarization to memory in\n * chatbot applications. Extends the BaseChatMemory class and implements\n * the EntityMemoryInput interface.\n * @example\n * ```typescript\n * const memory = new EntityMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0 }),\n * chatHistoryKey: \"history\",\n * entitiesKey: \"entities\",\n * });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n * const chain = new LLMChain({\n * llm: model,\n * prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n * memory,\n * });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({\n * res1,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * const res2 = await chain.call({\n * input: \"I work in construction. What about you?\",\n * });\n * console.log({\n * res2,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * ```\n */\nexport class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain: LLMChain;\n\n private entitySummarizationChain: LLMChain;\n\n entityStore: BaseEntityStore;\n\n entityCache: string[] = [];\n\n k = 3;\n\n chatHistoryKey = \"history\";\n\n llm: BaseLanguageModelInterface;\n\n entitiesKey = \"entities\";\n\n humanPrefix?: string;\n\n aiPrefix?: string;\n\n constructor(fields: EntityMemoryInput) {\n super({\n chatHistory: fields.chatHistory,\n returnMessages: fields.returnMessages ?? false,\n inputKey: fields.inputKey,\n outputKey: fields.outputKey,\n });\n this.llm = fields.llm;\n this.humanPrefix = fields.humanPrefix;\n this.aiPrefix = fields.aiPrefix;\n this.chatHistoryKey = fields.chatHistoryKey ?? this.chatHistoryKey;\n this.entitiesKey = fields.entitiesKey ?? this.entitiesKey;\n this.entityExtractionChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entityExtractionPrompt ?? ENTITY_EXTRACTION_PROMPT,\n });\n this.entitySummarizationChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entitySummarizationPrompt ?? ENTITY_SUMMARIZATION_PROMPT,\n });\n this.entityStore = fields.entityStore ?? new InMemoryEntityStore();\n this.entityCache = fields.entityCache ?? this.entityCache;\n this.k = fields.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.chatHistoryKey];\n }\n\n // Will always return list of memory variables.\n get memoryVariables(): string[] {\n return [this.entitiesKey, this.chatHistoryKey];\n }\n\n // Return history buffer.\n /**\n * Method to load memory variables and perform entity extraction.\n * @param inputs Input values for the method.\n * @returns Promise resolving to an object containing memory variables.\n */\n async loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables> {\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const output = await this.entityExtractionChain.predict({\n history: serializedMessages,\n input: inputs[promptInputKey],\n });\n const entities: string[] =\n output.trim() === \"NONE\" ? [] : output.split(\",\").map((w) => w.trim());\n const entitySummaries: { [key: string]: string | undefined } = {};\n\n for (const entity of entities) {\n entitySummaries[entity] = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n }\n this.entityCache = [...entities];\n const buffer = this.returnMessages\n ? messages.slice(-this.k * 2)\n : serializedMessages;\n\n return {\n [this.chatHistoryKey]: buffer,\n [this.entitiesKey]: entitySummaries,\n };\n }\n\n // Save context from this conversation to buffer.\n /**\n * Method to save the context from a conversation to a buffer and perform\n * entity summarization.\n * @param inputs Input values for the method.\n * @param outputs Output values from the method.\n * @returns Promise resolving to void.\n */\n async saveContext(inputs: InputValues, outputs: OutputValues): Promise<void> {\n await super.saveContext(inputs, outputs);\n\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const inputData = inputs[promptInputKey];\n\n for (const entity of this.entityCache) {\n const existingSummary = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n const output = await this.entitySummarizationChain.predict({\n summary: existingSummary,\n entity,\n history: serializedMessages,\n input: inputData,\n });\n if (output.trim() !== \"UNCHANGED\") {\n await this.entityStore.set(entity, output.trim());\n }\n }\n }\n\n // Clear memory contents.\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n async clear() {\n await super.clear();\n await this.entityStore.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAa,eAAb,cAAkC,eAA4C;CAC5E,AAAQ;CAER,AAAQ;CAER;CAEA,cAAwB,EAAE;CAE1B,IAAI;CAEJ,iBAAiB;CAEjB;CAEA,cAAc;CAEd;CAEA;CAEA,YAAY,QAA2B;AACrC,QAAM;GACJ,aAAa,OAAO;GACpB,gBAAgB,OAAO,kBAAkB;GACzC,UAAU,OAAO;GACjB,WAAW,OAAO;GACnB,CAAC;AACF,OAAK,MAAM,OAAO;AAClB,OAAK,cAAc,OAAO;AAC1B,OAAK,WAAW,OAAO;AACvB,OAAK,iBAAiB,OAAO,kBAAkB,KAAK;AACpD,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,wBAAwB,IAAI,SAAS;GACxC,KAAK,KAAK;GACV,QAAQ,OAAO,0BAA0B;GAC1C,CAAC;AACF,OAAK,2BAA2B,IAAI,SAAS;GAC3C,KAAK,KAAK;GACV,QAAQ,OAAO,6BAA6B;GAC7C,CAAC;AACF,OAAK,cAAc,OAAO,eAAe,IAAI,qBAAqB;AAClE,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,IAAI,OAAO,KAAK,KAAK;;CAG5B,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,eAAe;;CAI9B,IAAI,kBAA4B;AAC9B,SAAO,CAAC,KAAK,aAAa,KAAK,eAAe;;;;;;;CAShD,MAAM,oBAAoB,QAA+C;EACvE,MAAM,iBACJ,KAAK,YAAY,kBAAkB,QAAQ,KAAK,gBAAgB;EAClE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,MAAM,qBAAqB,gBACzB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,SAAS,MAAM,KAAK,sBAAsB,QAAQ;GACtD,SAAS;GACT,OAAO,OAAO;GACf,CAAC;EACF,MAAM,WACJ,OAAO,MAAM,KAAK,SAAS,EAAE,GAAG,OAAO,MAAM,IAAI,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC;EACxE,MAAM,kBAAyD,EAAE;AAEjE,OAAK,MAAM,UAAU,SACnB,iBAAgB,UAAU,MAAM,KAAK,YAAY,IAC/C,QACA,gCACD;AAEH,OAAK,cAAc,CAAC,GAAG,SAAS;EAChC,MAAM,SAAS,KAAK,iBAChB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,GAC3B;AAEJ,SAAO;IACJ,KAAK,iBAAiB;IACtB,KAAK,cAAc;GACrB;;;;;;;;;CAWH,MAAM,YAAY,QAAqB,SAAsC;AAC3E,QAAM,MAAM,YAAY,QAAQ,QAAQ;EAExC,MAAM,iBACJ,KAAK,YAAY,kBAAkB,QAAQ,KAAK,gBAAgB;EAElE,MAAM,qBAAqB,iBADV,MAAM,KAAK,YAAY,aAAa,EAE1C,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,YAAY,OAAO;AAEzB,OAAK,MAAM,UAAU,KAAK,aAAa;GACrC,MAAM,kBAAkB,MAAM,KAAK,YAAY,IAC7C,QACA,gCACD;GACD,MAAM,SAAS,MAAM,KAAK,yBAAyB,QAAQ;IACzD,SAAS;IACT;IACA,SAAS;IACT,OAAO;IACR,CAAC;AACF,OAAI,OAAO,MAAM,KAAK,YACpB,OAAM,KAAK,YAAY,IAAI,QAAQ,OAAO,MAAM,CAAC;;;;;;;CAUvD,MAAM,QAAQ;AACZ,QAAM,MAAM,OAAO;AACnB,QAAM,KAAK,YAAY,OAAO"}
1
+ {"version":3,"file":"entity_memory.js","names":[],"sources":["../../src/memory/entity_memory.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\n\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n getPromptInputKey,\n} from \"@langchain/core/memory\";\nimport { getBufferString } from \"@langchain/core/messages\";\nimport { InMemoryEntityStore } from \"./stores/entity/in_memory.js\";\nimport { LLMChain } from \"../chains/llm_chain.js\";\nimport {\n ENTITY_EXTRACTION_PROMPT,\n ENTITY_SUMMARIZATION_PROMPT,\n} from \"./prompt.js\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters required by the EntityMemory class.\n */\nexport interface EntityMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n humanPrefix?: string;\n aiPrefix?: string;\n entityExtractionPrompt?: PromptTemplate;\n entitySummarizationPrompt?: PromptTemplate;\n entityCache?: string[];\n k?: number;\n chatHistoryKey?: string;\n entitiesKey?: string;\n entityStore?: BaseEntityStore;\n}\n\n// Entity extractor & summarizer to memory.\n/**\n * Class for managing entity extraction and summarization to memory in\n * chatbot applications. Extends the BaseChatMemory class and implements\n * the EntityMemoryInput interface.\n * @example\n * ```typescript\n * const memory = new EntityMemory({\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0 }),\n * chatHistoryKey: \"history\",\n * entitiesKey: \"entities\",\n * });\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\", temperature: 0.9 });\n * const chain = new LLMChain({\n * llm: model,\n * prompt: ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n * memory,\n * });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({\n * res1,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * const res2 = await chain.call({\n * input: \"I work in construction. What about you?\",\n * });\n * console.log({\n * res2,\n * memory: await memory.loadMemoryVariables({ input: \"Who is Jim?\" }),\n * });\n *\n * ```\n */\nexport class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain: LLMChain;\n\n private entitySummarizationChain: LLMChain;\n\n entityStore: BaseEntityStore;\n\n entityCache: string[] = [];\n\n k = 3;\n\n chatHistoryKey = \"history\";\n\n llm: BaseLanguageModelInterface;\n\n entitiesKey = \"entities\";\n\n humanPrefix?: string;\n\n aiPrefix?: string;\n\n constructor(fields: EntityMemoryInput) {\n super({\n chatHistory: fields.chatHistory,\n returnMessages: fields.returnMessages ?? false,\n inputKey: fields.inputKey,\n outputKey: fields.outputKey,\n });\n this.llm = fields.llm;\n this.humanPrefix = fields.humanPrefix;\n this.aiPrefix = fields.aiPrefix;\n this.chatHistoryKey = fields.chatHistoryKey ?? this.chatHistoryKey;\n this.entitiesKey = fields.entitiesKey ?? this.entitiesKey;\n this.entityExtractionChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entityExtractionPrompt ?? ENTITY_EXTRACTION_PROMPT,\n });\n this.entitySummarizationChain = new LLMChain({\n llm: this.llm,\n prompt: fields.entitySummarizationPrompt ?? ENTITY_SUMMARIZATION_PROMPT,\n });\n this.entityStore = fields.entityStore ?? new InMemoryEntityStore();\n this.entityCache = fields.entityCache ?? this.entityCache;\n this.k = fields.k ?? this.k;\n }\n\n get memoryKeys() {\n return [this.chatHistoryKey];\n }\n\n // Will always return list of memory variables.\n get memoryVariables(): string[] {\n return [this.entitiesKey, this.chatHistoryKey];\n }\n\n // Return history buffer.\n /**\n * Method to load memory variables and perform entity extraction.\n * @param inputs Input values for the method.\n * @returns Promise resolving to an object containing memory variables.\n */\n async loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables> {\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const output = await this.entityExtractionChain.predict({\n history: serializedMessages,\n input: inputs[promptInputKey],\n });\n const entities: string[] =\n output.trim() === \"NONE\" ? [] : output.split(\",\").map((w) => w.trim());\n const entitySummaries: { [key: string]: string | undefined } = {};\n\n for (const entity of entities) {\n entitySummaries[entity] = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n }\n this.entityCache = [...entities];\n const buffer = this.returnMessages\n ? messages.slice(-this.k * 2)\n : serializedMessages;\n\n return {\n [this.chatHistoryKey]: buffer,\n [this.entitiesKey]: entitySummaries,\n };\n }\n\n // Save context from this conversation to buffer.\n /**\n * Method to save the context from a conversation to a buffer and perform\n * entity summarization.\n * @param inputs Input values for the method.\n * @param outputs Output values from the method.\n * @returns Promise resolving to void.\n */\n async saveContext(inputs: InputValues, outputs: OutputValues): Promise<void> {\n await super.saveContext(inputs, outputs);\n\n const promptInputKey =\n this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);\n const messages = await this.chatHistory.getMessages();\n const serializedMessages = getBufferString(\n messages.slice(-this.k * 2),\n this.humanPrefix,\n this.aiPrefix\n );\n const inputData = inputs[promptInputKey];\n\n for (const entity of this.entityCache) {\n const existingSummary = await this.entityStore.get(\n entity,\n \"No current information known.\"\n );\n const output = await this.entitySummarizationChain.predict({\n summary: existingSummary,\n entity,\n history: serializedMessages,\n input: inputData,\n });\n if (output.trim() !== \"UNCHANGED\") {\n await this.entityStore.set(entity, output.trim());\n }\n }\n }\n\n // Clear memory contents.\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n async clear() {\n await super.clear();\n await this.entityStore.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAa,eAAb,cAAkC,eAA4C;CAC5E;CAEA;CAEA;CAEA,cAAwB,EAAE;CAE1B,IAAI;CAEJ,iBAAiB;CAEjB;CAEA,cAAc;CAEd;CAEA;CAEA,YAAY,QAA2B;AACrC,QAAM;GACJ,aAAa,OAAO;GACpB,gBAAgB,OAAO,kBAAkB;GACzC,UAAU,OAAO;GACjB,WAAW,OAAO;GACnB,CAAC;AACF,OAAK,MAAM,OAAO;AAClB,OAAK,cAAc,OAAO;AAC1B,OAAK,WAAW,OAAO;AACvB,OAAK,iBAAiB,OAAO,kBAAkB,KAAK;AACpD,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,wBAAwB,IAAI,SAAS;GACxC,KAAK,KAAK;GACV,QAAQ,OAAO,0BAA0B;GAC1C,CAAC;AACF,OAAK,2BAA2B,IAAI,SAAS;GAC3C,KAAK,KAAK;GACV,QAAQ,OAAO,6BAA6B;GAC7C,CAAC;AACF,OAAK,cAAc,OAAO,eAAe,IAAI,qBAAqB;AAClE,OAAK,cAAc,OAAO,eAAe,KAAK;AAC9C,OAAK,IAAI,OAAO,KAAK,KAAK;;CAG5B,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,eAAe;;CAI9B,IAAI,kBAA4B;AAC9B,SAAO,CAAC,KAAK,aAAa,KAAK,eAAe;;;;;;;CAShD,MAAM,oBAAoB,QAA+C;EACvE,MAAM,iBACJ,KAAK,YAAY,kBAAkB,QAAQ,KAAK,gBAAgB;EAClE,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,MAAM,qBAAqB,gBACzB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,SAAS,MAAM,KAAK,sBAAsB,QAAQ;GACtD,SAAS;GACT,OAAO,OAAO;GACf,CAAC;EACF,MAAM,WACJ,OAAO,MAAM,KAAK,SAAS,EAAE,GAAG,OAAO,MAAM,IAAI,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC;EACxE,MAAM,kBAAyD,EAAE;AAEjE,OAAK,MAAM,UAAU,SACnB,iBAAgB,UAAU,MAAM,KAAK,YAAY,IAC/C,QACA,gCACD;AAEH,OAAK,cAAc,CAAC,GAAG,SAAS;EAChC,MAAM,SAAS,KAAK,iBAChB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,GAC3B;AAEJ,SAAO;IACJ,KAAK,iBAAiB;IACtB,KAAK,cAAc;GACrB;;;;;;;;;CAWH,MAAM,YAAY,QAAqB,SAAsC;AAC3E,QAAM,MAAM,YAAY,QAAQ,QAAQ;EAExC,MAAM,iBACJ,KAAK,YAAY,kBAAkB,QAAQ,KAAK,gBAAgB;EAElE,MAAM,qBAAqB,iBADV,MAAM,KAAK,YAAY,aAAa,EAE1C,MAAM,CAAC,KAAK,IAAI,EAAE,EAC3B,KAAK,aACL,KAAK,SACN;EACD,MAAM,YAAY,OAAO;AAEzB,OAAK,MAAM,UAAU,KAAK,aAAa;GACrC,MAAM,kBAAkB,MAAM,KAAK,YAAY,IAC7C,QACA,gCACD;GACD,MAAM,SAAS,MAAM,KAAK,yBAAyB,QAAQ;IACzD,SAAS;IACT;IACA,SAAS;IACT,OAAO;IACR,CAAC;AACF,OAAI,OAAO,MAAM,KAAK,YACpB,OAAM,KAAK,YAAY,IAAI,QAAQ,OAAO,MAAM,CAAC;;;;;;;CAUvD,MAAM,QAAQ;AACZ,QAAM,MAAM,OAAO;AACnB,QAAM,KAAK,YAAY,OAAO"}
@@ -1,19 +1,18 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require_prompt = require('./prompt.cjs');
4
- const require_memory_chat_memory = require('./chat_memory.cjs');
5
- const require_summary = require('./summary.cjs');
6
- const require_summary_buffer = require('./summary_buffer.cjs');
7
- const require_buffer_memory = require('./buffer_memory.cjs');
8
- const require_buffer_window_memory = require('./buffer_window_memory.cjs');
9
- const require_vector_store = require('./vector_store.cjs');
10
- const require_entity_memory = require('./entity_memory.cjs');
11
- const require_combined_memory = require('./combined_memory.cjs');
12
- const require_buffer_token_memory = require('./buffer_token_memory.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
3
+ const require_prompt = require("./prompt.cjs");
4
+ const require_memory_chat_memory = require("./chat_memory.cjs");
5
+ const require_summary = require("./summary.cjs");
6
+ const require_summary_buffer = require("./summary_buffer.cjs");
7
+ const require_buffer_memory = require("./buffer_memory.cjs");
8
+ const require_buffer_window_memory = require("./buffer_window_memory.cjs");
9
+ const require_vector_store = require("./vector_store.cjs");
10
+ const require_entity_memory = require("./entity_memory.cjs");
11
+ const require_combined_memory = require("./combined_memory.cjs");
12
+ const require_buffer_token_memory = require("./buffer_token_memory.cjs");
13
13
  let _langchain_core_messages = require("@langchain/core/messages");
14
14
  let _langchain_core_chat_history = require("@langchain/core/chat_history");
15
15
  let _langchain_core_memory = require("@langchain/core/memory");
16
-
17
16
  //#region src/memory/index.ts
18
17
  var memory_exports = /* @__PURE__ */ require_runtime.__exportAll({
19
18
  BaseChatMemory: () => require_memory_chat_memory.BaseChatMemory,
@@ -33,23 +32,22 @@ var memory_exports = /* @__PURE__ */ require_runtime.__exportAll({
33
32
  getInputValue: () => _langchain_core_memory.getInputValue,
34
33
  getOutputValue: () => _langchain_core_memory.getOutputValue
35
34
  });
36
-
37
35
  //#endregion
38
36
  exports.BaseChatMemory = require_memory_chat_memory.BaseChatMemory;
39
37
  exports.BaseConversationSummaryMemory = require_summary.BaseConversationSummaryMemory;
40
- Object.defineProperty(exports, 'BaseMemory', {
41
- enumerable: true,
42
- get: function () {
43
- return _langchain_core_memory.BaseMemory;
44
- }
38
+ Object.defineProperty(exports, "BaseMemory", {
39
+ enumerable: true,
40
+ get: function() {
41
+ return _langchain_core_memory.BaseMemory;
42
+ }
45
43
  });
46
44
  exports.BufferMemory = require_buffer_memory.BufferMemory;
47
45
  exports.BufferWindowMemory = require_buffer_window_memory.BufferWindowMemory;
48
- Object.defineProperty(exports, 'ChatMessageHistory', {
49
- enumerable: true,
50
- get: function () {
51
- return _langchain_core_chat_history.InMemoryChatMessageHistory;
52
- }
46
+ Object.defineProperty(exports, "ChatMessageHistory", {
47
+ enumerable: true,
48
+ get: function() {
49
+ return _langchain_core_chat_history.InMemoryChatMessageHistory;
50
+ }
53
51
  });
54
52
  exports.CombinedMemory = require_combined_memory.CombinedMemory;
55
53
  exports.ConversationSummaryBufferMemory = require_summary_buffer.ConversationSummaryBufferMemory;
@@ -58,28 +56,29 @@ exports.ConversationTokenBufferMemory = require_buffer_token_memory.Conversation
58
56
  exports.ENTITY_MEMORY_CONVERSATION_TEMPLATE = require_prompt.ENTITY_MEMORY_CONVERSATION_TEMPLATE;
59
57
  exports.EntityMemory = require_entity_memory.EntityMemory;
60
58
  exports.VectorStoreRetrieverMemory = require_vector_store.VectorStoreRetrieverMemory;
61
- Object.defineProperty(exports, 'getBufferString', {
62
- enumerable: true,
63
- get: function () {
64
- return _langchain_core_messages.getBufferString;
65
- }
59
+ Object.defineProperty(exports, "getBufferString", {
60
+ enumerable: true,
61
+ get: function() {
62
+ return _langchain_core_messages.getBufferString;
63
+ }
66
64
  });
67
- Object.defineProperty(exports, 'getInputValue', {
68
- enumerable: true,
69
- get: function () {
70
- return _langchain_core_memory.getInputValue;
71
- }
65
+ Object.defineProperty(exports, "getInputValue", {
66
+ enumerable: true,
67
+ get: function() {
68
+ return _langchain_core_memory.getInputValue;
69
+ }
72
70
  });
73
- Object.defineProperty(exports, 'getOutputValue', {
74
- enumerable: true,
75
- get: function () {
76
- return _langchain_core_memory.getOutputValue;
77
- }
71
+ Object.defineProperty(exports, "getOutputValue", {
72
+ enumerable: true,
73
+ get: function() {
74
+ return _langchain_core_memory.getOutputValue;
75
+ }
78
76
  });
79
- Object.defineProperty(exports, 'memory_exports', {
80
- enumerable: true,
81
- get: function () {
82
- return memory_exports;
83
- }
77
+ Object.defineProperty(exports, "memory_exports", {
78
+ enumerable: true,
79
+ get: function() {
80
+ return memory_exports;
81
+ }
84
82
  });
83
+
85
84
  //# sourceMappingURL=index.cjs.map
@@ -12,7 +12,6 @@ import { ConversationTokenBufferMemory } from "./buffer_token_memory.js";
12
12
  import { getBufferString } from "@langchain/core/messages";
13
13
  import { InMemoryChatMessageHistory as ChatMessageHistory } from "@langchain/core/chat_history";
14
14
  import { BaseMemory, getInputValue, getOutputValue } from "@langchain/core/memory";
15
-
16
15
  //#region src/memory/index.ts
17
16
  var memory_exports = /* @__PURE__ */ __exportAll({
18
17
  BaseChatMemory: () => BaseChatMemory,
@@ -32,7 +31,7 @@ var memory_exports = /* @__PURE__ */ __exportAll({
32
31
  getInputValue: () => getInputValue,
33
32
  getOutputValue: () => getOutputValue
34
33
  });
35
-
36
34
  //#endregion
37
35
  export { BaseChatMemory, BaseConversationSummaryMemory, BaseMemory, BufferMemory, BufferWindowMemory, ChatMessageHistory, CombinedMemory, ConversationSummaryBufferMemory, ConversationSummaryMemory, ConversationTokenBufferMemory, ENTITY_MEMORY_CONVERSATION_TEMPLATE, EntityMemory, VectorStoreRetrieverMemory, getBufferString, getInputValue, getOutputValue, memory_exports };
36
+
38
37
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
1
+ require("../_virtual/_rolldown/runtime.cjs");
2
2
  let _langchain_core_prompts = require("@langchain/core/prompts");
3
-
4
- //#region src/memory/prompt.ts
5
- const _DEFAULT_SUMMARIZER_TEMPLATE = `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.
3
+ const SUMMARY_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
4
+ inputVariables: ["summary", "new_lines"],
5
+ template: `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.
6
6
 
7
7
  EXAMPLE
8
8
  Current summary:
@@ -22,12 +22,15 @@ Current summary:
22
22
  New lines of conversation:
23
23
  {new_lines}
24
24
 
25
- New summary:`;
26
- const SUMMARY_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
27
- inputVariables: ["summary", "new_lines"],
28
- template: _DEFAULT_SUMMARIZER_TEMPLATE
25
+ New summary:`
29
26
  });
30
- const _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE = `You are an assistant to a human, powered by a large language model trained by OpenAI.
27
+ const ENTITY_MEMORY_CONVERSATION_TEMPLATE = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
28
+ inputVariables: [
29
+ "entities",
30
+ "history",
31
+ "input"
32
+ ],
33
+ template: `You are an assistant to a human, powered by a large language model trained by OpenAI.
31
34
 
32
35
  You are designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, you are able to generate human-like text based on the input you receive, allowing you to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.
33
36
 
@@ -42,16 +45,11 @@ Current conversation:
42
45
  {history}
43
46
  Last line:
44
47
  Human: {input}
45
- You:`;
46
- const ENTITY_MEMORY_CONVERSATION_TEMPLATE = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
47
- inputVariables: [
48
- "entities",
49
- "history",
50
- "input"
51
- ],
52
- template: _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE
48
+ You:`
53
49
  });
54
- const _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = `You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.
50
+ const ENTITY_EXTRACTION_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
51
+ inputVariables: ["history", "input"],
52
+ template: `You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.
55
53
 
56
54
  The conversation history is provided just in case of a coreference (e.g. "What do you know about him" where "him" is defined in a previous line) -- ignore items mentioned there that are not in the last line.
57
55
 
@@ -84,12 +82,16 @@ Conversation history (for reference only):
84
82
  Last line of conversation (for extraction):
85
83
  Human: {input}
86
84
 
87
- Output:`;
88
- const ENTITY_EXTRACTION_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
89
- inputVariables: ["history", "input"],
90
- template: _DEFAULT_ENTITY_EXTRACTION_TEMPLATE
85
+ Output:`
91
86
  });
92
- const _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = `You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the "Entity" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.
87
+ const ENTITY_SUMMARIZATION_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
88
+ inputVariables: [
89
+ "entity",
90
+ "summary",
91
+ "history",
92
+ "input"
93
+ ],
94
+ template: `You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the "Entity" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.
93
95
  The update should only include facts that are relayed in the last line of conversation about the provided entity, and should only contain facts about the provided entity.
94
96
 
95
97
  If there is no new information about the provided entity or the information is not worth noting (not an important or relevant fact to remember long-term), output the exact string "UNCHANGED" below.
@@ -105,20 +107,12 @@ Existing summary of {entity}:
105
107
 
106
108
  Last line of conversation:
107
109
  Human: {input}
108
- Updated summary (or the exact string "UNCHANGED" if there is no new information about {entity} above):`;
109
- const ENTITY_SUMMARIZATION_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
110
- inputVariables: [
111
- "entity",
112
- "summary",
113
- "history",
114
- "input"
115
- ],
116
- template: _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE
110
+ Updated summary (or the exact string "UNCHANGED" if there is no new information about {entity} above):`
117
111
  });
118
-
119
112
  //#endregion
120
113
  exports.ENTITY_EXTRACTION_PROMPT = ENTITY_EXTRACTION_PROMPT;
121
114
  exports.ENTITY_MEMORY_CONVERSATION_TEMPLATE = ENTITY_MEMORY_CONVERSATION_TEMPLATE;
122
115
  exports.ENTITY_SUMMARIZATION_PROMPT = ENTITY_SUMMARIZATION_PROMPT;
123
116
  exports.SUMMARY_PROMPT = SUMMARY_PROMPT;
117
+
124
118
  //# sourceMappingURL=prompt.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.cjs","names":["PromptTemplate"],"sources":["../../src/memory/prompt.ts"],"sourcesContent":["import { PromptTemplate } from \"@langchain/core/prompts\";\n\nconst _DEFAULT_SUMMARIZER_TEMPLATE = `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.\n\nEXAMPLE\nCurrent summary:\nThe human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good.\n\nNew lines of conversation:\nHuman: Why do you think artificial intelligence is a force for good?\nAI: Because artificial intelligence will help humans reach their full potential.\n\nNew summary:\nThe human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good because it will help humans reach their full potential.\nEND OF EXAMPLE\n\nCurrent summary:\n{summary}\n\nNew lines of conversation:\n{new_lines}\n\nNew summary:`;\n\nexport const SUMMARY_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"summary\", \"new_lines\"],\n template: _DEFAULT_SUMMARIZER_TEMPLATE,\n});\n\nexport const _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE = `You are an assistant to a human, powered by a large language model trained by OpenAI.\n\nYou are designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, you are able to generate human-like text based on the input you receive, allowing you to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nYou are constantly learning and improving, and your capabilities are constantly evolving. You are able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. You have access to some personalized information provided by the human in the Context section below. Additionally, you are able to generate your own text based on the input you receive, allowing you to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, you are a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether the human needs help with a specific question or just wants to have a conversation about a particular topic, you are here to assist.\n\nContext:\n{entities}\n\nCurrent conversation:\n{history}\nLast line:\nHuman: {input}\nYou:`;\n\nexport const ENTITY_MEMORY_CONVERSATION_TEMPLATE =\n /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"entities\", \"history\", \"input\"],\n template: _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n });\n\nexport const _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = `You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.\n\nThe conversation history is provided just in case of a coreference (e.g. \"What do you know about him\" where \"him\" is defined in a previous line) -- ignore items mentioned there that are not in the last line.\n\nReturn the output as a single comma-separated list, or NONE if there is nothing of note to return (e.g. the user is just issuing a greeting or having a simple conversation).\n\nEXAMPLE\nConversation history:\nPerson #1: my name is Jacob. how's it going today?\nAI: \"It's going great! How about you?\"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: \"That sounds like a lot of work! What kind of things are you doing to make Langchain better?\"\nLast line:\nPerson #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff.\nOutput: Jacob,Langchain\nEND OF EXAMPLE\n\nEXAMPLE\nConversation history:\nPerson #1: how's it going today?\nAI: \"It's going great! How about you?\"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: \"That sounds like a lot of work! What kind of things are you doing to make Langchain better?\"\nLast line:\nPerson #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff. I'm working with Person #2.\nOutput: Langchain, Person #2\nEND OF EXAMPLE\n\nConversation history (for reference only):\n{history}\nLast line of conversation (for extraction):\nHuman: {input}\n\nOutput:`;\n\nexport const ENTITY_EXTRACTION_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"history\", \"input\"],\n template: _DEFAULT_ENTITY_EXTRACTION_TEMPLATE,\n});\n\nexport const _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = `You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the \"Entity\" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.\nThe update should only include facts that are relayed in the last line of conversation about the provided entity, and should only contain facts about the provided entity.\n\nIf there is no new information about the provided entity or the information is not worth noting (not an important or relevant fact to remember long-term), output the exact string \"UNCHANGED\" below.\n\nFull conversation history (for context):\n{history}\n\nEntity to summarize:\n{entity}\n\nExisting summary of {entity}:\n{summary}\n\nLast line of conversation:\nHuman: {input}\nUpdated summary (or the exact string \"UNCHANGED\" if there is no new information about {entity} above):`;\n\nexport const ENTITY_SUMMARIZATION_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"entity\", \"summary\", \"history\", \"input\"],\n template: _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE,\n});\n"],"mappings":";;;;AAEA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;AAsBrC,MAAa,iCAA+B,IAAIA,uCAAe;CAC7D,gBAAgB,CAAC,WAAW,YAAY;CACxC,UAAU;CACX,CAAC;AAEF,MAAa,+CAA+C;;;;;;;;;;;;;;;;AAiB5D,MAAa,sDACG,IAAIA,uCAAe;CAC/B,gBAAgB;EAAC;EAAY;EAAW;EAAQ;CAChD,UAAU;CACX,CAAC;AAEJ,MAAa,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCnD,MAAa,2CAAyC,IAAIA,uCAAe;CACvE,gBAAgB,CAAC,WAAW,QAAQ;CACpC,UAAU;CACX,CAAC;AAEF,MAAa,yCAAyC;;;;;;;;;;;;;;;;;AAkBtD,MAAa,8CAA4C,IAAIA,uCAAe;CAC1E,gBAAgB;EAAC;EAAU;EAAW;EAAW;EAAQ;CACzD,UAAU;CACX,CAAC"}
1
+ {"version":3,"file":"prompt.cjs","names":["PromptTemplate"],"sources":["../../src/memory/prompt.ts"],"sourcesContent":["import { PromptTemplate } from \"@langchain/core/prompts\";\n\nconst _DEFAULT_SUMMARIZER_TEMPLATE = `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.\n\nEXAMPLE\nCurrent summary:\nThe human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good.\n\nNew lines of conversation:\nHuman: Why do you think artificial intelligence is a force for good?\nAI: Because artificial intelligence will help humans reach their full potential.\n\nNew summary:\nThe human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good because it will help humans reach their full potential.\nEND OF EXAMPLE\n\nCurrent summary:\n{summary}\n\nNew lines of conversation:\n{new_lines}\n\nNew summary:`;\n\nexport const SUMMARY_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"summary\", \"new_lines\"],\n template: _DEFAULT_SUMMARIZER_TEMPLATE,\n});\n\nexport const _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE = `You are an assistant to a human, powered by a large language model trained by OpenAI.\n\nYou are designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, you are able to generate human-like text based on the input you receive, allowing you to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nYou are constantly learning and improving, and your capabilities are constantly evolving. You are able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. You have access to some personalized information provided by the human in the Context section below. Additionally, you are able to generate your own text based on the input you receive, allowing you to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, you are a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether the human needs help with a specific question or just wants to have a conversation about a particular topic, you are here to assist.\n\nContext:\n{entities}\n\nCurrent conversation:\n{history}\nLast line:\nHuman: {input}\nYou:`;\n\nexport const ENTITY_MEMORY_CONVERSATION_TEMPLATE =\n /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"entities\", \"history\", \"input\"],\n template: _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n });\n\nexport const _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = `You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.\n\nThe conversation history is provided just in case of a coreference (e.g. \"What do you know about him\" where \"him\" is defined in a previous line) -- ignore items mentioned there that are not in the last line.\n\nReturn the output as a single comma-separated list, or NONE if there is nothing of note to return (e.g. the user is just issuing a greeting or having a simple conversation).\n\nEXAMPLE\nConversation history:\nPerson #1: my name is Jacob. how's it going today?\nAI: \"It's going great! How about you?\"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: \"That sounds like a lot of work! What kind of things are you doing to make Langchain better?\"\nLast line:\nPerson #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff.\nOutput: Jacob,Langchain\nEND OF EXAMPLE\n\nEXAMPLE\nConversation history:\nPerson #1: how's it going today?\nAI: \"It's going great! How about you?\"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: \"That sounds like a lot of work! What kind of things are you doing to make Langchain better?\"\nLast line:\nPerson #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff. I'm working with Person #2.\nOutput: Langchain, Person #2\nEND OF EXAMPLE\n\nConversation history (for reference only):\n{history}\nLast line of conversation (for extraction):\nHuman: {input}\n\nOutput:`;\n\nexport const ENTITY_EXTRACTION_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"history\", \"input\"],\n template: _DEFAULT_ENTITY_EXTRACTION_TEMPLATE,\n});\n\nexport const _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = `You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the \"Entity\" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.\nThe update should only include facts that are relayed in the last line of conversation about the provided entity, and should only contain facts about the provided entity.\n\nIf there is no new information about the provided entity or the information is not worth noting (not an important or relevant fact to remember long-term), output the exact string \"UNCHANGED\" below.\n\nFull conversation history (for context):\n{history}\n\nEntity to summarize:\n{entity}\n\nExisting summary of {entity}:\n{summary}\n\nLast line of conversation:\nHuman: {input}\nUpdated summary (or the exact string \"UNCHANGED\" if there is no new information about {entity} above):`;\n\nexport const ENTITY_SUMMARIZATION_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"entity\", \"summary\", \"history\", \"input\"],\n template: _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE,\n});\n"],"mappings":";;AAwBA,MAAa,iCAA+B,IAAIA,wBAAAA,eAAe;CAC7D,gBAAgB,CAAC,WAAW,YAAY;CACxC,UAxBmC;;;;;;;;;;;;;;;;;;;;;CAyBpC,CAAC;AAmBF,MAAa,sDACG,IAAIA,wBAAAA,eAAe;CAC/B,gBAAgB;EAAC;EAAY;EAAW;EAAQ;CAChD,UApBwD;;;;;;;;;;;;;;;;CAqBzD,CAAC;AAqCJ,MAAa,2CAAyC,IAAIA,wBAAAA,eAAe;CACvE,gBAAgB,CAAC,WAAW,QAAQ;CACpC,UArCiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsClD,CAAC;AAoBF,MAAa,8CAA4C,IAAIA,wBAAAA,eAAe;CAC1E,gBAAgB;EAAC;EAAU;EAAW;EAAW;EAAQ;CACzD,UApBoD;;;;;;;;;;;;;;;;;CAqBrD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { PromptTemplate } from "@langchain/core/prompts";
2
-
3
- //#region src/memory/prompt.ts
4
- const _DEFAULT_SUMMARIZER_TEMPLATE = `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.
2
+ const SUMMARY_PROMPT = /* @__PURE__ */ new PromptTemplate({
3
+ inputVariables: ["summary", "new_lines"],
4
+ template: `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.
5
5
 
6
6
  EXAMPLE
7
7
  Current summary:
@@ -21,12 +21,15 @@ Current summary:
21
21
  New lines of conversation:
22
22
  {new_lines}
23
23
 
24
- New summary:`;
25
- const SUMMARY_PROMPT = /* @__PURE__ */ new PromptTemplate({
26
- inputVariables: ["summary", "new_lines"],
27
- template: _DEFAULT_SUMMARIZER_TEMPLATE
24
+ New summary:`
28
25
  });
29
- const _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE = `You are an assistant to a human, powered by a large language model trained by OpenAI.
26
+ const ENTITY_MEMORY_CONVERSATION_TEMPLATE = /* @__PURE__ */ new PromptTemplate({
27
+ inputVariables: [
28
+ "entities",
29
+ "history",
30
+ "input"
31
+ ],
32
+ template: `You are an assistant to a human, powered by a large language model trained by OpenAI.
30
33
 
31
34
  You are designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, you are able to generate human-like text based on the input you receive, allowing you to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.
32
35
 
@@ -41,16 +44,11 @@ Current conversation:
41
44
  {history}
42
45
  Last line:
43
46
  Human: {input}
44
- You:`;
45
- const ENTITY_MEMORY_CONVERSATION_TEMPLATE = /* @__PURE__ */ new PromptTemplate({
46
- inputVariables: [
47
- "entities",
48
- "history",
49
- "input"
50
- ],
51
- template: _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE
47
+ You:`
52
48
  });
53
- const _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = `You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.
49
+ const ENTITY_EXTRACTION_PROMPT = /* @__PURE__ */ new PromptTemplate({
50
+ inputVariables: ["history", "input"],
51
+ template: `You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.
54
52
 
55
53
  The conversation history is provided just in case of a coreference (e.g. "What do you know about him" where "him" is defined in a previous line) -- ignore items mentioned there that are not in the last line.
56
54
 
@@ -83,12 +81,16 @@ Conversation history (for reference only):
83
81
  Last line of conversation (for extraction):
84
82
  Human: {input}
85
83
 
86
- Output:`;
87
- const ENTITY_EXTRACTION_PROMPT = /* @__PURE__ */ new PromptTemplate({
88
- inputVariables: ["history", "input"],
89
- template: _DEFAULT_ENTITY_EXTRACTION_TEMPLATE
84
+ Output:`
90
85
  });
91
- const _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = `You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the "Entity" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.
86
+ const ENTITY_SUMMARIZATION_PROMPT = /* @__PURE__ */ new PromptTemplate({
87
+ inputVariables: [
88
+ "entity",
89
+ "summary",
90
+ "history",
91
+ "input"
92
+ ],
93
+ template: `You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the "Entity" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.
92
94
  The update should only include facts that are relayed in the last line of conversation about the provided entity, and should only contain facts about the provided entity.
93
95
 
94
96
  If there is no new information about the provided entity or the information is not worth noting (not an important or relevant fact to remember long-term), output the exact string "UNCHANGED" below.
@@ -104,17 +106,9 @@ Existing summary of {entity}:
104
106
 
105
107
  Last line of conversation:
106
108
  Human: {input}
107
- Updated summary (or the exact string "UNCHANGED" if there is no new information about {entity} above):`;
108
- const ENTITY_SUMMARIZATION_PROMPT = /* @__PURE__ */ new PromptTemplate({
109
- inputVariables: [
110
- "entity",
111
- "summary",
112
- "history",
113
- "input"
114
- ],
115
- template: _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE
109
+ Updated summary (or the exact string "UNCHANGED" if there is no new information about {entity} above):`
116
110
  });
117
-
118
111
  //#endregion
119
112
  export { ENTITY_EXTRACTION_PROMPT, ENTITY_MEMORY_CONVERSATION_TEMPLATE, ENTITY_SUMMARIZATION_PROMPT, SUMMARY_PROMPT };
113
+
120
114
  //# sourceMappingURL=prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","names":[],"sources":["../../src/memory/prompt.ts"],"sourcesContent":["import { PromptTemplate } from \"@langchain/core/prompts\";\n\nconst _DEFAULT_SUMMARIZER_TEMPLATE = `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.\n\nEXAMPLE\nCurrent summary:\nThe human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good.\n\nNew lines of conversation:\nHuman: Why do you think artificial intelligence is a force for good?\nAI: Because artificial intelligence will help humans reach their full potential.\n\nNew summary:\nThe human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good because it will help humans reach their full potential.\nEND OF EXAMPLE\n\nCurrent summary:\n{summary}\n\nNew lines of conversation:\n{new_lines}\n\nNew summary:`;\n\nexport const SUMMARY_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"summary\", \"new_lines\"],\n template: _DEFAULT_SUMMARIZER_TEMPLATE,\n});\n\nexport const _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE = `You are an assistant to a human, powered by a large language model trained by OpenAI.\n\nYou are designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, you are able to generate human-like text based on the input you receive, allowing you to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nYou are constantly learning and improving, and your capabilities are constantly evolving. You are able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. You have access to some personalized information provided by the human in the Context section below. Additionally, you are able to generate your own text based on the input you receive, allowing you to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, you are a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether the human needs help with a specific question or just wants to have a conversation about a particular topic, you are here to assist.\n\nContext:\n{entities}\n\nCurrent conversation:\n{history}\nLast line:\nHuman: {input}\nYou:`;\n\nexport const ENTITY_MEMORY_CONVERSATION_TEMPLATE =\n /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"entities\", \"history\", \"input\"],\n template: _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n });\n\nexport const _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = `You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.\n\nThe conversation history is provided just in case of a coreference (e.g. \"What do you know about him\" where \"him\" is defined in a previous line) -- ignore items mentioned there that are not in the last line.\n\nReturn the output as a single comma-separated list, or NONE if there is nothing of note to return (e.g. the user is just issuing a greeting or having a simple conversation).\n\nEXAMPLE\nConversation history:\nPerson #1: my name is Jacob. how's it going today?\nAI: \"It's going great! How about you?\"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: \"That sounds like a lot of work! What kind of things are you doing to make Langchain better?\"\nLast line:\nPerson #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff.\nOutput: Jacob,Langchain\nEND OF EXAMPLE\n\nEXAMPLE\nConversation history:\nPerson #1: how's it going today?\nAI: \"It's going great! How about you?\"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: \"That sounds like a lot of work! What kind of things are you doing to make Langchain better?\"\nLast line:\nPerson #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff. I'm working with Person #2.\nOutput: Langchain, Person #2\nEND OF EXAMPLE\n\nConversation history (for reference only):\n{history}\nLast line of conversation (for extraction):\nHuman: {input}\n\nOutput:`;\n\nexport const ENTITY_EXTRACTION_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"history\", \"input\"],\n template: _DEFAULT_ENTITY_EXTRACTION_TEMPLATE,\n});\n\nexport const _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = `You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the \"Entity\" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.\nThe update should only include facts that are relayed in the last line of conversation about the provided entity, and should only contain facts about the provided entity.\n\nIf there is no new information about the provided entity or the information is not worth noting (not an important or relevant fact to remember long-term), output the exact string \"UNCHANGED\" below.\n\nFull conversation history (for context):\n{history}\n\nEntity to summarize:\n{entity}\n\nExisting summary of {entity}:\n{summary}\n\nLast line of conversation:\nHuman: {input}\nUpdated summary (or the exact string \"UNCHANGED\" if there is no new information about {entity} above):`;\n\nexport const ENTITY_SUMMARIZATION_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"entity\", \"summary\", \"history\", \"input\"],\n template: _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE,\n});\n"],"mappings":";;;AAEA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;AAsBrC,MAAa,iCAA+B,IAAI,eAAe;CAC7D,gBAAgB,CAAC,WAAW,YAAY;CACxC,UAAU;CACX,CAAC;AAEF,MAAa,+CAA+C;;;;;;;;;;;;;;;;AAiB5D,MAAa,sDACG,IAAI,eAAe;CAC/B,gBAAgB;EAAC;EAAY;EAAW;EAAQ;CAChD,UAAU;CACX,CAAC;AAEJ,MAAa,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCnD,MAAa,2CAAyC,IAAI,eAAe;CACvE,gBAAgB,CAAC,WAAW,QAAQ;CACpC,UAAU;CACX,CAAC;AAEF,MAAa,yCAAyC;;;;;;;;;;;;;;;;;AAkBtD,MAAa,8CAA4C,IAAI,eAAe;CAC1E,gBAAgB;EAAC;EAAU;EAAW;EAAW;EAAQ;CACzD,UAAU;CACX,CAAC"}
1
+ {"version":3,"file":"prompt.js","names":[],"sources":["../../src/memory/prompt.ts"],"sourcesContent":["import { PromptTemplate } from \"@langchain/core/prompts\";\n\nconst _DEFAULT_SUMMARIZER_TEMPLATE = `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.\n\nEXAMPLE\nCurrent summary:\nThe human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good.\n\nNew lines of conversation:\nHuman: Why do you think artificial intelligence is a force for good?\nAI: Because artificial intelligence will help humans reach their full potential.\n\nNew summary:\nThe human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good because it will help humans reach their full potential.\nEND OF EXAMPLE\n\nCurrent summary:\n{summary}\n\nNew lines of conversation:\n{new_lines}\n\nNew summary:`;\n\nexport const SUMMARY_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"summary\", \"new_lines\"],\n template: _DEFAULT_SUMMARIZER_TEMPLATE,\n});\n\nexport const _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE = `You are an assistant to a human, powered by a large language model trained by OpenAI.\n\nYou are designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, you are able to generate human-like text based on the input you receive, allowing you to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nYou are constantly learning and improving, and your capabilities are constantly evolving. You are able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. You have access to some personalized information provided by the human in the Context section below. Additionally, you are able to generate your own text based on the input you receive, allowing you to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, you are a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether the human needs help with a specific question or just wants to have a conversation about a particular topic, you are here to assist.\n\nContext:\n{entities}\n\nCurrent conversation:\n{history}\nLast line:\nHuman: {input}\nYou:`;\n\nexport const ENTITY_MEMORY_CONVERSATION_TEMPLATE =\n /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"entities\", \"history\", \"input\"],\n template: _DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE,\n });\n\nexport const _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = `You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.\n\nThe conversation history is provided just in case of a coreference (e.g. \"What do you know about him\" where \"him\" is defined in a previous line) -- ignore items mentioned there that are not in the last line.\n\nReturn the output as a single comma-separated list, or NONE if there is nothing of note to return (e.g. the user is just issuing a greeting or having a simple conversation).\n\nEXAMPLE\nConversation history:\nPerson #1: my name is Jacob. how's it going today?\nAI: \"It's going great! How about you?\"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: \"That sounds like a lot of work! What kind of things are you doing to make Langchain better?\"\nLast line:\nPerson #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff.\nOutput: Jacob,Langchain\nEND OF EXAMPLE\n\nEXAMPLE\nConversation history:\nPerson #1: how's it going today?\nAI: \"It's going great! How about you?\"\nPerson #1: good! busy working on Langchain. lots to do.\nAI: \"That sounds like a lot of work! What kind of things are you doing to make Langchain better?\"\nLast line:\nPerson #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff. I'm working with Person #2.\nOutput: Langchain, Person #2\nEND OF EXAMPLE\n\nConversation history (for reference only):\n{history}\nLast line of conversation (for extraction):\nHuman: {input}\n\nOutput:`;\n\nexport const ENTITY_EXTRACTION_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"history\", \"input\"],\n template: _DEFAULT_ENTITY_EXTRACTION_TEMPLATE,\n});\n\nexport const _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = `You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update and add to the summary of the provided entity in the \"Entity\" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.\nThe update should only include facts that are relayed in the last line of conversation about the provided entity, and should only contain facts about the provided entity.\n\nIf there is no new information about the provided entity or the information is not worth noting (not an important or relevant fact to remember long-term), output the exact string \"UNCHANGED\" below.\n\nFull conversation history (for context):\n{history}\n\nEntity to summarize:\n{entity}\n\nExisting summary of {entity}:\n{summary}\n\nLast line of conversation:\nHuman: {input}\nUpdated summary (or the exact string \"UNCHANGED\" if there is no new information about {entity} above):`;\n\nexport const ENTITY_SUMMARIZATION_PROMPT = /*#__PURE__*/ new PromptTemplate({\n inputVariables: [\"entity\", \"summary\", \"history\", \"input\"],\n template: _DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE,\n});\n"],"mappings":";AAwBA,MAAa,iCAA+B,IAAI,eAAe;CAC7D,gBAAgB,CAAC,WAAW,YAAY;CACxC,UAxBmC;;;;;;;;;;;;;;;;;;;;;CAyBpC,CAAC;AAmBF,MAAa,sDACG,IAAI,eAAe;CAC/B,gBAAgB;EAAC;EAAY;EAAW;EAAQ;CAChD,UApBwD;;;;;;;;;;;;;;;;CAqBzD,CAAC;AAqCJ,MAAa,2CAAyC,IAAI,eAAe;CACvE,gBAAgB,CAAC,WAAW,QAAQ;CACpC,UArCiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsClD,CAAC;AAoBF,MAAa,8CAA4C,IAAI,eAAe;CAC1E,gBAAgB;EAAC;EAAU;EAAW;EAAW;EAAQ;CACzD,UApBoD;;;;;;;;;;;;;;;;;CAqBrD,CAAC"}
@@ -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/memory/stores/entity/base.ts
5
4
  /**
6
5
  * Base class for all entity stores. All entity stores should extend this
7
6
  * class.
8
7
  */
9
8
  var BaseEntityStore = class extends _langchain_core_load_serializable.Serializable {};
10
-
11
9
  //#endregion
12
10
  exports.BaseEntityStore = BaseEntityStore;
11
+
13
12
  //# sourceMappingURL=base.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.cjs","names":["Serializable"],"sources":["../../../../src/memory/stores/entity/base.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n\n/**\n * Base class for all entity stores. All entity stores should extend this\n * class.\n */\nexport abstract class BaseEntityStore extends Serializable {\n abstract get(key: string, defaultValue?: string): Promise<string | undefined>;\n\n abstract set(key: string, value?: string): Promise<void>;\n\n abstract delete(key: string): Promise<void>;\n\n abstract exists(key: string): Promise<boolean>;\n\n abstract clear(): Promise<void>;\n}\n"],"mappings":";;;;;;;;AAMA,IAAsB,kBAAtB,cAA8CA,+CAAa"}
1
+ {"version":3,"file":"base.cjs","names":["Serializable"],"sources":["../../../../src/memory/stores/entity/base.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n\n/**\n * Base class for all entity stores. All entity stores should extend this\n * class.\n */\nexport abstract class BaseEntityStore extends Serializable {\n abstract get(key: string, defaultValue?: string): Promise<string | undefined>;\n\n abstract set(key: string, value?: string): Promise<void>;\n\n abstract delete(key: string): Promise<void>;\n\n abstract exists(key: string): Promise<boolean>;\n\n abstract clear(): Promise<void>;\n}\n"],"mappings":";;;;;;;AAMA,IAAsB,kBAAtB,cAA8CA,kCAAAA,aAAa"}
@@ -1,12 +1,11 @@
1
1
  import { Serializable } from "@langchain/core/load/serializable";
2
-
3
2
  //#region src/memory/stores/entity/base.ts
4
3
  /**
5
4
  * Base class for all entity stores. All entity stores should extend this
6
5
  * class.
7
6
  */
8
7
  var BaseEntityStore = class extends Serializable {};
9
-
10
8
  //#endregion
11
9
  export { BaseEntityStore };
10
+
12
11
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":[],"sources":["../../../../src/memory/stores/entity/base.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n\n/**\n * Base class for all entity stores. All entity stores should extend this\n * class.\n */\nexport abstract class BaseEntityStore extends Serializable {\n abstract get(key: string, defaultValue?: string): Promise<string | undefined>;\n\n abstract set(key: string, value?: string): Promise<void>;\n\n abstract delete(key: string): Promise<void>;\n\n abstract exists(key: string): Promise<boolean>;\n\n abstract clear(): Promise<void>;\n}\n"],"mappings":";;;;;;;AAMA,IAAsB,kBAAtB,cAA8C,aAAa"}
1
+ {"version":3,"file":"base.js","names":[],"sources":["../../../../src/memory/stores/entity/base.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n\n/**\n * Base class for all entity stores. All entity stores should extend this\n * class.\n */\nexport abstract class BaseEntityStore extends Serializable {\n abstract get(key: string, defaultValue?: string): Promise<string | undefined>;\n\n abstract set(key: string, value?: string): Promise<void>;\n\n abstract delete(key: string): Promise<void>;\n\n abstract exists(key: string): Promise<boolean>;\n\n abstract clear(): Promise<void>;\n}\n"],"mappings":";;;;;;AAMA,IAAsB,kBAAtB,cAA8C,aAAa"}
@@ -1,5 +1,4 @@
1
- const require_base = require('./base.cjs');
2
-
1
+ const require_base = require("./base.cjs");
3
2
  //#region src/memory/stores/entity/in_memory.ts
4
3
  /**
5
4
  * An entity store that keeps data in memory. It extends from the
@@ -58,7 +57,7 @@ var InMemoryEntityStore = class extends require_base.BaseEntityStore {
58
57
  this.store = Object.create(null);
59
58
  }
60
59
  };
61
-
62
60
  //#endregion
63
61
  exports.InMemoryEntityStore = InMemoryEntityStore;
62
+
64
63
  //# sourceMappingURL=in_memory.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"in_memory.cjs","names":["BaseEntityStore"],"sources":["../../../../src/memory/stores/entity/in_memory.ts"],"sourcesContent":["import { BaseEntityStore } from \"./base.js\";\n\n/**\n * An entity store that keeps data in memory. It extends from the\n * `BaseEntityStore` class and is used to store and manage entities.\n */\nexport class InMemoryEntityStore extends BaseEntityStore {\n lc_namespace = [\"langchain\", \"stores\", \"entity\", \"in_memory\"];\n\n private store: Record<string, string | undefined>;\n\n constructor() {\n super();\n this.store = Object.create(null);\n }\n\n /**\n * Retrieves the value associated with the given key from the store. If\n * the key does not exist in the store, it returns the provided default\n * value.\n * @param key The key to retrieve the value for.\n * @param defaultValue The default value to return if the key does not exist in the store.\n * @returns The value associated with the key, or the default value if the key does not exist in the store.\n */\n async get(\n key: string,\n defaultValue: string | undefined\n ): Promise<string | undefined> {\n return key in this.store ? this.store[key] : defaultValue;\n }\n\n /**\n * Sets the value associated with the given key in the store.\n * @param key The key to set the value for.\n * @param value The value to set.\n */\n async set(key: string, value: string | undefined): Promise<void> {\n this.store[key] = value;\n }\n\n /**\n * Removes the key and its associated value from the store.\n * @param key The key to remove.\n */\n async delete(key: string): Promise<void> {\n delete this.store[key];\n }\n\n /**\n * Checks if a key exists in the store.\n * @param key The key to check.\n * @returns A boolean indicating whether the key exists in the store.\n */\n async exists(key: string): Promise<boolean> {\n return key in this.store;\n }\n\n /**\n * Removes all keys and their associated values from the store.\n */\n async clear(): Promise<void> {\n this.store = Object.create(null);\n }\n}\n"],"mappings":";;;;;;;AAMA,IAAa,sBAAb,cAAyCA,6BAAgB;CACvD,eAAe;EAAC;EAAa;EAAU;EAAU;EAAY;CAE7D,AAAQ;CAER,cAAc;AACZ,SAAO;AACP,OAAK,QAAQ,OAAO,OAAO,KAAK;;;;;;;;;;CAWlC,MAAM,IACJ,KACA,cAC6B;AAC7B,SAAO,OAAO,KAAK,QAAQ,KAAK,MAAM,OAAO;;;;;;;CAQ/C,MAAM,IAAI,KAAa,OAA0C;AAC/D,OAAK,MAAM,OAAO;;;;;;CAOpB,MAAM,OAAO,KAA4B;AACvC,SAAO,KAAK,MAAM;;;;;;;CAQpB,MAAM,OAAO,KAA+B;AAC1C,SAAO,OAAO,KAAK;;;;;CAMrB,MAAM,QAAuB;AAC3B,OAAK,QAAQ,OAAO,OAAO,KAAK"}
1
+ {"version":3,"file":"in_memory.cjs","names":["BaseEntityStore"],"sources":["../../../../src/memory/stores/entity/in_memory.ts"],"sourcesContent":["import { BaseEntityStore } from \"./base.js\";\n\n/**\n * An entity store that keeps data in memory. It extends from the\n * `BaseEntityStore` class and is used to store and manage entities.\n */\nexport class InMemoryEntityStore extends BaseEntityStore {\n lc_namespace = [\"langchain\", \"stores\", \"entity\", \"in_memory\"];\n\n private store: Record<string, string | undefined>;\n\n constructor() {\n super();\n this.store = Object.create(null);\n }\n\n /**\n * Retrieves the value associated with the given key from the store. If\n * the key does not exist in the store, it returns the provided default\n * value.\n * @param key The key to retrieve the value for.\n * @param defaultValue The default value to return if the key does not exist in the store.\n * @returns The value associated with the key, or the default value if the key does not exist in the store.\n */\n async get(\n key: string,\n defaultValue: string | undefined\n ): Promise<string | undefined> {\n return key in this.store ? this.store[key] : defaultValue;\n }\n\n /**\n * Sets the value associated with the given key in the store.\n * @param key The key to set the value for.\n * @param value The value to set.\n */\n async set(key: string, value: string | undefined): Promise<void> {\n this.store[key] = value;\n }\n\n /**\n * Removes the key and its associated value from the store.\n * @param key The key to remove.\n */\n async delete(key: string): Promise<void> {\n delete this.store[key];\n }\n\n /**\n * Checks if a key exists in the store.\n * @param key The key to check.\n * @returns A boolean indicating whether the key exists in the store.\n */\n async exists(key: string): Promise<boolean> {\n return key in this.store;\n }\n\n /**\n * Removes all keys and their associated values from the store.\n */\n async clear(): Promise<void> {\n this.store = Object.create(null);\n }\n}\n"],"mappings":";;;;;;AAMA,IAAa,sBAAb,cAAyCA,aAAAA,gBAAgB;CACvD,eAAe;EAAC;EAAa;EAAU;EAAU;EAAY;CAE7D;CAEA,cAAc;AACZ,SAAO;AACP,OAAK,QAAQ,OAAO,OAAO,KAAK;;;;;;;;;;CAWlC,MAAM,IACJ,KACA,cAC6B;AAC7B,SAAO,OAAO,KAAK,QAAQ,KAAK,MAAM,OAAO;;;;;;;CAQ/C,MAAM,IAAI,KAAa,OAA0C;AAC/D,OAAK,MAAM,OAAO;;;;;;CAOpB,MAAM,OAAO,KAA4B;AACvC,SAAO,KAAK,MAAM;;;;;;;CAQpB,MAAM,OAAO,KAA+B;AAC1C,SAAO,OAAO,KAAK;;;;;CAMrB,MAAM,QAAuB;AAC3B,OAAK,QAAQ,OAAO,OAAO,KAAK"}
@@ -1,5 +1,4 @@
1
1
  import { BaseEntityStore } from "./base.js";
2
-
3
2
  //#region src/memory/stores/entity/in_memory.ts
4
3
  /**
5
4
  * An entity store that keeps data in memory. It extends from the
@@ -58,7 +57,7 @@ var InMemoryEntityStore = class extends BaseEntityStore {
58
57
  this.store = Object.create(null);
59
58
  }
60
59
  };
61
-
62
60
  //#endregion
63
61
  export { InMemoryEntityStore };
62
+
64
63
  //# sourceMappingURL=in_memory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"in_memory.js","names":[],"sources":["../../../../src/memory/stores/entity/in_memory.ts"],"sourcesContent":["import { BaseEntityStore } from \"./base.js\";\n\n/**\n * An entity store that keeps data in memory. It extends from the\n * `BaseEntityStore` class and is used to store and manage entities.\n */\nexport class InMemoryEntityStore extends BaseEntityStore {\n lc_namespace = [\"langchain\", \"stores\", \"entity\", \"in_memory\"];\n\n private store: Record<string, string | undefined>;\n\n constructor() {\n super();\n this.store = Object.create(null);\n }\n\n /**\n * Retrieves the value associated with the given key from the store. If\n * the key does not exist in the store, it returns the provided default\n * value.\n * @param key The key to retrieve the value for.\n * @param defaultValue The default value to return if the key does not exist in the store.\n * @returns The value associated with the key, or the default value if the key does not exist in the store.\n */\n async get(\n key: string,\n defaultValue: string | undefined\n ): Promise<string | undefined> {\n return key in this.store ? this.store[key] : defaultValue;\n }\n\n /**\n * Sets the value associated with the given key in the store.\n * @param key The key to set the value for.\n * @param value The value to set.\n */\n async set(key: string, value: string | undefined): Promise<void> {\n this.store[key] = value;\n }\n\n /**\n * Removes the key and its associated value from the store.\n * @param key The key to remove.\n */\n async delete(key: string): Promise<void> {\n delete this.store[key];\n }\n\n /**\n * Checks if a key exists in the store.\n * @param key The key to check.\n * @returns A boolean indicating whether the key exists in the store.\n */\n async exists(key: string): Promise<boolean> {\n return key in this.store;\n }\n\n /**\n * Removes all keys and their associated values from the store.\n */\n async clear(): Promise<void> {\n this.store = Object.create(null);\n }\n}\n"],"mappings":";;;;;;;AAMA,IAAa,sBAAb,cAAyC,gBAAgB;CACvD,eAAe;EAAC;EAAa;EAAU;EAAU;EAAY;CAE7D,AAAQ;CAER,cAAc;AACZ,SAAO;AACP,OAAK,QAAQ,OAAO,OAAO,KAAK;;;;;;;;;;CAWlC,MAAM,IACJ,KACA,cAC6B;AAC7B,SAAO,OAAO,KAAK,QAAQ,KAAK,MAAM,OAAO;;;;;;;CAQ/C,MAAM,IAAI,KAAa,OAA0C;AAC/D,OAAK,MAAM,OAAO;;;;;;CAOpB,MAAM,OAAO,KAA4B;AACvC,SAAO,KAAK,MAAM;;;;;;;CAQpB,MAAM,OAAO,KAA+B;AAC1C,SAAO,OAAO,KAAK;;;;;CAMrB,MAAM,QAAuB;AAC3B,OAAK,QAAQ,OAAO,OAAO,KAAK"}
1
+ {"version":3,"file":"in_memory.js","names":[],"sources":["../../../../src/memory/stores/entity/in_memory.ts"],"sourcesContent":["import { BaseEntityStore } from \"./base.js\";\n\n/**\n * An entity store that keeps data in memory. It extends from the\n * `BaseEntityStore` class and is used to store and manage entities.\n */\nexport class InMemoryEntityStore extends BaseEntityStore {\n lc_namespace = [\"langchain\", \"stores\", \"entity\", \"in_memory\"];\n\n private store: Record<string, string | undefined>;\n\n constructor() {\n super();\n this.store = Object.create(null);\n }\n\n /**\n * Retrieves the value associated with the given key from the store. If\n * the key does not exist in the store, it returns the provided default\n * value.\n * @param key The key to retrieve the value for.\n * @param defaultValue The default value to return if the key does not exist in the store.\n * @returns The value associated with the key, or the default value if the key does not exist in the store.\n */\n async get(\n key: string,\n defaultValue: string | undefined\n ): Promise<string | undefined> {\n return key in this.store ? this.store[key] : defaultValue;\n }\n\n /**\n * Sets the value associated with the given key in the store.\n * @param key The key to set the value for.\n * @param value The value to set.\n */\n async set(key: string, value: string | undefined): Promise<void> {\n this.store[key] = value;\n }\n\n /**\n * Removes the key and its associated value from the store.\n * @param key The key to remove.\n */\n async delete(key: string): Promise<void> {\n delete this.store[key];\n }\n\n /**\n * Checks if a key exists in the store.\n * @param key The key to check.\n * @returns A boolean indicating whether the key exists in the store.\n */\n async exists(key: string): Promise<boolean> {\n return key in this.store;\n }\n\n /**\n * Removes all keys and their associated values from the store.\n */\n async clear(): Promise<void> {\n this.store = Object.create(null);\n }\n}\n"],"mappings":";;;;;;AAMA,IAAa,sBAAb,cAAyC,gBAAgB;CACvD,eAAe;EAAC;EAAa;EAAU;EAAU;EAAY;CAE7D;CAEA,cAAc;AACZ,SAAO;AACP,OAAK,QAAQ,OAAO,OAAO,KAAK;;;;;;;;;;CAWlC,MAAM,IACJ,KACA,cAC6B;AAC7B,SAAO,OAAO,KAAK,QAAQ,KAAK,MAAM,OAAO;;;;;;;CAQ/C,MAAM,IAAI,KAAa,OAA0C;AAC/D,OAAK,MAAM,OAAO;;;;;;CAOpB,MAAM,OAAO,KAA4B;AACvC,SAAO,KAAK,MAAM;;;;;;;CAQpB,MAAM,OAAO,KAA+B;AAC1C,SAAO,OAAO,KAAK;;;;;CAMrB,MAAM,QAAuB;AAC3B,OAAK,QAAQ,OAAO,OAAO,KAAK"}