@langchain/classic 1.0.17 → 1.0.18

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 (1628) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +24 -13
  3. package/dist/_virtual/_rolldown/runtime.js +36 -0
  4. package/dist/agents/agent.cjs +9 -11
  5. package/dist/agents/agent.cjs.map +1 -1
  6. package/dist/agents/agent.d.cts +0 -1
  7. package/dist/agents/agent.d.cts.map +1 -1
  8. package/dist/agents/agent.d.ts +2 -3
  9. package/dist/agents/agent.d.ts.map +1 -1
  10. package/dist/agents/agent.js +1 -3
  11. package/dist/agents/agent.js.map +1 -1
  12. package/dist/agents/chat/index.cjs +11 -15
  13. package/dist/agents/chat/index.cjs.map +1 -1
  14. package/dist/agents/chat/index.d.cts +0 -1
  15. package/dist/agents/chat/index.d.cts.map +1 -1
  16. package/dist/agents/chat/index.d.ts +0 -1
  17. package/dist/agents/chat/index.d.ts.map +1 -1
  18. package/dist/agents/chat/index.js +7 -11
  19. package/dist/agents/chat/index.js.map +1 -1
  20. package/dist/agents/chat/outputParser.cjs +4 -5
  21. package/dist/agents/chat/outputParser.cjs.map +1 -1
  22. package/dist/agents/chat/outputParser.d.cts +2 -3
  23. package/dist/agents/chat/outputParser.d.cts.map +1 -1
  24. package/dist/agents/chat/outputParser.d.ts +0 -1
  25. package/dist/agents/chat/outputParser.d.ts.map +1 -1
  26. package/dist/agents/chat/outputParser.js +1 -2
  27. package/dist/agents/chat/outputParser.js.map +1 -1
  28. package/dist/agents/chat/prompt.cjs.map +1 -1
  29. package/dist/agents/chat/prompt.js.map +1 -1
  30. package/dist/agents/chat_convo/index.cjs +21 -25
  31. package/dist/agents/chat_convo/index.cjs.map +1 -1
  32. package/dist/agents/chat_convo/index.d.cts +0 -1
  33. package/dist/agents/chat_convo/index.d.cts.map +1 -1
  34. package/dist/agents/chat_convo/index.d.ts +1 -2
  35. package/dist/agents/chat_convo/index.d.ts.map +1 -1
  36. package/dist/agents/chat_convo/index.js +11 -15
  37. package/dist/agents/chat_convo/index.js.map +1 -1
  38. package/dist/agents/chat_convo/outputParser.cjs +10 -13
  39. package/dist/agents/chat_convo/outputParser.cjs.map +1 -1
  40. package/dist/agents/chat_convo/outputParser.d.cts.map +1 -1
  41. package/dist/agents/chat_convo/outputParser.d.ts.map +1 -1
  42. package/dist/agents/chat_convo/outputParser.js +4 -7
  43. package/dist/agents/chat_convo/outputParser.js.map +1 -1
  44. package/dist/agents/chat_convo/prompt.cjs.map +1 -1
  45. package/dist/agents/chat_convo/prompt.js.map +1 -1
  46. package/dist/agents/executor.cjs +25 -33
  47. package/dist/agents/executor.cjs.map +1 -1
  48. package/dist/agents/executor.d.cts +0 -1
  49. package/dist/agents/executor.d.cts.map +1 -1
  50. package/dist/agents/executor.d.ts +0 -1
  51. package/dist/agents/executor.d.ts.map +1 -1
  52. package/dist/agents/executor.js +11 -19
  53. package/dist/agents/executor.js.map +1 -1
  54. package/dist/agents/format_scratchpad/log.cjs +4 -5
  55. package/dist/agents/format_scratchpad/log.cjs.map +1 -1
  56. package/dist/agents/format_scratchpad/log.d.cts +0 -1
  57. package/dist/agents/format_scratchpad/log.d.cts.map +1 -1
  58. package/dist/agents/format_scratchpad/log.d.ts +0 -1
  59. package/dist/agents/format_scratchpad/log.d.ts.map +1 -1
  60. package/dist/agents/format_scratchpad/log.js +3 -5
  61. package/dist/agents/format_scratchpad/log.js.map +1 -1
  62. package/dist/agents/format_scratchpad/log_to_message.cjs +8 -9
  63. package/dist/agents/format_scratchpad/log_to_message.cjs.map +1 -1
  64. package/dist/agents/format_scratchpad/log_to_message.d.cts.map +1 -1
  65. package/dist/agents/format_scratchpad/log_to_message.d.ts.map +1 -1
  66. package/dist/agents/format_scratchpad/log_to_message.js +4 -6
  67. package/dist/agents/format_scratchpad/log_to_message.js.map +1 -1
  68. package/dist/agents/format_scratchpad/openai_functions.cjs +9 -11
  69. package/dist/agents/format_scratchpad/openai_functions.cjs.map +1 -1
  70. package/dist/agents/format_scratchpad/openai_functions.d.cts +0 -1
  71. package/dist/agents/format_scratchpad/openai_functions.d.cts.map +1 -1
  72. package/dist/agents/format_scratchpad/openai_functions.d.ts +0 -1
  73. package/dist/agents/format_scratchpad/openai_functions.d.ts.map +1 -1
  74. package/dist/agents/format_scratchpad/openai_functions.js +5 -8
  75. package/dist/agents/format_scratchpad/openai_functions.js.map +1 -1
  76. package/dist/agents/format_scratchpad/openai_tools.cjs +3 -3
  77. package/dist/agents/format_scratchpad/openai_tools.js +2 -3
  78. package/dist/agents/format_scratchpad/tool_calling.cjs +8 -10
  79. package/dist/agents/format_scratchpad/tool_calling.cjs.map +1 -1
  80. package/dist/agents/format_scratchpad/tool_calling.d.cts +0 -1
  81. package/dist/agents/format_scratchpad/tool_calling.d.cts.map +1 -1
  82. package/dist/agents/format_scratchpad/tool_calling.d.ts +0 -1
  83. package/dist/agents/format_scratchpad/tool_calling.d.ts.map +1 -1
  84. package/dist/agents/format_scratchpad/tool_calling.js +5 -7
  85. package/dist/agents/format_scratchpad/tool_calling.js.map +1 -1
  86. package/dist/agents/format_scratchpad/xml.cjs +3 -3
  87. package/dist/agents/format_scratchpad/xml.cjs.map +1 -1
  88. package/dist/agents/format_scratchpad/xml.d.cts.map +1 -1
  89. package/dist/agents/format_scratchpad/xml.d.ts.map +1 -1
  90. package/dist/agents/format_scratchpad/xml.js +2 -3
  91. package/dist/agents/format_scratchpad/xml.js.map +1 -1
  92. package/dist/agents/helpers.cjs +2 -2
  93. package/dist/agents/helpers.cjs.map +1 -1
  94. package/dist/agents/helpers.js +2 -2
  95. package/dist/agents/helpers.js.map +1 -1
  96. package/dist/agents/index.cjs +6 -6
  97. package/dist/agents/index.js +2 -3
  98. package/dist/agents/initialize.cjs +12 -16
  99. package/dist/agents/initialize.cjs.map +1 -1
  100. package/dist/agents/initialize.d.cts +8 -2
  101. package/dist/agents/initialize.d.cts.map +1 -1
  102. package/dist/agents/initialize.d.ts +8 -2
  103. package/dist/agents/initialize.d.ts.map +1 -1
  104. package/dist/agents/initialize.js +12 -16
  105. package/dist/agents/initialize.js.map +1 -1
  106. package/dist/agents/load.cjs +5 -5
  107. package/dist/agents/load.cjs.map +1 -1
  108. package/dist/agents/load.d.cts +8 -2
  109. package/dist/agents/load.d.cts.map +1 -1
  110. package/dist/agents/load.d.ts +8 -2
  111. package/dist/agents/load.d.ts.map +1 -1
  112. package/dist/agents/load.js +4 -5
  113. package/dist/agents/load.js.map +1 -1
  114. package/dist/agents/mrkl/index.cjs +16 -21
  115. package/dist/agents/mrkl/index.cjs.map +1 -1
  116. package/dist/agents/mrkl/index.d.cts +0 -1
  117. package/dist/agents/mrkl/index.d.cts.map +1 -1
  118. package/dist/agents/mrkl/index.d.ts +0 -1
  119. package/dist/agents/mrkl/index.d.ts.map +1 -1
  120. package/dist/agents/mrkl/index.js +13 -18
  121. package/dist/agents/mrkl/index.js.map +1 -1
  122. package/dist/agents/mrkl/outputParser.cjs +4 -5
  123. package/dist/agents/mrkl/outputParser.cjs.map +1 -1
  124. package/dist/agents/mrkl/outputParser.d.cts +1 -2
  125. package/dist/agents/mrkl/outputParser.d.cts.map +1 -1
  126. package/dist/agents/mrkl/outputParser.d.ts +0 -1
  127. package/dist/agents/mrkl/outputParser.d.ts.map +1 -1
  128. package/dist/agents/mrkl/outputParser.js +1 -2
  129. package/dist/agents/mrkl/outputParser.js.map +1 -1
  130. package/dist/agents/mrkl/prompt.cjs.map +1 -1
  131. package/dist/agents/mrkl/prompt.js.map +1 -1
  132. package/dist/agents/openai/output_parser.cjs +3 -3
  133. package/dist/agents/openai/output_parser.js +2 -3
  134. package/dist/agents/openai_functions/index.cjs +22 -25
  135. package/dist/agents/openai_functions/index.cjs.map +1 -1
  136. package/dist/agents/openai_functions/index.d.cts +2 -5
  137. package/dist/agents/openai_functions/index.d.cts.map +1 -1
  138. package/dist/agents/openai_functions/index.d.ts +3 -6
  139. package/dist/agents/openai_functions/index.d.ts.map +1 -1
  140. package/dist/agents/openai_functions/index.js +8 -11
  141. package/dist/agents/openai_functions/index.js.map +1 -1
  142. package/dist/agents/openai_functions/output_parser.cjs +5 -5
  143. package/dist/agents/openai_functions/output_parser.cjs.map +1 -1
  144. package/dist/agents/openai_functions/output_parser.d.cts +0 -1
  145. package/dist/agents/openai_functions/output_parser.d.cts.map +1 -1
  146. package/dist/agents/openai_functions/output_parser.d.ts +1 -2
  147. package/dist/agents/openai_functions/output_parser.d.ts.map +1 -1
  148. package/dist/agents/openai_functions/output_parser.js +1 -1
  149. package/dist/agents/openai_functions/output_parser.js.map +1 -1
  150. package/dist/agents/openai_functions/prompt.cjs.map +1 -1
  151. package/dist/agents/openai_functions/prompt.js.map +1 -1
  152. package/dist/agents/openai_tools/index.cjs +8 -9
  153. package/dist/agents/openai_tools/index.cjs.map +1 -1
  154. package/dist/agents/openai_tools/index.d.cts +4 -6
  155. package/dist/agents/openai_tools/index.d.cts.map +1 -1
  156. package/dist/agents/openai_tools/index.d.ts +4 -6
  157. package/dist/agents/openai_tools/index.d.ts.map +1 -1
  158. package/dist/agents/openai_tools/index.js +3 -4
  159. package/dist/agents/openai_tools/index.js.map +1 -1
  160. package/dist/agents/openai_tools/output_parser.cjs +5 -6
  161. package/dist/agents/openai_tools/output_parser.cjs.map +1 -1
  162. package/dist/agents/openai_tools/output_parser.d.cts +0 -1
  163. package/dist/agents/openai_tools/output_parser.d.cts.map +1 -1
  164. package/dist/agents/openai_tools/output_parser.d.ts +1 -2
  165. package/dist/agents/openai_tools/output_parser.d.ts.map +1 -1
  166. package/dist/agents/openai_tools/output_parser.js +1 -2
  167. package/dist/agents/openai_tools/output_parser.js.map +1 -1
  168. package/dist/agents/react/index.cjs +5 -6
  169. package/dist/agents/react/index.cjs.map +1 -1
  170. package/dist/agents/react/index.d.cts +3 -5
  171. package/dist/agents/react/index.d.cts.map +1 -1
  172. package/dist/agents/react/index.d.ts +3 -5
  173. package/dist/agents/react/index.d.ts.map +1 -1
  174. package/dist/agents/react/index.js +2 -3
  175. package/dist/agents/react/index.js.map +1 -1
  176. package/dist/agents/react/output_parser.cjs +15 -22
  177. package/dist/agents/react/output_parser.cjs.map +1 -1
  178. package/dist/agents/react/output_parser.d.cts +0 -1
  179. package/dist/agents/react/output_parser.d.cts.map +1 -1
  180. package/dist/agents/react/output_parser.d.ts +0 -1
  181. package/dist/agents/react/output_parser.d.ts.map +1 -1
  182. package/dist/agents/react/output_parser.js +9 -17
  183. package/dist/agents/react/output_parser.js.map +1 -1
  184. package/dist/agents/react/prompt.cjs.map +1 -1
  185. package/dist/agents/react/prompt.js.map +1 -1
  186. package/dist/agents/structured_chat/index.cjs +26 -29
  187. package/dist/agents/structured_chat/index.cjs.map +1 -1
  188. package/dist/agents/structured_chat/index.d.cts +1 -4
  189. package/dist/agents/structured_chat/index.d.cts.map +1 -1
  190. package/dist/agents/structured_chat/index.d.ts +3 -6
  191. package/dist/agents/structured_chat/index.d.ts.map +1 -1
  192. package/dist/agents/structured_chat/index.js +12 -15
  193. package/dist/agents/structured_chat/index.js.map +1 -1
  194. package/dist/agents/structured_chat/outputParser.cjs +10 -13
  195. package/dist/agents/structured_chat/outputParser.cjs.map +1 -1
  196. package/dist/agents/structured_chat/outputParser.d.cts +0 -1
  197. package/dist/agents/structured_chat/outputParser.d.cts.map +1 -1
  198. package/dist/agents/structured_chat/outputParser.d.ts +0 -1
  199. package/dist/agents/structured_chat/outputParser.d.ts.map +1 -1
  200. package/dist/agents/structured_chat/outputParser.js +3 -6
  201. package/dist/agents/structured_chat/outputParser.js.map +1 -1
  202. package/dist/agents/structured_chat/prompt.cjs.map +1 -1
  203. package/dist/agents/structured_chat/prompt.js.map +1 -1
  204. package/dist/agents/tool_calling/index.cjs +5 -6
  205. package/dist/agents/tool_calling/index.cjs.map +1 -1
  206. package/dist/agents/tool_calling/index.d.cts +4 -6
  207. package/dist/agents/tool_calling/index.d.cts.map +1 -1
  208. package/dist/agents/tool_calling/index.d.ts +2 -4
  209. package/dist/agents/tool_calling/index.d.ts.map +1 -1
  210. package/dist/agents/tool_calling/index.js +2 -3
  211. package/dist/agents/tool_calling/index.js.map +1 -1
  212. package/dist/agents/tool_calling/output_parser.cjs +5 -5
  213. package/dist/agents/tool_calling/output_parser.cjs.map +1 -1
  214. package/dist/agents/tool_calling/output_parser.d.cts +0 -1
  215. package/dist/agents/tool_calling/output_parser.d.cts.map +1 -1
  216. package/dist/agents/tool_calling/output_parser.d.ts +1 -2
  217. package/dist/agents/tool_calling/output_parser.d.ts.map +1 -1
  218. package/dist/agents/tool_calling/output_parser.js +1 -1
  219. package/dist/agents/tool_calling/output_parser.js.map +1 -1
  220. package/dist/agents/toolkits/base.cjs +2 -2
  221. package/dist/agents/toolkits/conversational_retrieval/openai_functions.cjs +1 -2
  222. package/dist/agents/toolkits/conversational_retrieval/openai_functions.cjs.map +1 -1
  223. package/dist/agents/toolkits/conversational_retrieval/openai_functions.d.cts.map +1 -1
  224. package/dist/agents/toolkits/conversational_retrieval/openai_functions.d.ts.map +1 -1
  225. package/dist/agents/toolkits/conversational_retrieval/openai_functions.js +1 -2
  226. package/dist/agents/toolkits/conversational_retrieval/openai_functions.js.map +1 -1
  227. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.cjs +6 -6
  228. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.cjs.map +1 -1
  229. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts +0 -1
  230. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts.map +1 -1
  231. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.ts +0 -1
  232. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.ts.map +1 -1
  233. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.js.map +1 -1
  234. package/dist/agents/toolkits/conversational_retrieval/tool.cjs +6 -7
  235. package/dist/agents/toolkits/conversational_retrieval/tool.cjs.map +1 -1
  236. package/dist/agents/toolkits/conversational_retrieval/tool.d.cts.map +1 -1
  237. package/dist/agents/toolkits/conversational_retrieval/tool.d.ts.map +1 -1
  238. package/dist/agents/toolkits/conversational_retrieval/tool.js +2 -3
  239. package/dist/agents/toolkits/conversational_retrieval/tool.js.map +1 -1
  240. package/dist/agents/toolkits/index.cjs +3 -3
  241. package/dist/agents/toolkits/index.js +2 -3
  242. package/dist/agents/toolkits/json/json.cjs +11 -13
  243. package/dist/agents/toolkits/json/json.cjs.map +1 -1
  244. package/dist/agents/toolkits/json/json.d.cts +0 -1
  245. package/dist/agents/toolkits/json/json.d.cts.map +1 -1
  246. package/dist/agents/toolkits/json/json.d.ts +0 -1
  247. package/dist/agents/toolkits/json/json.d.ts.map +1 -1
  248. package/dist/agents/toolkits/json/json.js +8 -10
  249. package/dist/agents/toolkits/json/json.js.map +1 -1
  250. package/dist/agents/toolkits/json/prompt.cjs.map +1 -1
  251. package/dist/agents/toolkits/json/prompt.js.map +1 -1
  252. package/dist/agents/toolkits/openapi/openapi.cjs +14 -18
  253. package/dist/agents/toolkits/openapi/openapi.cjs.map +1 -1
  254. package/dist/agents/toolkits/openapi/openapi.d.cts +0 -1
  255. package/dist/agents/toolkits/openapi/openapi.d.cts.map +1 -1
  256. package/dist/agents/toolkits/openapi/openapi.d.ts +0 -1
  257. package/dist/agents/toolkits/openapi/openapi.d.ts.map +1 -1
  258. package/dist/agents/toolkits/openapi/openapi.js +10 -14
  259. package/dist/agents/toolkits/openapi/openapi.js.map +1 -1
  260. package/dist/agents/toolkits/openapi/prompt.cjs.map +1 -1
  261. package/dist/agents/toolkits/openapi/prompt.js.map +1 -1
  262. package/dist/agents/toolkits/sql/index.cjs +3 -3
  263. package/dist/agents/toolkits/sql/index.js +2 -3
  264. package/dist/agents/toolkits/sql/prompt.cjs.map +1 -1
  265. package/dist/agents/toolkits/sql/prompt.d.cts.map +1 -1
  266. package/dist/agents/toolkits/sql/prompt.d.ts.map +1 -1
  267. package/dist/agents/toolkits/sql/prompt.js.map +1 -1
  268. package/dist/agents/toolkits/sql/sql.cjs +13 -15
  269. package/dist/agents/toolkits/sql/sql.cjs.map +1 -1
  270. package/dist/agents/toolkits/sql/sql.d.cts +0 -1
  271. package/dist/agents/toolkits/sql/sql.d.cts.map +1 -1
  272. package/dist/agents/toolkits/sql/sql.d.ts +0 -1
  273. package/dist/agents/toolkits/sql/sql.d.ts.map +1 -1
  274. package/dist/agents/toolkits/sql/sql.js +8 -10
  275. package/dist/agents/toolkits/sql/sql.js.map +1 -1
  276. package/dist/agents/toolkits/vectorstore/prompt.cjs.map +1 -1
  277. package/dist/agents/toolkits/vectorstore/prompt.js.map +1 -1
  278. package/dist/agents/toolkits/vectorstore/vectorstore.cjs +20 -24
  279. package/dist/agents/toolkits/vectorstore/vectorstore.cjs.map +1 -1
  280. package/dist/agents/toolkits/vectorstore/vectorstore.d.cts +0 -1
  281. package/dist/agents/toolkits/vectorstore/vectorstore.d.cts.map +1 -1
  282. package/dist/agents/toolkits/vectorstore/vectorstore.d.ts +0 -1
  283. package/dist/agents/toolkits/vectorstore/vectorstore.d.ts.map +1 -1
  284. package/dist/agents/toolkits/vectorstore/vectorstore.js +16 -20
  285. package/dist/agents/toolkits/vectorstore/vectorstore.js.map +1 -1
  286. package/dist/agents/types.cjs +4 -4
  287. package/dist/agents/types.cjs.map +1 -1
  288. package/dist/agents/types.d.cts +0 -1
  289. package/dist/agents/types.d.cts.map +1 -1
  290. package/dist/agents/types.d.ts +1 -2
  291. package/dist/agents/types.d.ts.map +1 -1
  292. package/dist/agents/types.js.map +1 -1
  293. package/dist/agents/xml/index.cjs +12 -15
  294. package/dist/agents/xml/index.cjs.map +1 -1
  295. package/dist/agents/xml/index.d.cts +1 -4
  296. package/dist/agents/xml/index.d.cts.map +1 -1
  297. package/dist/agents/xml/index.d.ts +1 -4
  298. package/dist/agents/xml/index.d.ts.map +1 -1
  299. package/dist/agents/xml/index.js +7 -10
  300. package/dist/agents/xml/index.js.map +1 -1
  301. package/dist/agents/xml/output_parser.cjs +7 -9
  302. package/dist/agents/xml/output_parser.cjs.map +1 -1
  303. package/dist/agents/xml/output_parser.d.cts +0 -1
  304. package/dist/agents/xml/output_parser.d.cts.map +1 -1
  305. package/dist/agents/xml/output_parser.d.ts +0 -1
  306. package/dist/agents/xml/output_parser.d.ts.map +1 -1
  307. package/dist/agents/xml/output_parser.js +4 -7
  308. package/dist/agents/xml/output_parser.js.map +1 -1
  309. package/dist/agents/xml/prompt.cjs.map +1 -1
  310. package/dist/agents/xml/prompt.js.map +1 -1
  311. package/dist/cache/file_system.cjs +11 -9
  312. package/dist/cache/file_system.cjs.map +1 -1
  313. package/dist/cache/file_system.d.cts +0 -1
  314. package/dist/cache/file_system.d.cts.map +1 -1
  315. package/dist/cache/file_system.d.ts +0 -1
  316. package/dist/cache/file_system.d.ts.map +1 -1
  317. package/dist/cache/file_system.js +2 -3
  318. package/dist/cache/file_system.js.map +1 -1
  319. package/dist/callbacks/handlers/console.cjs +6 -6
  320. package/dist/callbacks/handlers/console.d.cts +3 -2
  321. package/dist/callbacks/handlers/console.d.cts.map +1 -1
  322. package/dist/callbacks/handlers/console.d.ts +3 -2
  323. package/dist/callbacks/handlers/console.d.ts.map +1 -1
  324. package/dist/callbacks/handlers/console.js +4 -4
  325. package/dist/callbacks/handlers/run_collector.cjs +6 -6
  326. package/dist/callbacks/handlers/run_collector.d.cts +3 -2
  327. package/dist/callbacks/handlers/run_collector.d.cts.map +1 -1
  328. package/dist/callbacks/handlers/run_collector.d.ts +3 -2
  329. package/dist/callbacks/handlers/run_collector.d.ts.map +1 -1
  330. package/dist/callbacks/handlers/run_collector.js +4 -4
  331. package/dist/callbacks/handlers/tracer.cjs +6 -6
  332. package/dist/callbacks/handlers/tracer.d.cts +3 -2
  333. package/dist/callbacks/handlers/tracer.d.cts.map +1 -1
  334. package/dist/callbacks/handlers/tracer.d.ts +3 -2
  335. package/dist/callbacks/handlers/tracer.d.ts.map +1 -1
  336. package/dist/callbacks/handlers/tracer.js +4 -4
  337. package/dist/callbacks/handlers/tracer_langchain.cjs +6 -6
  338. package/dist/callbacks/handlers/tracer_langchain.d.cts +3 -2
  339. package/dist/callbacks/handlers/tracer_langchain.d.cts.map +1 -1
  340. package/dist/callbacks/handlers/tracer_langchain.d.ts +3 -2
  341. package/dist/callbacks/handlers/tracer_langchain.d.ts.map +1 -1
  342. package/dist/callbacks/handlers/tracer_langchain.js +4 -4
  343. package/dist/callbacks/index.cjs +3 -3
  344. package/dist/callbacks/index.js +2 -3
  345. package/dist/callbacks/promises.cjs +6 -6
  346. package/dist/callbacks/promises.d.cts +3 -2
  347. package/dist/callbacks/promises.d.cts.map +1 -1
  348. package/dist/callbacks/promises.d.ts +3 -2
  349. package/dist/callbacks/promises.d.ts.map +1 -1
  350. package/dist/callbacks/promises.js +4 -4
  351. package/dist/chains/analyze_documents_chain.cjs +6 -8
  352. package/dist/chains/analyze_documents_chain.cjs.map +1 -1
  353. package/dist/chains/analyze_documents_chain.d.cts.map +1 -1
  354. package/dist/chains/analyze_documents_chain.d.ts +1 -1
  355. package/dist/chains/analyze_documents_chain.d.ts.map +1 -1
  356. package/dist/chains/analyze_documents_chain.js +3 -5
  357. package/dist/chains/analyze_documents_chain.js.map +1 -1
  358. package/dist/chains/api/api_chain.cjs +1 -2
  359. package/dist/chains/api/api_chain.cjs.map +1 -1
  360. package/dist/chains/api/api_chain.d.cts +0 -1
  361. package/dist/chains/api/api_chain.d.cts.map +1 -1
  362. package/dist/chains/api/api_chain.d.ts +0 -1
  363. package/dist/chains/api/api_chain.d.ts.map +1 -1
  364. package/dist/chains/api/api_chain.js +1 -2
  365. package/dist/chains/api/api_chain.js.map +1 -1
  366. package/dist/chains/api/prompts.cjs +4 -4
  367. package/dist/chains/api/prompts.cjs.map +1 -1
  368. package/dist/chains/api/prompts.js.map +1 -1
  369. package/dist/chains/base.cjs +12 -14
  370. package/dist/chains/base.cjs.map +1 -1
  371. package/dist/chains/base.d.cts +3 -0
  372. package/dist/chains/base.d.cts.map +1 -1
  373. package/dist/chains/base.d.ts +3 -0
  374. package/dist/chains/base.d.ts.map +1 -1
  375. package/dist/chains/base.js +3 -5
  376. package/dist/chains/base.js.map +1 -1
  377. package/dist/chains/chat_vector_db_chain.cjs +9 -11
  378. package/dist/chains/chat_vector_db_chain.cjs.map +1 -1
  379. package/dist/chains/chat_vector_db_chain.d.cts.map +1 -1
  380. package/dist/chains/chat_vector_db_chain.d.ts.map +1 -1
  381. package/dist/chains/chat_vector_db_chain.js +6 -8
  382. package/dist/chains/chat_vector_db_chain.js.map +1 -1
  383. package/dist/chains/combine_docs_chain.cjs +15 -24
  384. package/dist/chains/combine_docs_chain.cjs.map +1 -1
  385. package/dist/chains/combine_docs_chain.d.cts.map +1 -1
  386. package/dist/chains/combine_docs_chain.d.ts +1 -1
  387. package/dist/chains/combine_docs_chain.d.ts.map +1 -1
  388. package/dist/chains/combine_docs_chain.js +12 -21
  389. package/dist/chains/combine_docs_chain.js.map +1 -1
  390. package/dist/chains/combine_documents/base.cjs +5 -6
  391. package/dist/chains/combine_documents/base.cjs.map +1 -1
  392. package/dist/chains/combine_documents/base.js +2 -3
  393. package/dist/chains/combine_documents/base.js.map +1 -1
  394. package/dist/chains/combine_documents/index.cjs +3 -3
  395. package/dist/chains/combine_documents/index.js +2 -3
  396. package/dist/chains/combine_documents/reduce.cjs +5 -7
  397. package/dist/chains/combine_documents/reduce.cjs.map +1 -1
  398. package/dist/chains/combine_documents/reduce.d.cts +0 -1
  399. package/dist/chains/combine_documents/reduce.d.cts.map +1 -1
  400. package/dist/chains/combine_documents/reduce.d.ts +0 -1
  401. package/dist/chains/combine_documents/reduce.d.ts.map +1 -1
  402. package/dist/chains/combine_documents/reduce.js +4 -7
  403. package/dist/chains/combine_documents/reduce.js.map +1 -1
  404. package/dist/chains/combine_documents/stuff.cjs +6 -6
  405. package/dist/chains/combine_documents/stuff.cjs.map +1 -1
  406. package/dist/chains/combine_documents/stuff.d.cts +0 -1
  407. package/dist/chains/combine_documents/stuff.d.cts.map +1 -1
  408. package/dist/chains/combine_documents/stuff.d.ts +0 -1
  409. package/dist/chains/combine_documents/stuff.d.ts.map +1 -1
  410. package/dist/chains/combine_documents/stuff.js.map +1 -1
  411. package/dist/chains/constitutional_ai/constitutional_chain.cjs.map +1 -1
  412. package/dist/chains/constitutional_ai/constitutional_chain.d.cts +0 -1
  413. package/dist/chains/constitutional_ai/constitutional_chain.d.cts.map +1 -1
  414. package/dist/chains/constitutional_ai/constitutional_chain.d.ts +0 -1
  415. package/dist/chains/constitutional_ai/constitutional_chain.d.ts.map +1 -1
  416. package/dist/chains/constitutional_ai/constitutional_chain.js.map +1 -1
  417. package/dist/chains/constitutional_ai/constitutional_principle.cjs.map +1 -1
  418. package/dist/chains/constitutional_ai/constitutional_principle.d.cts +0 -1
  419. package/dist/chains/constitutional_ai/constitutional_principle.d.cts.map +1 -1
  420. package/dist/chains/constitutional_ai/constitutional_principle.d.ts +0 -1
  421. package/dist/chains/constitutional_ai/constitutional_principle.d.ts.map +1 -1
  422. package/dist/chains/constitutional_ai/constitutional_principle.js.map +1 -1
  423. package/dist/chains/constitutional_ai/constitutional_prompts.cjs +5 -5
  424. package/dist/chains/constitutional_ai/constitutional_prompts.cjs.map +1 -1
  425. package/dist/chains/constitutional_ai/constitutional_prompts.js.map +1 -1
  426. package/dist/chains/conversation.cjs +4 -4
  427. package/dist/chains/conversation.cjs.map +1 -1
  428. package/dist/chains/conversation.d.cts +0 -1
  429. package/dist/chains/conversation.d.cts.map +1 -1
  430. package/dist/chains/conversation.d.ts +0 -1
  431. package/dist/chains/conversation.d.ts.map +1 -1
  432. package/dist/chains/conversation.js +1 -1
  433. package/dist/chains/conversation.js.map +1 -1
  434. package/dist/chains/conversational_retrieval_chain.cjs +12 -14
  435. package/dist/chains/conversational_retrieval_chain.cjs.map +1 -1
  436. package/dist/chains/conversational_retrieval_chain.d.cts +2 -4
  437. package/dist/chains/conversational_retrieval_chain.d.cts.map +1 -1
  438. package/dist/chains/conversational_retrieval_chain.d.ts +3 -5
  439. package/dist/chains/conversational_retrieval_chain.d.ts.map +1 -1
  440. package/dist/chains/conversational_retrieval_chain.js +7 -9
  441. package/dist/chains/conversational_retrieval_chain.js.map +1 -1
  442. package/dist/chains/graph_qa/cypher.cjs +8 -10
  443. package/dist/chains/graph_qa/cypher.cjs.map +1 -1
  444. package/dist/chains/graph_qa/cypher.d.cts.map +1 -1
  445. package/dist/chains/graph_qa/cypher.d.ts.map +1 -1
  446. package/dist/chains/graph_qa/cypher.js +7 -10
  447. package/dist/chains/graph_qa/cypher.js.map +1 -1
  448. package/dist/chains/graph_qa/prompts.cjs +4 -4
  449. package/dist/chains/graph_qa/prompts.cjs.map +1 -1
  450. package/dist/chains/graph_qa/prompts.js.map +1 -1
  451. package/dist/chains/history_aware_retriever.cjs +7 -8
  452. package/dist/chains/history_aware_retriever.cjs.map +1 -1
  453. package/dist/chains/history_aware_retriever.d.cts +0 -1
  454. package/dist/chains/history_aware_retriever.d.cts.map +1 -1
  455. package/dist/chains/history_aware_retriever.d.ts +2 -3
  456. package/dist/chains/history_aware_retriever.d.ts.map +1 -1
  457. package/dist/chains/history_aware_retriever.js +3 -5
  458. package/dist/chains/history_aware_retriever.js.map +1 -1
  459. package/dist/chains/index.cjs +3 -3
  460. package/dist/chains/index.js +2 -3
  461. package/dist/chains/llm_chain.cjs +12 -15
  462. package/dist/chains/llm_chain.cjs.map +1 -1
  463. package/dist/chains/llm_chain.d.cts.map +1 -1
  464. package/dist/chains/llm_chain.d.ts +1 -1
  465. package/dist/chains/llm_chain.d.ts.map +1 -1
  466. package/dist/chains/llm_chain.js +3 -6
  467. package/dist/chains/llm_chain.js.map +1 -1
  468. package/dist/chains/load.cjs +3 -3
  469. package/dist/chains/load.cjs.map +1 -1
  470. package/dist/chains/load.d.cts +0 -1
  471. package/dist/chains/load.d.cts.map +1 -1
  472. package/dist/chains/load.d.ts +0 -1
  473. package/dist/chains/load.d.ts.map +1 -1
  474. package/dist/chains/load.js +2 -3
  475. package/dist/chains/load.js.map +1 -1
  476. package/dist/chains/openai_functions/base.cjs +8 -10
  477. package/dist/chains/openai_functions/base.cjs.map +1 -1
  478. package/dist/chains/openai_functions/base.d.cts +3 -7
  479. package/dist/chains/openai_functions/base.d.cts.map +1 -1
  480. package/dist/chains/openai_functions/base.d.ts +4 -8
  481. package/dist/chains/openai_functions/base.d.ts.map +1 -1
  482. package/dist/chains/openai_functions/base.js +5 -7
  483. package/dist/chains/openai_functions/base.js.map +1 -1
  484. package/dist/chains/openai_functions/extraction.cjs +5 -5
  485. package/dist/chains/openai_functions/extraction.cjs.map +1 -1
  486. package/dist/chains/openai_functions/extraction.d.cts +0 -1
  487. package/dist/chains/openai_functions/extraction.d.cts.map +1 -1
  488. package/dist/chains/openai_functions/extraction.d.ts +1 -2
  489. package/dist/chains/openai_functions/extraction.d.ts.map +1 -1
  490. package/dist/chains/openai_functions/extraction.js.map +1 -1
  491. package/dist/chains/openai_functions/index.cjs +3 -3
  492. package/dist/chains/openai_functions/index.js +2 -3
  493. package/dist/chains/openai_functions/openapi.cjs +12 -19
  494. package/dist/chains/openai_functions/openapi.cjs.map +1 -1
  495. package/dist/chains/openai_functions/openapi.d.cts +0 -2
  496. package/dist/chains/openai_functions/openapi.d.cts.map +1 -1
  497. package/dist/chains/openai_functions/openapi.d.ts +0 -2
  498. package/dist/chains/openai_functions/openapi.d.ts.map +1 -1
  499. package/dist/chains/openai_functions/openapi.js +9 -16
  500. package/dist/chains/openai_functions/openapi.js.map +1 -1
  501. package/dist/chains/openai_functions/tagging.cjs +5 -5
  502. package/dist/chains/openai_functions/tagging.cjs.map +1 -1
  503. package/dist/chains/openai_functions/tagging.d.cts +0 -1
  504. package/dist/chains/openai_functions/tagging.d.cts.map +1 -1
  505. package/dist/chains/openai_functions/tagging.d.ts +1 -2
  506. package/dist/chains/openai_functions/tagging.d.ts.map +1 -1
  507. package/dist/chains/openai_functions/tagging.js +1 -1
  508. package/dist/chains/openai_functions/tagging.js.map +1 -1
  509. package/dist/chains/openai_moderation.cjs +7 -7
  510. package/dist/chains/openai_moderation.cjs.map +1 -1
  511. package/dist/chains/openai_moderation.d.cts +0 -1
  512. package/dist/chains/openai_moderation.d.cts.map +1 -1
  513. package/dist/chains/openai_moderation.d.ts +0 -1
  514. package/dist/chains/openai_moderation.d.ts.map +1 -1
  515. package/dist/chains/openai_moderation.js.map +1 -1
  516. package/dist/chains/query_constructor/index.cjs +19 -25
  517. package/dist/chains/query_constructor/index.cjs.map +1 -1
  518. package/dist/chains/query_constructor/index.d.cts +0 -1
  519. package/dist/chains/query_constructor/index.d.cts.map +1 -1
  520. package/dist/chains/query_constructor/index.d.ts +0 -1
  521. package/dist/chains/query_constructor/index.d.ts.map +1 -1
  522. package/dist/chains/query_constructor/index.js +11 -18
  523. package/dist/chains/query_constructor/index.js.map +1 -1
  524. package/dist/chains/query_constructor/ir.cjs +7 -6
  525. package/dist/chains/query_constructor/ir.js +4 -4
  526. package/dist/chains/query_constructor/parser.cjs +8 -9
  527. package/dist/chains/query_constructor/parser.cjs.map +1 -1
  528. package/dist/chains/query_constructor/parser.d.cts +0 -1
  529. package/dist/chains/query_constructor/parser.d.cts.map +1 -1
  530. package/dist/chains/query_constructor/parser.d.ts +0 -1
  531. package/dist/chains/query_constructor/parser.d.ts.map +1 -1
  532. package/dist/chains/query_constructor/parser.js +1 -2
  533. package/dist/chains/query_constructor/parser.js.map +1 -1
  534. package/dist/chains/query_constructor/prompt.cjs +3 -3
  535. package/dist/chains/query_constructor/prompt.cjs.map +1 -1
  536. package/dist/chains/query_constructor/prompt.d.cts +0 -1
  537. package/dist/chains/query_constructor/prompt.d.cts.map +1 -1
  538. package/dist/chains/query_constructor/prompt.d.ts +0 -1
  539. package/dist/chains/query_constructor/prompt.d.ts.map +1 -1
  540. package/dist/chains/query_constructor/prompt.js.map +1 -1
  541. package/dist/chains/question_answering/load.cjs +32 -41
  542. package/dist/chains/question_answering/load.cjs.map +1 -1
  543. package/dist/chains/question_answering/load.d.cts +0 -1
  544. package/dist/chains/question_answering/load.d.cts.map +1 -1
  545. package/dist/chains/question_answering/load.d.ts +0 -1
  546. package/dist/chains/question_answering/load.d.ts.map +1 -1
  547. package/dist/chains/question_answering/load.js +32 -41
  548. package/dist/chains/question_answering/load.js.map +1 -1
  549. package/dist/chains/question_answering/map_reduce_prompts.cjs +13 -15
  550. package/dist/chains/question_answering/map_reduce_prompts.cjs.map +1 -1
  551. package/dist/chains/question_answering/map_reduce_prompts.js +4 -6
  552. package/dist/chains/question_answering/map_reduce_prompts.js.map +1 -1
  553. package/dist/chains/question_answering/refine_prompts.cjs +16 -18
  554. package/dist/chains/question_answering/refine_prompts.cjs.map +1 -1
  555. package/dist/chains/question_answering/refine_prompts.js +7 -9
  556. package/dist/chains/question_answering/refine_prompts.js.map +1 -1
  557. package/dist/chains/question_answering/stuff_prompts.cjs +8 -9
  558. package/dist/chains/question_answering/stuff_prompts.cjs.map +1 -1
  559. package/dist/chains/question_answering/stuff_prompts.js +2 -3
  560. package/dist/chains/question_answering/stuff_prompts.js.map +1 -1
  561. package/dist/chains/retrieval.cjs +7 -8
  562. package/dist/chains/retrieval.cjs.map +1 -1
  563. package/dist/chains/retrieval.d.cts +0 -1
  564. package/dist/chains/retrieval.d.cts.map +1 -1
  565. package/dist/chains/retrieval.d.ts +2 -3
  566. package/dist/chains/retrieval.d.ts.map +1 -1
  567. package/dist/chains/retrieval.js +3 -5
  568. package/dist/chains/retrieval.js.map +1 -1
  569. package/dist/chains/retrieval_qa.cjs.map +1 -1
  570. package/dist/chains/retrieval_qa.d.cts.map +1 -1
  571. package/dist/chains/retrieval_qa.d.ts.map +1 -1
  572. package/dist/chains/retrieval_qa.js.map +1 -1
  573. package/dist/chains/router/llm_router.cjs.map +1 -1
  574. package/dist/chains/router/llm_router.d.cts +0 -1
  575. package/dist/chains/router/llm_router.d.cts.map +1 -1
  576. package/dist/chains/router/llm_router.d.ts +0 -1
  577. package/dist/chains/router/llm_router.d.ts.map +1 -1
  578. package/dist/chains/router/llm_router.js.map +1 -1
  579. package/dist/chains/router/multi_prompt.cjs +8 -10
  580. package/dist/chains/router/multi_prompt.cjs.map +1 -1
  581. package/dist/chains/router/multi_prompt.d.cts +0 -1
  582. package/dist/chains/router/multi_prompt.d.cts.map +1 -1
  583. package/dist/chains/router/multi_prompt.d.ts +0 -1
  584. package/dist/chains/router/multi_prompt.d.ts.map +1 -1
  585. package/dist/chains/router/multi_prompt.js +3 -5
  586. package/dist/chains/router/multi_prompt.js.map +1 -1
  587. package/dist/chains/router/multi_prompt_prompt.cjs.map +1 -1
  588. package/dist/chains/router/multi_prompt_prompt.js.map +1 -1
  589. package/dist/chains/router/multi_retrieval_prompt.cjs.map +1 -1
  590. package/dist/chains/router/multi_retrieval_prompt.js.map +1 -1
  591. package/dist/chains/router/multi_retrieval_qa.cjs +15 -22
  592. package/dist/chains/router/multi_retrieval_qa.cjs.map +1 -1
  593. package/dist/chains/router/multi_retrieval_qa.d.cts +0 -1
  594. package/dist/chains/router/multi_retrieval_qa.d.cts.map +1 -1
  595. package/dist/chains/router/multi_retrieval_qa.d.ts +0 -1
  596. package/dist/chains/router/multi_retrieval_qa.d.ts.map +1 -1
  597. package/dist/chains/router/multi_retrieval_qa.js +11 -18
  598. package/dist/chains/router/multi_retrieval_qa.js.map +1 -1
  599. package/dist/chains/router/multi_route.cjs.map +1 -1
  600. package/dist/chains/router/multi_route.d.cts +0 -1
  601. package/dist/chains/router/multi_route.d.cts.map +1 -1
  602. package/dist/chains/router/multi_route.d.ts +0 -1
  603. package/dist/chains/router/multi_route.d.ts.map +1 -1
  604. package/dist/chains/router/multi_route.js.map +1 -1
  605. package/dist/chains/router/utils.cjs.map +1 -1
  606. package/dist/chains/router/utils.js.map +1 -1
  607. package/dist/chains/sequential_chain.cjs.map +1 -1
  608. package/dist/chains/sequential_chain.d.cts +0 -1
  609. package/dist/chains/sequential_chain.d.cts.map +1 -1
  610. package/dist/chains/sequential_chain.d.ts +0 -1
  611. package/dist/chains/sequential_chain.d.ts.map +1 -1
  612. package/dist/chains/sequential_chain.js.map +1 -1
  613. package/dist/chains/serde.d.cts +0 -1
  614. package/dist/chains/serde.d.cts.map +1 -1
  615. package/dist/chains/serde.d.ts +0 -1
  616. package/dist/chains/serde.d.ts.map +1 -1
  617. package/dist/chains/sql_db/index.cjs +3 -3
  618. package/dist/chains/sql_db/index.js +2 -3
  619. package/dist/chains/sql_db/sql_db_chain.cjs +19 -24
  620. package/dist/chains/sql_db/sql_db_chain.cjs.map +1 -1
  621. package/dist/chains/sql_db/sql_db_chain.d.cts +0 -1
  622. package/dist/chains/sql_db/sql_db_chain.d.cts.map +1 -1
  623. package/dist/chains/sql_db/sql_db_chain.d.ts +0 -1
  624. package/dist/chains/sql_db/sql_db_chain.d.ts.map +1 -1
  625. package/dist/chains/sql_db/sql_db_chain.js +13 -18
  626. package/dist/chains/sql_db/sql_db_chain.js.map +1 -1
  627. package/dist/chains/sql_db/sql_db_prompt.cjs +9 -9
  628. package/dist/chains/sql_db/sql_db_prompt.cjs.map +1 -1
  629. package/dist/chains/sql_db/sql_db_prompt.d.cts.map +1 -1
  630. package/dist/chains/sql_db/sql_db_prompt.d.ts.map +1 -1
  631. package/dist/chains/sql_db/sql_db_prompt.js.map +1 -1
  632. package/dist/chains/summarization/load.cjs +32 -41
  633. package/dist/chains/summarization/load.cjs.map +1 -1
  634. package/dist/chains/summarization/load.d.cts +0 -1
  635. package/dist/chains/summarization/load.d.cts.map +1 -1
  636. package/dist/chains/summarization/load.d.ts +0 -1
  637. package/dist/chains/summarization/load.d.ts.map +1 -1
  638. package/dist/chains/summarization/load.js +32 -41
  639. package/dist/chains/summarization/load.js.map +1 -1
  640. package/dist/chains/summarization/refine_prompts.cjs +3 -3
  641. package/dist/chains/summarization/refine_prompts.cjs.map +1 -1
  642. package/dist/chains/summarization/refine_prompts.js.map +1 -1
  643. package/dist/chains/summarization/stuff_prompts.cjs +3 -3
  644. package/dist/chains/summarization/stuff_prompts.cjs.map +1 -1
  645. package/dist/chains/summarization/stuff_prompts.js.map +1 -1
  646. package/dist/chains/transform.cjs.map +1 -1
  647. package/dist/chains/transform.d.cts +0 -1
  648. package/dist/chains/transform.d.cts.map +1 -1
  649. package/dist/chains/transform.d.ts +0 -1
  650. package/dist/chains/transform.d.ts.map +1 -1
  651. package/dist/chains/transform.js.map +1 -1
  652. package/dist/chains/vector_db_qa.cjs.map +1 -1
  653. package/dist/chains/vector_db_qa.d.cts.map +1 -1
  654. package/dist/chains/vector_db_qa.d.ts.map +1 -1
  655. package/dist/chains/vector_db_qa.js.map +1 -1
  656. package/dist/chat_models/universal.cjs +33 -39
  657. package/dist/chat_models/universal.cjs.map +1 -1
  658. package/dist/chat_models/universal.d.cts.map +1 -1
  659. package/dist/chat_models/universal.d.ts +1 -1
  660. package/dist/chat_models/universal.d.ts.map +1 -1
  661. package/dist/chat_models/universal.js +20 -27
  662. package/dist/chat_models/universal.js.map +1 -1
  663. package/dist/document.cjs +5 -5
  664. package/dist/document.js +2 -3
  665. package/dist/document_loaders/base.cjs +7 -6
  666. package/dist/document_loaders/base.js +4 -4
  667. package/dist/document_loaders/fs/buffer.cjs +7 -7
  668. package/dist/document_loaders/fs/buffer.cjs.map +1 -1
  669. package/dist/document_loaders/fs/buffer.d.cts +0 -1
  670. package/dist/document_loaders/fs/buffer.d.cts.map +1 -1
  671. package/dist/document_loaders/fs/buffer.d.ts +1 -2
  672. package/dist/document_loaders/fs/buffer.d.ts.map +1 -1
  673. package/dist/document_loaders/fs/buffer.js +2 -3
  674. package/dist/document_loaders/fs/buffer.js.map +1 -1
  675. package/dist/document_loaders/fs/directory.cjs +7 -7
  676. package/dist/document_loaders/fs/directory.cjs.map +1 -1
  677. package/dist/document_loaders/fs/directory.d.cts.map +1 -1
  678. package/dist/document_loaders/fs/directory.d.ts +1 -1
  679. package/dist/document_loaders/fs/directory.d.ts.map +1 -1
  680. package/dist/document_loaders/fs/directory.js +2 -3
  681. package/dist/document_loaders/fs/directory.js.map +1 -1
  682. package/dist/document_loaders/fs/json.cjs +7 -8
  683. package/dist/document_loaders/fs/json.cjs.map +1 -1
  684. package/dist/document_loaders/fs/json.d.cts +0 -1
  685. package/dist/document_loaders/fs/json.d.cts.map +1 -1
  686. package/dist/document_loaders/fs/json.d.ts +0 -1
  687. package/dist/document_loaders/fs/json.d.ts.map +1 -1
  688. package/dist/document_loaders/fs/json.js +4 -7
  689. package/dist/document_loaders/fs/json.js.map +1 -1
  690. package/dist/document_loaders/fs/multi_file.cjs +8 -9
  691. package/dist/document_loaders/fs/multi_file.cjs.map +1 -1
  692. package/dist/document_loaders/fs/multi_file.d.cts +0 -1
  693. package/dist/document_loaders/fs/multi_file.d.cts.map +1 -1
  694. package/dist/document_loaders/fs/multi_file.d.ts +0 -1
  695. package/dist/document_loaders/fs/multi_file.d.ts.map +1 -1
  696. package/dist/document_loaders/fs/multi_file.js +3 -5
  697. package/dist/document_loaders/fs/multi_file.js.map +1 -1
  698. package/dist/document_loaders/fs/text.cjs +9 -9
  699. package/dist/document_loaders/fs/text.cjs.map +1 -1
  700. package/dist/document_loaders/fs/text.d.cts +0 -1
  701. package/dist/document_loaders/fs/text.d.cts.map +1 -1
  702. package/dist/document_loaders/fs/text.d.ts +1 -2
  703. package/dist/document_loaders/fs/text.d.ts.map +1 -1
  704. package/dist/document_loaders/fs/text.js +3 -4
  705. package/dist/document_loaders/fs/text.js.map +1 -1
  706. package/dist/document_transformers/openai_functions.cjs +12 -14
  707. package/dist/document_transformers/openai_functions.cjs.map +1 -1
  708. package/dist/document_transformers/openai_functions.d.cts +0 -1
  709. package/dist/document_transformers/openai_functions.d.cts.map +1 -1
  710. package/dist/document_transformers/openai_functions.d.ts +1 -1
  711. package/dist/document_transformers/openai_functions.d.ts.map +1 -1
  712. package/dist/document_transformers/openai_functions.js +6 -9
  713. package/dist/document_transformers/openai_functions.js.map +1 -1
  714. package/dist/embeddings/cache_backed.cjs +7 -7
  715. package/dist/embeddings/cache_backed.cjs.map +1 -1
  716. package/dist/embeddings/cache_backed.d.cts +0 -1
  717. package/dist/embeddings/cache_backed.d.cts.map +1 -1
  718. package/dist/embeddings/cache_backed.d.ts +0 -1
  719. package/dist/embeddings/cache_backed.d.ts.map +1 -1
  720. package/dist/embeddings/cache_backed.js +2 -3
  721. package/dist/embeddings/cache_backed.js.map +1 -1
  722. package/dist/embeddings/fake.cjs +7 -6
  723. package/dist/embeddings/fake.js +4 -4
  724. package/dist/evaluation/agents/index.js +2 -0
  725. package/dist/evaluation/agents/prompt.cjs +15 -12
  726. package/dist/evaluation/agents/prompt.cjs.map +1 -1
  727. package/dist/evaluation/agents/prompt.js +3 -0
  728. package/dist/evaluation/agents/prompt.js.map +1 -1
  729. package/dist/evaluation/agents/trajectory.cjs +5 -5
  730. package/dist/evaluation/agents/trajectory.cjs.map +1 -1
  731. package/dist/evaluation/agents/trajectory.d.cts +2 -2
  732. package/dist/evaluation/agents/trajectory.d.cts.map +1 -1
  733. package/dist/evaluation/agents/trajectory.d.ts +2 -2
  734. package/dist/evaluation/agents/trajectory.d.ts.map +1 -1
  735. package/dist/evaluation/agents/trajectory.js.map +1 -1
  736. package/dist/evaluation/base.cjs.map +1 -1
  737. package/dist/evaluation/base.d.cts.map +1 -1
  738. package/dist/evaluation/base.d.ts.map +1 -1
  739. package/dist/evaluation/base.js.map +1 -1
  740. package/dist/evaluation/comparison/index.js +2 -0
  741. package/dist/evaluation/comparison/pairwise.cjs +16 -21
  742. package/dist/evaluation/comparison/pairwise.cjs.map +1 -1
  743. package/dist/evaluation/comparison/pairwise.d.cts +3 -3
  744. package/dist/evaluation/comparison/pairwise.d.cts.map +1 -1
  745. package/dist/evaluation/comparison/pairwise.d.ts +3 -3
  746. package/dist/evaluation/comparison/pairwise.d.ts.map +1 -1
  747. package/dist/evaluation/comparison/pairwise.js +11 -16
  748. package/dist/evaluation/comparison/pairwise.js.map +1 -1
  749. package/dist/evaluation/comparison/prompt.cjs +11 -4
  750. package/dist/evaluation/comparison/prompt.cjs.map +1 -1
  751. package/dist/evaluation/comparison/prompt.js +7 -0
  752. package/dist/evaluation/comparison/prompt.js.map +1 -1
  753. package/dist/evaluation/criteria/criteria.cjs +7 -9
  754. package/dist/evaluation/criteria/criteria.cjs.map +1 -1
  755. package/dist/evaluation/criteria/criteria.d.cts +3 -3
  756. package/dist/evaluation/criteria/criteria.d.cts.map +1 -1
  757. package/dist/evaluation/criteria/criteria.d.ts +3 -3
  758. package/dist/evaluation/criteria/criteria.d.ts.map +1 -1
  759. package/dist/evaluation/criteria/criteria.js +2 -4
  760. package/dist/evaluation/criteria/criteria.js.map +1 -1
  761. package/dist/evaluation/criteria/index.js +2 -0
  762. package/dist/evaluation/criteria/prompt.cjs +4 -4
  763. package/dist/evaluation/criteria/prompt.cjs.map +1 -1
  764. package/dist/evaluation/criteria/prompt.js.map +1 -1
  765. package/dist/evaluation/embedding_distance/base.cjs +5 -9
  766. package/dist/evaluation/embedding_distance/base.cjs.map +1 -1
  767. package/dist/evaluation/embedding_distance/base.d.cts +0 -1
  768. package/dist/evaluation/embedding_distance/base.d.cts.map +1 -1
  769. package/dist/evaluation/embedding_distance/base.d.ts +0 -1
  770. package/dist/evaluation/embedding_distance/base.d.ts.map +1 -1
  771. package/dist/evaluation/embedding_distance/base.js +5 -9
  772. package/dist/evaluation/embedding_distance/base.js.map +1 -1
  773. package/dist/evaluation/embedding_distance/index.js +2 -0
  774. package/dist/evaluation/index.cjs +3 -3
  775. package/dist/evaluation/index.js +2 -3
  776. package/dist/evaluation/loader.cjs +3 -3
  777. package/dist/evaluation/loader.cjs.map +1 -1
  778. package/dist/evaluation/loader.d.cts.map +1 -1
  779. package/dist/evaluation/loader.d.ts.map +1 -1
  780. package/dist/evaluation/loader.js.map +1 -1
  781. package/dist/evaluation/qa/eval_chain.cjs +1 -2
  782. package/dist/evaluation/qa/eval_chain.cjs.map +1 -1
  783. package/dist/evaluation/qa/eval_chain.d.cts.map +1 -1
  784. package/dist/evaluation/qa/eval_chain.d.ts.map +1 -1
  785. package/dist/evaluation/qa/eval_chain.js +1 -2
  786. package/dist/evaluation/qa/eval_chain.js.map +1 -1
  787. package/dist/evaluation/qa/index.js +2 -0
  788. package/dist/evaluation/qa/prompt.cjs +3 -3
  789. package/dist/evaluation/qa/prompt.cjs.map +1 -1
  790. package/dist/evaluation/qa/prompt.js.map +1 -1
  791. package/dist/evaluation/types.d.cts.map +1 -1
  792. package/dist/evaluation/types.d.ts.map +1 -1
  793. package/dist/experimental/autogpt/agent.cjs +18 -21
  794. package/dist/experimental/autogpt/agent.cjs.map +1 -1
  795. package/dist/experimental/autogpt/agent.d.cts +0 -1
  796. package/dist/experimental/autogpt/agent.d.cts.map +1 -1
  797. package/dist/experimental/autogpt/agent.d.ts +1 -2
  798. package/dist/experimental/autogpt/agent.d.ts.map +1 -1
  799. package/dist/experimental/autogpt/agent.js +12 -15
  800. package/dist/experimental/autogpt/agent.js.map +1 -1
  801. package/dist/experimental/autogpt/index.cjs +3 -3
  802. package/dist/experimental/autogpt/index.js +2 -3
  803. package/dist/experimental/autogpt/output_parser.cjs +3 -3
  804. package/dist/experimental/autogpt/output_parser.cjs.map +1 -1
  805. package/dist/experimental/autogpt/output_parser.d.cts +0 -1
  806. package/dist/experimental/autogpt/output_parser.d.cts.map +1 -1
  807. package/dist/experimental/autogpt/output_parser.d.ts +0 -1
  808. package/dist/experimental/autogpt/output_parser.d.ts.map +1 -1
  809. package/dist/experimental/autogpt/output_parser.js.map +1 -1
  810. package/dist/experimental/autogpt/prompt.cjs +13 -18
  811. package/dist/experimental/autogpt/prompt.cjs.map +1 -1
  812. package/dist/experimental/autogpt/prompt.d.cts +2 -2
  813. package/dist/experimental/autogpt/prompt.d.cts.map +1 -1
  814. package/dist/experimental/autogpt/prompt.d.ts +3 -3
  815. package/dist/experimental/autogpt/prompt.d.ts.map +1 -1
  816. package/dist/experimental/autogpt/prompt.js +7 -12
  817. package/dist/experimental/autogpt/prompt.js.map +1 -1
  818. package/dist/experimental/autogpt/prompt_generator.cjs +7 -11
  819. package/dist/experimental/autogpt/prompt_generator.cjs.map +1 -1
  820. package/dist/experimental/autogpt/prompt_generator.js +3 -7
  821. package/dist/experimental/autogpt/prompt_generator.js.map +1 -1
  822. package/dist/experimental/autogpt/schema.d.cts +0 -1
  823. package/dist/experimental/autogpt/schema.d.cts.map +1 -1
  824. package/dist/experimental/autogpt/schema.d.ts +0 -1
  825. package/dist/experimental/autogpt/schema.d.ts.map +1 -1
  826. package/dist/experimental/babyagi/agent.cjs +16 -20
  827. package/dist/experimental/babyagi/agent.cjs.map +1 -1
  828. package/dist/experimental/babyagi/agent.d.cts +0 -1
  829. package/dist/experimental/babyagi/agent.d.cts.map +1 -1
  830. package/dist/experimental/babyagi/agent.d.ts +0 -1
  831. package/dist/experimental/babyagi/agent.d.ts.map +1 -1
  832. package/dist/experimental/babyagi/agent.js +13 -17
  833. package/dist/experimental/babyagi/agent.js.map +1 -1
  834. package/dist/experimental/babyagi/index.cjs +3 -3
  835. package/dist/experimental/babyagi/index.js +2 -3
  836. package/dist/experimental/babyagi/task_creation.cjs +11 -13
  837. package/dist/experimental/babyagi/task_creation.cjs.map +1 -1
  838. package/dist/experimental/babyagi/task_creation.d.cts.map +1 -1
  839. package/dist/experimental/babyagi/task_creation.d.ts.map +1 -1
  840. package/dist/experimental/babyagi/task_creation.js +9 -11
  841. package/dist/experimental/babyagi/task_creation.js.map +1 -1
  842. package/dist/experimental/babyagi/task_execution.cjs +10 -12
  843. package/dist/experimental/babyagi/task_execution.cjs.map +1 -1
  844. package/dist/experimental/babyagi/task_execution.d.cts.map +1 -1
  845. package/dist/experimental/babyagi/task_execution.d.ts.map +1 -1
  846. package/dist/experimental/babyagi/task_execution.js +8 -10
  847. package/dist/experimental/babyagi/task_execution.js.map +1 -1
  848. package/dist/experimental/babyagi/task_prioritization.cjs +10 -12
  849. package/dist/experimental/babyagi/task_prioritization.cjs.map +1 -1
  850. package/dist/experimental/babyagi/task_prioritization.d.cts.map +1 -1
  851. package/dist/experimental/babyagi/task_prioritization.d.ts.map +1 -1
  852. package/dist/experimental/babyagi/task_prioritization.js +8 -10
  853. package/dist/experimental/babyagi/task_prioritization.js.map +1 -1
  854. package/dist/experimental/chains/violation_of_expectations/index.cjs +3 -3
  855. package/dist/experimental/chains/violation_of_expectations/index.js +2 -3
  856. package/dist/experimental/chains/violation_of_expectations/types.cjs.map +1 -1
  857. package/dist/experimental/chains/violation_of_expectations/types.d.cts +0 -1
  858. package/dist/experimental/chains/violation_of_expectations/types.d.cts.map +1 -1
  859. package/dist/experimental/chains/violation_of_expectations/types.d.ts +0 -1
  860. package/dist/experimental/chains/violation_of_expectations/types.d.ts.map +1 -1
  861. package/dist/experimental/chains/violation_of_expectations/types.js.map +1 -1
  862. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.cjs +20 -30
  863. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.cjs.map +1 -1
  864. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.d.cts +0 -1
  865. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.d.cts.map +1 -1
  866. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.d.ts +1 -2
  867. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.d.ts.map +1 -1
  868. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.js +16 -26
  869. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_chain.js.map +1 -1
  870. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.cjs +6 -6
  871. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.cjs.map +1 -1
  872. package/dist/experimental/chains/violation_of_expectations/violation_of_expectations_prompt.js.map +1 -1
  873. package/dist/experimental/generative_agents/generative_agent.cjs +30 -43
  874. package/dist/experimental/generative_agents/generative_agent.cjs.map +1 -1
  875. package/dist/experimental/generative_agents/generative_agent.d.cts +0 -1
  876. package/dist/experimental/generative_agents/generative_agent.d.cts.map +1 -1
  877. package/dist/experimental/generative_agents/generative_agent.d.ts +0 -1
  878. package/dist/experimental/generative_agents/generative_agent.d.ts.map +1 -1
  879. package/dist/experimental/generative_agents/generative_agent.js +23 -36
  880. package/dist/experimental/generative_agents/generative_agent.js.map +1 -1
  881. package/dist/experimental/generative_agents/generative_agent_memory.cjs +17 -26
  882. package/dist/experimental/generative_agents/generative_agent_memory.cjs.map +1 -1
  883. package/dist/experimental/generative_agents/generative_agent_memory.d.cts.map +1 -1
  884. package/dist/experimental/generative_agents/generative_agent_memory.d.ts +1 -1
  885. package/dist/experimental/generative_agents/generative_agent_memory.d.ts.map +1 -1
  886. package/dist/experimental/generative_agents/generative_agent_memory.js +9 -18
  887. package/dist/experimental/generative_agents/generative_agent_memory.js.map +1 -1
  888. package/dist/experimental/generative_agents/index.cjs +3 -3
  889. package/dist/experimental/generative_agents/index.js +2 -3
  890. package/dist/experimental/masking/index.cjs +3 -3
  891. package/dist/experimental/masking/index.js +2 -3
  892. package/dist/experimental/masking/parser.cjs.map +1 -1
  893. package/dist/experimental/masking/parser.d.cts +0 -1
  894. package/dist/experimental/masking/parser.d.cts.map +1 -1
  895. package/dist/experimental/masking/parser.d.ts +0 -1
  896. package/dist/experimental/masking/parser.d.ts.map +1 -1
  897. package/dist/experimental/masking/parser.js.map +1 -1
  898. package/dist/experimental/masking/regex_masking_transformer.cjs +1 -2
  899. package/dist/experimental/masking/regex_masking_transformer.cjs.map +1 -1
  900. package/dist/experimental/masking/regex_masking_transformer.d.cts +0 -1
  901. package/dist/experimental/masking/regex_masking_transformer.d.cts.map +1 -1
  902. package/dist/experimental/masking/regex_masking_transformer.d.ts +0 -1
  903. package/dist/experimental/masking/regex_masking_transformer.d.ts.map +1 -1
  904. package/dist/experimental/masking/regex_masking_transformer.js +1 -2
  905. package/dist/experimental/masking/regex_masking_transformer.js.map +1 -1
  906. package/dist/experimental/masking/transformer.cjs.map +1 -1
  907. package/dist/experimental/masking/transformer.d.cts.map +1 -1
  908. package/dist/experimental/masking/transformer.d.ts.map +1 -1
  909. package/dist/experimental/masking/transformer.js.map +1 -1
  910. package/dist/experimental/masking/types.d.cts +0 -1
  911. package/dist/experimental/masking/types.d.cts.map +1 -1
  912. package/dist/experimental/masking/types.d.ts +0 -1
  913. package/dist/experimental/masking/types.d.ts.map +1 -1
  914. package/dist/experimental/openai_assistant/index.cjs +32 -40
  915. package/dist/experimental/openai_assistant/index.cjs.map +1 -1
  916. package/dist/experimental/openai_assistant/index.d.cts.map +1 -1
  917. package/dist/experimental/openai_assistant/index.d.ts.map +1 -1
  918. package/dist/experimental/openai_assistant/index.js +21 -30
  919. package/dist/experimental/openai_assistant/index.js.map +1 -1
  920. package/dist/experimental/openai_assistant/schema.d.cts.map +1 -1
  921. package/dist/experimental/openai_assistant/schema.d.ts.map +1 -1
  922. package/dist/experimental/openai_files/index.cjs +7 -7
  923. package/dist/experimental/openai_files/index.cjs.map +1 -1
  924. package/dist/experimental/openai_files/index.d.cts.map +1 -1
  925. package/dist/experimental/openai_files/index.d.ts.map +1 -1
  926. package/dist/experimental/openai_files/index.js +2 -3
  927. package/dist/experimental/openai_files/index.js.map +1 -1
  928. package/dist/experimental/plan_and_execute/agent_executor.cjs +3 -5
  929. package/dist/experimental/plan_and_execute/agent_executor.cjs.map +1 -1
  930. package/dist/experimental/plan_and_execute/agent_executor.d.cts +0 -1
  931. package/dist/experimental/plan_and_execute/agent_executor.d.cts.map +1 -1
  932. package/dist/experimental/plan_and_execute/agent_executor.d.ts +0 -1
  933. package/dist/experimental/plan_and_execute/agent_executor.d.ts.map +1 -1
  934. package/dist/experimental/plan_and_execute/agent_executor.js +3 -5
  935. package/dist/experimental/plan_and_execute/agent_executor.js.map +1 -1
  936. package/dist/experimental/plan_and_execute/base.cjs +1 -2
  937. package/dist/experimental/plan_and_execute/base.cjs.map +1 -1
  938. package/dist/experimental/plan_and_execute/base.d.cts +0 -1
  939. package/dist/experimental/plan_and_execute/base.d.cts.map +1 -1
  940. package/dist/experimental/plan_and_execute/base.d.ts +0 -1
  941. package/dist/experimental/plan_and_execute/base.d.ts.map +1 -1
  942. package/dist/experimental/plan_and_execute/base.js +1 -2
  943. package/dist/experimental/plan_and_execute/base.js.map +1 -1
  944. package/dist/experimental/plan_and_execute/index.cjs +3 -3
  945. package/dist/experimental/plan_and_execute/index.js +2 -3
  946. package/dist/experimental/plan_and_execute/outputParser.cjs +3 -3
  947. package/dist/experimental/plan_and_execute/outputParser.cjs.map +1 -1
  948. package/dist/experimental/plan_and_execute/outputParser.d.cts +0 -1
  949. package/dist/experimental/plan_and_execute/outputParser.d.cts.map +1 -1
  950. package/dist/experimental/plan_and_execute/outputParser.d.ts +0 -1
  951. package/dist/experimental/plan_and_execute/outputParser.d.ts.map +1 -1
  952. package/dist/experimental/plan_and_execute/outputParser.js.map +1 -1
  953. package/dist/experimental/plan_and_execute/prompt.cjs +3 -3
  954. package/dist/experimental/plan_and_execute/prompt.cjs.map +1 -1
  955. package/dist/experimental/plan_and_execute/prompt.js.map +1 -1
  956. package/dist/experimental/prompts/custom_format.cjs +6 -6
  957. package/dist/experimental/prompts/custom_format.cjs.map +1 -1
  958. package/dist/experimental/prompts/custom_format.d.cts.map +1 -1
  959. package/dist/experimental/prompts/custom_format.d.ts.map +1 -1
  960. package/dist/experimental/prompts/custom_format.js +3 -4
  961. package/dist/experimental/prompts/custom_format.js.map +1 -1
  962. package/dist/experimental/prompts/handlebars.cjs +6 -6
  963. package/dist/experimental/prompts/handlebars.cjs.map +1 -1
  964. package/dist/experimental/prompts/handlebars.d.cts.map +1 -1
  965. package/dist/experimental/prompts/handlebars.d.ts.map +1 -1
  966. package/dist/experimental/prompts/handlebars.js +3 -5
  967. package/dist/experimental/prompts/handlebars.js.map +1 -1
  968. package/dist/hub/base.cjs +2 -5
  969. package/dist/hub/base.cjs.map +1 -1
  970. package/dist/hub/base.d.cts +2 -5
  971. package/dist/hub/base.d.cts.map +1 -1
  972. package/dist/hub/base.d.ts +2 -5
  973. package/dist/hub/base.d.ts.map +1 -1
  974. package/dist/hub/base.js +2 -5
  975. package/dist/hub/base.js.map +1 -1
  976. package/dist/hub/index.cjs +2 -2
  977. package/dist/hub/index.cjs.map +1 -1
  978. package/dist/hub/index.d.cts +0 -1
  979. package/dist/hub/index.d.cts.map +1 -1
  980. package/dist/hub/index.d.ts +0 -1
  981. package/dist/hub/index.d.ts.map +1 -1
  982. package/dist/hub/index.js +1 -2
  983. package/dist/hub/index.js.map +1 -1
  984. package/dist/hub/node.cjs +7 -13
  985. package/dist/hub/node.cjs.map +1 -1
  986. package/dist/hub/node.d.cts +0 -1
  987. package/dist/hub/node.d.cts.map +1 -1
  988. package/dist/hub/node.d.ts +0 -1
  989. package/dist/hub/node.d.ts.map +1 -1
  990. package/dist/hub/node.js +6 -13
  991. package/dist/hub/node.js.map +1 -1
  992. package/dist/index.cjs +3 -1
  993. package/dist/index.cjs.map +1 -1
  994. package/dist/index.js +3 -1
  995. package/dist/index.js.map +1 -1
  996. package/dist/indexes/index.cjs +16 -16
  997. package/dist/indexes/index.js +2 -3
  998. package/dist/load/import_constants.cjs.map +1 -1
  999. package/dist/load/import_constants.js.map +1 -1
  1000. package/dist/load/import_map.cjs +25 -26
  1001. package/dist/load/import_map.cjs.map +1 -1
  1002. package/dist/load/import_map.js +29 -30
  1003. package/dist/load/import_map.js.map +1 -1
  1004. package/dist/load/import_type.d.cts.map +1 -1
  1005. package/dist/load/import_type.d.ts.map +1 -1
  1006. package/dist/load/index.cjs +13 -3
  1007. package/dist/load/index.cjs.map +1 -1
  1008. package/dist/load/index.d.cts +9 -1
  1009. package/dist/load/index.d.cts.map +1 -1
  1010. package/dist/load/index.d.ts +9 -1
  1011. package/dist/load/index.d.ts.map +1 -1
  1012. package/dist/load/index.js +9 -0
  1013. package/dist/load/index.js.map +1 -1
  1014. package/dist/load/map_keys.d.cts.map +1 -1
  1015. package/dist/load/map_keys.d.ts.map +1 -1
  1016. package/dist/load/serializable.cjs +7 -6
  1017. package/dist/load/serializable.js +4 -4
  1018. package/dist/memory/buffer_memory.cjs +4 -8
  1019. package/dist/memory/buffer_memory.cjs.map +1 -1
  1020. package/dist/memory/buffer_memory.d.cts +0 -1
  1021. package/dist/memory/buffer_memory.d.cts.map +1 -1
  1022. package/dist/memory/buffer_memory.d.ts +0 -1
  1023. package/dist/memory/buffer_memory.d.ts.map +1 -1
  1024. package/dist/memory/buffer_memory.js +2 -6
  1025. package/dist/memory/buffer_memory.js.map +1 -1
  1026. package/dist/memory/buffer_token_memory.cjs +6 -10
  1027. package/dist/memory/buffer_token_memory.cjs.map +1 -1
  1028. package/dist/memory/buffer_token_memory.d.cts +0 -1
  1029. package/dist/memory/buffer_token_memory.d.cts.map +1 -1
  1030. package/dist/memory/buffer_token_memory.d.ts +0 -1
  1031. package/dist/memory/buffer_token_memory.d.ts.map +1 -1
  1032. package/dist/memory/buffer_token_memory.js +2 -6
  1033. package/dist/memory/buffer_token_memory.js.map +1 -1
  1034. package/dist/memory/buffer_window_memory.cjs +4 -8
  1035. package/dist/memory/buffer_window_memory.cjs.map +1 -1
  1036. package/dist/memory/buffer_window_memory.d.cts +0 -1
  1037. package/dist/memory/buffer_window_memory.d.cts.map +1 -1
  1038. package/dist/memory/buffer_window_memory.d.ts +0 -1
  1039. package/dist/memory/buffer_window_memory.d.ts.map +1 -1
  1040. package/dist/memory/buffer_window_memory.js +2 -6
  1041. package/dist/memory/buffer_window_memory.js.map +1 -1
  1042. package/dist/memory/chat_memory.cjs +9 -9
  1043. package/dist/memory/chat_memory.cjs.map +1 -1
  1044. package/dist/memory/chat_memory.d.cts +0 -1
  1045. package/dist/memory/chat_memory.d.cts.map +1 -1
  1046. package/dist/memory/chat_memory.d.ts +0 -1
  1047. package/dist/memory/chat_memory.d.ts.map +1 -1
  1048. package/dist/memory/chat_memory.js +2 -3
  1049. package/dist/memory/chat_memory.js.map +1 -1
  1050. package/dist/memory/combined_memory.cjs.map +1 -1
  1051. package/dist/memory/combined_memory.d.cts +0 -1
  1052. package/dist/memory/combined_memory.d.cts.map +1 -1
  1053. package/dist/memory/combined_memory.d.ts +0 -1
  1054. package/dist/memory/combined_memory.d.ts.map +1 -1
  1055. package/dist/memory/combined_memory.js.map +1 -1
  1056. package/dist/memory/entity_memory.cjs +7 -8
  1057. package/dist/memory/entity_memory.cjs.map +1 -1
  1058. package/dist/memory/entity_memory.d.cts +0 -1
  1059. package/dist/memory/entity_memory.d.cts.map +1 -1
  1060. package/dist/memory/entity_memory.d.ts +0 -1
  1061. package/dist/memory/entity_memory.d.ts.map +1 -1
  1062. package/dist/memory/entity_memory.js +1 -2
  1063. package/dist/memory/entity_memory.js.map +1 -1
  1064. package/dist/memory/index.cjs +16 -16
  1065. package/dist/memory/index.js +2 -3
  1066. package/dist/memory/prompt.cjs +6 -6
  1067. package/dist/memory/prompt.cjs.map +1 -1
  1068. package/dist/memory/prompt.d.cts +0 -1
  1069. package/dist/memory/prompt.d.cts.map +1 -1
  1070. package/dist/memory/prompt.d.ts +0 -1
  1071. package/dist/memory/prompt.d.ts.map +1 -1
  1072. package/dist/memory/prompt.js.map +1 -1
  1073. package/dist/memory/stores/entity/base.cjs +3 -3
  1074. package/dist/memory/stores/entity/base.cjs.map +1 -1
  1075. package/dist/memory/stores/entity/base.d.cts +0 -1
  1076. package/dist/memory/stores/entity/base.d.cts.map +1 -1
  1077. package/dist/memory/stores/entity/base.d.ts +0 -1
  1078. package/dist/memory/stores/entity/base.d.ts.map +1 -1
  1079. package/dist/memory/stores/entity/base.js.map +1 -1
  1080. package/dist/memory/stores/entity/in_memory.cjs.map +1 -1
  1081. package/dist/memory/stores/entity/in_memory.js.map +1 -1
  1082. package/dist/memory/summary.cjs +8 -13
  1083. package/dist/memory/summary.cjs.map +1 -1
  1084. package/dist/memory/summary.d.cts +0 -1
  1085. package/dist/memory/summary.d.cts.map +1 -1
  1086. package/dist/memory/summary.d.ts +1 -2
  1087. package/dist/memory/summary.d.ts.map +1 -1
  1088. package/dist/memory/summary.js +4 -9
  1089. package/dist/memory/summary.js.map +1 -1
  1090. package/dist/memory/summary_buffer.cjs +5 -5
  1091. package/dist/memory/summary_buffer.cjs.map +1 -1
  1092. package/dist/memory/summary_buffer.d.cts +0 -1
  1093. package/dist/memory/summary_buffer.d.cts.map +1 -1
  1094. package/dist/memory/summary_buffer.d.ts +0 -1
  1095. package/dist/memory/summary_buffer.d.ts.map +1 -1
  1096. package/dist/memory/summary_buffer.js.map +1 -1
  1097. package/dist/memory/vector_store.cjs +6 -6
  1098. package/dist/memory/vector_store.cjs.map +1 -1
  1099. package/dist/memory/vector_store.d.cts.map +1 -1
  1100. package/dist/memory/vector_store.d.ts.map +1 -1
  1101. package/dist/memory/vector_store.js +1 -1
  1102. package/dist/memory/vector_store.js.map +1 -1
  1103. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.cts +1242 -0
  1104. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.cts.map +1 -0
  1105. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.ts +1242 -0
  1106. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/client.d.ts.map +1 -0
  1107. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/_runner.d.cts +4 -0
  1108. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/_runner.d.ts +4 -0
  1109. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.cts +2 -0
  1110. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.ts +2 -0
  1111. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluator.d.cts +66 -0
  1112. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluator.d.cts.map +1 -0
  1113. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluator.d.ts +66 -0
  1114. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/evaluator.d.ts.map +1 -0
  1115. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/index.d.cts +4 -0
  1116. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/index.d.ts +4 -0
  1117. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/string_evaluator.d.cts +1 -0
  1118. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/evaluation/string_evaluator.d.ts +1 -0
  1119. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/index.d.cts +4 -0
  1120. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/index.d.ts +4 -0
  1121. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/run_trees.d.cts +145 -0
  1122. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/run_trees.d.cts.map +1 -0
  1123. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/run_trees.d.ts +145 -0
  1124. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/run_trees.d.ts.map +1 -0
  1125. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/schemas.d.cts +411 -0
  1126. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/schemas.d.cts.map +1 -0
  1127. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/schemas.d.ts +411 -0
  1128. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/schemas.d.ts.map +1 -0
  1129. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.cts +8 -0
  1130. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.cts.map +1 -0
  1131. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.ts +8 -0
  1132. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/traceable.d.ts.map +1 -0
  1133. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/types.d.cts +38 -0
  1134. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/types.d.cts.map +1 -0
  1135. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/types.d.ts +38 -0
  1136. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/singletons/types.d.ts.map +1 -0
  1137. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.cts +27 -0
  1138. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.cts.map +1 -0
  1139. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.ts +27 -0
  1140. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/async_caller.d.ts.map +1 -0
  1141. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/p-queue.d.cts +1 -0
  1142. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/p-queue.d.ts +1 -0
  1143. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/prompt_cache/index.d.cts +129 -0
  1144. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/prompt_cache/index.d.cts.map +1 -0
  1145. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/prompt_cache/index.d.ts +129 -0
  1146. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/dist/utils/prompt_cache/index.d.ts.map +1 -0
  1147. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/evaluation.d.cts +2 -0
  1148. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/evaluation.d.ts +2 -0
  1149. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/singletons/traceable.d.cts +2 -0
  1150. package/dist/node_modules/.pnpm/langsmith@0.5.3_@opentelemetry_api@1.9.0_openai@5.23.2_ws@8.19.0_bufferutil@4.1.0__zod@4.3.6_/node_modules/langsmith/singletons/traceable.d.ts +2 -0
  1151. package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.d.cts +1 -0
  1152. package/dist/node_modules/.pnpm/p-queue@6.6.2/node_modules/p-queue/dist/index.d.ts +1 -0
  1153. package/dist/output_parsers/combining.cjs +4 -4
  1154. package/dist/output_parsers/combining.cjs.map +1 -1
  1155. package/dist/output_parsers/combining.d.cts +0 -1
  1156. package/dist/output_parsers/combining.d.cts.map +1 -1
  1157. package/dist/output_parsers/combining.d.ts +0 -1
  1158. package/dist/output_parsers/combining.d.ts.map +1 -1
  1159. package/dist/output_parsers/combining.js +1 -1
  1160. package/dist/output_parsers/combining.js.map +1 -1
  1161. package/dist/output_parsers/datetime.cjs +4 -4
  1162. package/dist/output_parsers/datetime.cjs.map +1 -1
  1163. package/dist/output_parsers/datetime.d.cts +0 -1
  1164. package/dist/output_parsers/datetime.d.cts.map +1 -1
  1165. package/dist/output_parsers/datetime.d.ts +0 -1
  1166. package/dist/output_parsers/datetime.d.ts.map +1 -1
  1167. package/dist/output_parsers/datetime.js.map +1 -1
  1168. package/dist/output_parsers/expression.cjs +7 -9
  1169. package/dist/output_parsers/expression.cjs.map +1 -1
  1170. package/dist/output_parsers/expression.d.cts.map +1 -1
  1171. package/dist/output_parsers/expression.d.ts.map +1 -1
  1172. package/dist/output_parsers/expression.js +4 -7
  1173. package/dist/output_parsers/expression.js.map +1 -1
  1174. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs.map +1 -1
  1175. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js.map +1 -1
  1176. package/dist/output_parsers/expression_type_handlers/base.cjs +1 -2
  1177. package/dist/output_parsers/expression_type_handlers/base.cjs.map +1 -1
  1178. package/dist/output_parsers/expression_type_handlers/base.d.cts +0 -1
  1179. package/dist/output_parsers/expression_type_handlers/base.d.cts.map +1 -1
  1180. package/dist/output_parsers/expression_type_handlers/base.d.ts +0 -1
  1181. package/dist/output_parsers/expression_type_handlers/base.d.ts.map +1 -1
  1182. package/dist/output_parsers/expression_type_handlers/base.js +1 -2
  1183. package/dist/output_parsers/expression_type_handlers/base.js.map +1 -1
  1184. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.cjs.map +1 -1
  1185. package/dist/output_parsers/expression_type_handlers/boolean_literal_handler.js.map +1 -1
  1186. package/dist/output_parsers/expression_type_handlers/call_expression_handler.cjs.map +1 -1
  1187. package/dist/output_parsers/expression_type_handlers/call_expression_handler.js.map +1 -1
  1188. package/dist/output_parsers/expression_type_handlers/factory.cjs +1 -4
  1189. package/dist/output_parsers/expression_type_handlers/factory.cjs.map +1 -1
  1190. package/dist/output_parsers/expression_type_handlers/factory.d.cts +0 -1
  1191. package/dist/output_parsers/expression_type_handlers/factory.d.cts.map +1 -1
  1192. package/dist/output_parsers/expression_type_handlers/factory.d.ts +0 -1
  1193. package/dist/output_parsers/expression_type_handlers/factory.d.ts.map +1 -1
  1194. package/dist/output_parsers/expression_type_handlers/factory.js +1 -4
  1195. package/dist/output_parsers/expression_type_handlers/factory.js.map +1 -1
  1196. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.cjs.map +1 -1
  1197. package/dist/output_parsers/expression_type_handlers/grammar/parser_grammar.js.map +1 -1
  1198. package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs +1 -2
  1199. package/dist/output_parsers/expression_type_handlers/identifier_handler.cjs.map +1 -1
  1200. package/dist/output_parsers/expression_type_handlers/identifier_handler.js +1 -2
  1201. package/dist/output_parsers/expression_type_handlers/identifier_handler.js.map +1 -1
  1202. package/dist/output_parsers/expression_type_handlers/member_expression_handler.cjs.map +1 -1
  1203. package/dist/output_parsers/expression_type_handlers/member_expression_handler.js.map +1 -1
  1204. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.cjs.map +1 -1
  1205. package/dist/output_parsers/expression_type_handlers/numeric_literal_handler.js.map +1 -1
  1206. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.cjs.map +1 -1
  1207. package/dist/output_parsers/expression_type_handlers/object_literal_expression_handler.js.map +1 -1
  1208. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs +2 -4
  1209. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.cjs.map +1 -1
  1210. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js +2 -4
  1211. package/dist/output_parsers/expression_type_handlers/property_assignment_handler.js.map +1 -1
  1212. package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs +1 -2
  1213. package/dist/output_parsers/expression_type_handlers/string_literal_handler.cjs.map +1 -1
  1214. package/dist/output_parsers/expression_type_handlers/string_literal_handler.js +1 -2
  1215. package/dist/output_parsers/expression_type_handlers/string_literal_handler.js.map +1 -1
  1216. package/dist/output_parsers/expression_type_handlers/types.d.cts.map +1 -1
  1217. package/dist/output_parsers/expression_type_handlers/types.d.ts.map +1 -1
  1218. package/dist/output_parsers/fix.cjs +10 -16
  1219. package/dist/output_parsers/fix.cjs.map +1 -1
  1220. package/dist/output_parsers/fix.d.cts.map +1 -1
  1221. package/dist/output_parsers/fix.d.ts.map +1 -1
  1222. package/dist/output_parsers/fix.js +6 -12
  1223. package/dist/output_parsers/fix.js.map +1 -1
  1224. package/dist/output_parsers/http_response.cjs +5 -8
  1225. package/dist/output_parsers/http_response.cjs.map +1 -1
  1226. package/dist/output_parsers/http_response.d.cts.map +1 -1
  1227. package/dist/output_parsers/http_response.d.ts +1 -1
  1228. package/dist/output_parsers/http_response.d.ts.map +1 -1
  1229. package/dist/output_parsers/http_response.js +1 -4
  1230. package/dist/output_parsers/http_response.js.map +1 -1
  1231. package/dist/output_parsers/index.cjs +10 -10
  1232. package/dist/output_parsers/index.js +2 -3
  1233. package/dist/output_parsers/noop.cjs +3 -3
  1234. package/dist/output_parsers/noop.cjs.map +1 -1
  1235. package/dist/output_parsers/noop.js.map +1 -1
  1236. package/dist/output_parsers/openai_functions.cjs +15 -18
  1237. package/dist/output_parsers/openai_functions.cjs.map +1 -1
  1238. package/dist/output_parsers/openai_functions.d.cts +0 -1
  1239. package/dist/output_parsers/openai_functions.d.cts.map +1 -1
  1240. package/dist/output_parsers/openai_functions.d.ts +0 -1
  1241. package/dist/output_parsers/openai_functions.d.ts.map +1 -1
  1242. package/dist/output_parsers/openai_functions.js +6 -9
  1243. package/dist/output_parsers/openai_functions.js.map +1 -1
  1244. package/dist/output_parsers/openai_tools.cjs +5 -6
  1245. package/dist/output_parsers/openai_tools.cjs.map +1 -1
  1246. package/dist/output_parsers/openai_tools.d.cts +4 -9
  1247. package/dist/output_parsers/openai_tools.d.cts.map +1 -1
  1248. package/dist/output_parsers/openai_tools.d.ts +4 -9
  1249. package/dist/output_parsers/openai_tools.d.ts.map +1 -1
  1250. package/dist/output_parsers/openai_tools.js +1 -2
  1251. package/dist/output_parsers/openai_tools.js.map +1 -1
  1252. package/dist/output_parsers/prompts.cjs +3 -3
  1253. package/dist/output_parsers/prompts.cjs.map +1 -1
  1254. package/dist/output_parsers/prompts.js.map +1 -1
  1255. package/dist/output_parsers/regex.cjs +4 -4
  1256. package/dist/output_parsers/regex.cjs.map +1 -1
  1257. package/dist/output_parsers/regex.d.cts.map +1 -1
  1258. package/dist/output_parsers/regex.d.ts.map +1 -1
  1259. package/dist/output_parsers/regex.js.map +1 -1
  1260. package/dist/output_parsers/router.cjs +3 -3
  1261. package/dist/output_parsers/router.cjs.map +1 -1
  1262. package/dist/output_parsers/router.d.cts +0 -1
  1263. package/dist/output_parsers/router.d.cts.map +1 -1
  1264. package/dist/output_parsers/router.d.ts +0 -1
  1265. package/dist/output_parsers/router.d.ts.map +1 -1
  1266. package/dist/output_parsers/router.js.map +1 -1
  1267. package/dist/output_parsers/structured.cjs +19 -20
  1268. package/dist/output_parsers/structured.cjs.map +1 -1
  1269. package/dist/output_parsers/structured.d.cts.map +1 -1
  1270. package/dist/output_parsers/structured.d.ts.map +1 -1
  1271. package/dist/output_parsers/structured.js +6 -7
  1272. package/dist/output_parsers/structured.js.map +1 -1
  1273. package/dist/retrievers/contextual_compression.cjs +6 -7
  1274. package/dist/retrievers/contextual_compression.cjs.map +1 -1
  1275. package/dist/retrievers/contextual_compression.d.cts +0 -1
  1276. package/dist/retrievers/contextual_compression.d.cts.map +1 -1
  1277. package/dist/retrievers/contextual_compression.d.ts +1 -2
  1278. package/dist/retrievers/contextual_compression.d.ts.map +1 -1
  1279. package/dist/retrievers/contextual_compression.js +3 -5
  1280. package/dist/retrievers/contextual_compression.js.map +1 -1
  1281. package/dist/retrievers/document_compressors/chain_extract.cjs +16 -19
  1282. package/dist/retrievers/document_compressors/chain_extract.cjs.map +1 -1
  1283. package/dist/retrievers/document_compressors/chain_extract.d.cts +0 -1
  1284. package/dist/retrievers/document_compressors/chain_extract.d.cts.map +1 -1
  1285. package/dist/retrievers/document_compressors/chain_extract.d.ts +1 -2
  1286. package/dist/retrievers/document_compressors/chain_extract.d.ts.map +1 -1
  1287. package/dist/retrievers/document_compressors/chain_extract.js +10 -14
  1288. package/dist/retrievers/document_compressors/chain_extract.js.map +1 -1
  1289. package/dist/retrievers/document_compressors/chain_extract_prompt.cjs.map +1 -1
  1290. package/dist/retrievers/document_compressors/chain_extract_prompt.js.map +1 -1
  1291. package/dist/retrievers/document_compressors/embeddings_filter.cjs +5 -5
  1292. package/dist/retrievers/document_compressors/embeddings_filter.cjs.map +1 -1
  1293. package/dist/retrievers/document_compressors/embeddings_filter.d.cts +0 -1
  1294. package/dist/retrievers/document_compressors/embeddings_filter.d.cts.map +1 -1
  1295. package/dist/retrievers/document_compressors/embeddings_filter.d.ts +0 -1
  1296. package/dist/retrievers/document_compressors/embeddings_filter.d.ts.map +1 -1
  1297. package/dist/retrievers/document_compressors/embeddings_filter.js +2 -3
  1298. package/dist/retrievers/document_compressors/embeddings_filter.js.map +1 -1
  1299. package/dist/retrievers/document_compressors/index.cjs +3 -3
  1300. package/dist/retrievers/document_compressors/index.cjs.map +1 -1
  1301. package/dist/retrievers/document_compressors/index.d.cts +0 -1
  1302. package/dist/retrievers/document_compressors/index.d.cts.map +1 -1
  1303. package/dist/retrievers/document_compressors/index.d.ts +1 -2
  1304. package/dist/retrievers/document_compressors/index.d.ts.map +1 -1
  1305. package/dist/retrievers/document_compressors/index.js +2 -3
  1306. package/dist/retrievers/document_compressors/index.js.map +1 -1
  1307. package/dist/retrievers/ensemble.cjs +7 -9
  1308. package/dist/retrievers/ensemble.cjs.map +1 -1
  1309. package/dist/retrievers/ensemble.d.cts.map +1 -1
  1310. package/dist/retrievers/ensemble.d.ts +1 -1
  1311. package/dist/retrievers/ensemble.d.ts.map +1 -1
  1312. package/dist/retrievers/ensemble.js +4 -7
  1313. package/dist/retrievers/ensemble.js.map +1 -1
  1314. package/dist/retrievers/hyde.cjs +11 -13
  1315. package/dist/retrievers/hyde.cjs.map +1 -1
  1316. package/dist/retrievers/hyde.d.cts +0 -1
  1317. package/dist/retrievers/hyde.d.cts.map +1 -1
  1318. package/dist/retrievers/hyde.d.ts +1 -2
  1319. package/dist/retrievers/hyde.d.ts.map +1 -1
  1320. package/dist/retrievers/hyde.js +4 -7
  1321. package/dist/retrievers/hyde.js.map +1 -1
  1322. package/dist/retrievers/matryoshka_retriever.cjs +9 -9
  1323. package/dist/retrievers/matryoshka_retriever.cjs.map +1 -1
  1324. package/dist/retrievers/matryoshka_retriever.d.cts +0 -1
  1325. package/dist/retrievers/matryoshka_retriever.d.cts.map +1 -1
  1326. package/dist/retrievers/matryoshka_retriever.d.ts +0 -1
  1327. package/dist/retrievers/matryoshka_retriever.d.ts.map +1 -1
  1328. package/dist/retrievers/matryoshka_retriever.js +2 -3
  1329. package/dist/retrievers/matryoshka_retriever.js.map +1 -1
  1330. package/dist/retrievers/multi_query.cjs +15 -19
  1331. package/dist/retrievers/multi_query.cjs.map +1 -1
  1332. package/dist/retrievers/multi_query.d.cts.map +1 -1
  1333. package/dist/retrievers/multi_query.d.ts +1 -1
  1334. package/dist/retrievers/multi_query.d.ts.map +1 -1
  1335. package/dist/retrievers/multi_query.js +8 -13
  1336. package/dist/retrievers/multi_query.js.map +1 -1
  1337. package/dist/retrievers/multi_vector.cjs +6 -7
  1338. package/dist/retrievers/multi_vector.cjs.map +1 -1
  1339. package/dist/retrievers/multi_vector.d.cts +0 -1
  1340. package/dist/retrievers/multi_vector.d.cts.map +1 -1
  1341. package/dist/retrievers/multi_vector.d.ts +0 -1
  1342. package/dist/retrievers/multi_vector.d.ts.map +1 -1
  1343. package/dist/retrievers/multi_vector.js +3 -5
  1344. package/dist/retrievers/multi_vector.js.map +1 -1
  1345. package/dist/retrievers/parent_document.cjs +8 -9
  1346. package/dist/retrievers/parent_document.cjs.map +1 -1
  1347. package/dist/retrievers/parent_document.d.cts.map +1 -1
  1348. package/dist/retrievers/parent_document.d.ts +1 -1
  1349. package/dist/retrievers/parent_document.d.ts.map +1 -1
  1350. package/dist/retrievers/parent_document.js +4 -7
  1351. package/dist/retrievers/parent_document.js.map +1 -1
  1352. package/dist/retrievers/score_threshold.cjs +6 -7
  1353. package/dist/retrievers/score_threshold.cjs.map +1 -1
  1354. package/dist/retrievers/score_threshold.d.cts.map +1 -1
  1355. package/dist/retrievers/score_threshold.d.ts.map +1 -1
  1356. package/dist/retrievers/score_threshold.js +3 -5
  1357. package/dist/retrievers/score_threshold.js.map +1 -1
  1358. package/dist/retrievers/self_query/functional.cjs +5 -5
  1359. package/dist/retrievers/self_query/functional.js +2 -3
  1360. package/dist/retrievers/self_query/index.cjs +13 -13
  1361. package/dist/retrievers/self_query/index.cjs.map +1 -1
  1362. package/dist/retrievers/self_query/index.d.cts +0 -1
  1363. package/dist/retrievers/self_query/index.d.cts.map +1 -1
  1364. package/dist/retrievers/self_query/index.d.ts +1 -2
  1365. package/dist/retrievers/self_query/index.d.ts.map +1 -1
  1366. package/dist/retrievers/self_query/index.js +3 -4
  1367. package/dist/retrievers/self_query/index.js.map +1 -1
  1368. package/dist/retrievers/time_weighted.cjs +6 -7
  1369. package/dist/retrievers/time_weighted.cjs.map +1 -1
  1370. package/dist/retrievers/time_weighted.d.cts +0 -1
  1371. package/dist/retrievers/time_weighted.d.cts.map +1 -1
  1372. package/dist/retrievers/time_weighted.d.ts +1 -2
  1373. package/dist/retrievers/time_weighted.d.ts.map +1 -1
  1374. package/dist/retrievers/time_weighted.js +3 -5
  1375. package/dist/retrievers/time_weighted.js.map +1 -1
  1376. package/dist/schema/prompt_template.cjs +3 -3
  1377. package/dist/schema/prompt_template.cjs.map +1 -1
  1378. package/dist/schema/prompt_template.d.cts +0 -1
  1379. package/dist/schema/prompt_template.d.cts.map +1 -1
  1380. package/dist/schema/prompt_template.d.ts +1 -2
  1381. package/dist/schema/prompt_template.d.ts.map +1 -1
  1382. package/dist/schema/prompt_template.js +2 -3
  1383. package/dist/schema/prompt_template.js.map +1 -1
  1384. package/dist/schema/query_constructor.cjs +3 -3
  1385. package/dist/schema/query_constructor.cjs.map +1 -1
  1386. package/dist/schema/query_constructor.d.cts.map +1 -1
  1387. package/dist/schema/query_constructor.d.ts.map +1 -1
  1388. package/dist/schema/query_constructor.js +2 -3
  1389. package/dist/schema/query_constructor.js.map +1 -1
  1390. package/dist/smith/config.cjs.map +1 -1
  1391. package/dist/smith/config.d.cts +10 -9
  1392. package/dist/smith/config.d.cts.map +1 -1
  1393. package/dist/smith/config.d.ts +10 -9
  1394. package/dist/smith/config.d.ts.map +1 -1
  1395. package/dist/smith/config.js.map +1 -1
  1396. package/dist/smith/index.cjs +3 -3
  1397. package/dist/smith/index.js +2 -3
  1398. package/dist/smith/name_generation.cjs +1 -4
  1399. package/dist/smith/name_generation.cjs.map +1 -1
  1400. package/dist/smith/name_generation.js +1 -4
  1401. package/dist/smith/name_generation.js.map +1 -1
  1402. package/dist/smith/progress.cjs.map +1 -1
  1403. package/dist/smith/progress.js.map +1 -1
  1404. package/dist/smith/runner_utils.cjs +30 -37
  1405. package/dist/smith/runner_utils.cjs.map +1 -1
  1406. package/dist/smith/runner_utils.d.cts +2 -1
  1407. package/dist/smith/runner_utils.d.cts.map +1 -1
  1408. package/dist/smith/runner_utils.d.ts +2 -1
  1409. package/dist/smith/runner_utils.d.ts.map +1 -1
  1410. package/dist/smith/runner_utils.js +12 -19
  1411. package/dist/smith/runner_utils.js.map +1 -1
  1412. package/dist/sql_db.cjs +5 -5
  1413. package/dist/sql_db.cjs.map +1 -1
  1414. package/dist/sql_db.d.cts +0 -1
  1415. package/dist/sql_db.d.cts.map +1 -1
  1416. package/dist/sql_db.d.ts +0 -1
  1417. package/dist/sql_db.d.ts.map +1 -1
  1418. package/dist/sql_db.js +2 -3
  1419. package/dist/sql_db.js.map +1 -1
  1420. package/dist/storage/encoder_backed.cjs +9 -10
  1421. package/dist/storage/encoder_backed.cjs.map +1 -1
  1422. package/dist/storage/encoder_backed.d.cts +0 -1
  1423. package/dist/storage/encoder_backed.d.cts.map +1 -1
  1424. package/dist/storage/encoder_backed.d.ts +0 -1
  1425. package/dist/storage/encoder_backed.d.ts.map +1 -1
  1426. package/dist/storage/encoder_backed.js +4 -6
  1427. package/dist/storage/encoder_backed.js.map +1 -1
  1428. package/dist/storage/file_system.cjs +12 -11
  1429. package/dist/storage/file_system.cjs.map +1 -1
  1430. package/dist/storage/file_system.d.cts +0 -1
  1431. package/dist/storage/file_system.d.cts.map +1 -1
  1432. package/dist/storage/file_system.d.ts +0 -1
  1433. package/dist/storage/file_system.d.ts.map +1 -1
  1434. package/dist/storage/file_system.js +5 -7
  1435. package/dist/storage/file_system.js.map +1 -1
  1436. package/dist/storage/in_memory.cjs +5 -5
  1437. package/dist/storage/in_memory.js +2 -3
  1438. package/dist/stores/doc/base.cjs +3 -3
  1439. package/dist/stores/doc/base.cjs.map +1 -1
  1440. package/dist/stores/doc/base.d.cts +0 -1
  1441. package/dist/stores/doc/base.d.cts.map +1 -1
  1442. package/dist/stores/doc/base.d.ts +0 -1
  1443. package/dist/stores/doc/base.d.ts.map +1 -1
  1444. package/dist/stores/doc/base.js +2 -3
  1445. package/dist/stores/doc/base.js.map +1 -1
  1446. package/dist/stores/doc/in_memory.cjs +3 -3
  1447. package/dist/stores/doc/in_memory.cjs.map +1 -1
  1448. package/dist/stores/doc/in_memory.d.cts +0 -1
  1449. package/dist/stores/doc/in_memory.d.cts.map +1 -1
  1450. package/dist/stores/doc/in_memory.d.ts +0 -1
  1451. package/dist/stores/doc/in_memory.d.ts.map +1 -1
  1452. package/dist/stores/doc/in_memory.js +2 -3
  1453. package/dist/stores/doc/in_memory.js.map +1 -1
  1454. package/dist/stores/file/base.cjs +3 -3
  1455. package/dist/stores/file/base.cjs.map +1 -1
  1456. package/dist/stores/file/base.d.cts +0 -1
  1457. package/dist/stores/file/base.d.cts.map +1 -1
  1458. package/dist/stores/file/base.d.ts +0 -1
  1459. package/dist/stores/file/base.d.ts.map +1 -1
  1460. package/dist/stores/file/base.js.map +1 -1
  1461. package/dist/stores/file/in_memory.cjs +3 -3
  1462. package/dist/stores/file/in_memory.cjs.map +1 -1
  1463. package/dist/stores/file/in_memory.d.cts +0 -1
  1464. package/dist/stores/file/in_memory.d.cts.map +1 -1
  1465. package/dist/stores/file/in_memory.d.ts +0 -1
  1466. package/dist/stores/file/in_memory.d.ts.map +1 -1
  1467. package/dist/stores/file/in_memory.js +2 -3
  1468. package/dist/stores/file/in_memory.js.map +1 -1
  1469. package/dist/stores/file/node.cjs +7 -6
  1470. package/dist/stores/file/node.cjs.map +1 -1
  1471. package/dist/stores/file/node.d.cts +0 -1
  1472. package/dist/stores/file/node.d.cts.map +1 -1
  1473. package/dist/stores/file/node.d.ts +0 -1
  1474. package/dist/stores/file/node.d.ts.map +1 -1
  1475. package/dist/stores/file/node.js +6 -7
  1476. package/dist/stores/file/node.js.map +1 -1
  1477. package/dist/stores/message/in_memory.cjs +5 -5
  1478. package/dist/stores/message/in_memory.js +2 -3
  1479. package/dist/text_splitter.cjs +7 -6
  1480. package/dist/text_splitter.d.cts +3 -2
  1481. package/dist/text_splitter.d.cts.map +1 -1
  1482. package/dist/text_splitter.d.ts +3 -2
  1483. package/dist/text_splitter.d.ts.map +1 -1
  1484. package/dist/text_splitter.js +4 -4
  1485. package/dist/tools/chain.cjs +6 -6
  1486. package/dist/tools/chain.cjs.map +1 -1
  1487. package/dist/tools/chain.d.cts +0 -1
  1488. package/dist/tools/chain.d.cts.map +1 -1
  1489. package/dist/tools/chain.d.ts +0 -1
  1490. package/dist/tools/chain.d.ts.map +1 -1
  1491. package/dist/tools/chain.js +3 -4
  1492. package/dist/tools/chain.js.map +1 -1
  1493. package/dist/tools/fs.cjs +6 -6
  1494. package/dist/tools/fs.cjs.map +1 -1
  1495. package/dist/tools/fs.d.cts +0 -1
  1496. package/dist/tools/fs.d.cts.map +1 -1
  1497. package/dist/tools/fs.d.ts +0 -1
  1498. package/dist/tools/fs.d.ts.map +1 -1
  1499. package/dist/tools/fs.js +1 -1
  1500. package/dist/tools/fs.js.map +1 -1
  1501. package/dist/tools/index.cjs +13 -13
  1502. package/dist/tools/index.js +2 -3
  1503. package/dist/tools/json.cjs +10 -11
  1504. package/dist/tools/json.cjs.map +1 -1
  1505. package/dist/tools/json.d.cts.map +1 -1
  1506. package/dist/tools/json.d.ts.map +1 -1
  1507. package/dist/tools/json.js +2 -4
  1508. package/dist/tools/json.js.map +1 -1
  1509. package/dist/tools/render.cjs +9 -9
  1510. package/dist/tools/render.cjs.map +1 -1
  1511. package/dist/tools/render.d.cts +0 -1
  1512. package/dist/tools/render.d.cts.map +1 -1
  1513. package/dist/tools/render.d.ts +0 -1
  1514. package/dist/tools/render.d.ts.map +1 -1
  1515. package/dist/tools/render.js +2 -3
  1516. package/dist/tools/render.js.map +1 -1
  1517. package/dist/tools/requests.cjs +7 -11
  1518. package/dist/tools/requests.cjs.map +1 -1
  1519. package/dist/tools/requests.d.cts.map +1 -1
  1520. package/dist/tools/requests.d.ts.map +1 -1
  1521. package/dist/tools/requests.js +3 -7
  1522. package/dist/tools/requests.js.map +1 -1
  1523. package/dist/tools/retriever.cjs +7 -8
  1524. package/dist/tools/retriever.cjs.map +1 -1
  1525. package/dist/tools/retriever.d.cts.map +1 -1
  1526. package/dist/tools/retriever.d.ts.map +1 -1
  1527. package/dist/tools/retriever.js +3 -5
  1528. package/dist/tools/retriever.js.map +1 -1
  1529. package/dist/tools/sql.cjs +11 -12
  1530. package/dist/tools/sql.cjs.map +1 -1
  1531. package/dist/tools/sql.d.cts +0 -1
  1532. package/dist/tools/sql.d.cts.map +1 -1
  1533. package/dist/tools/sql.d.ts +0 -1
  1534. package/dist/tools/sql.d.ts.map +1 -1
  1535. package/dist/tools/sql.js +3 -5
  1536. package/dist/tools/sql.js.map +1 -1
  1537. package/dist/tools/vectorstore.cjs +3 -3
  1538. package/dist/tools/vectorstore.cjs.map +1 -1
  1539. package/dist/tools/vectorstore.d.cts +0 -1
  1540. package/dist/tools/vectorstore.d.cts.map +1 -1
  1541. package/dist/tools/vectorstore.d.ts +0 -1
  1542. package/dist/tools/vectorstore.d.ts.map +1 -1
  1543. package/dist/tools/vectorstore.js.map +1 -1
  1544. package/dist/tools/webbrowser.cjs +18 -23
  1545. package/dist/tools/webbrowser.cjs.map +1 -1
  1546. package/dist/tools/webbrowser.d.cts.map +1 -1
  1547. package/dist/tools/webbrowser.d.ts +1 -1
  1548. package/dist/tools/webbrowser.d.ts.map +1 -1
  1549. package/dist/tools/webbrowser.js +9 -16
  1550. package/dist/tools/webbrowser.js.map +1 -1
  1551. package/dist/types/expression-parser.d.cts.map +1 -1
  1552. package/dist/types/expression-parser.d.ts.map +1 -1
  1553. package/dist/types/type-utils.d.cts.map +1 -1
  1554. package/dist/types/type-utils.d.ts.map +1 -1
  1555. package/dist/util/document.cjs +3 -3
  1556. package/dist/util/document.cjs.map +1 -1
  1557. package/dist/util/document.d.cts +0 -1
  1558. package/dist/util/document.d.cts.map +1 -1
  1559. package/dist/util/document.d.ts +0 -1
  1560. package/dist/util/document.d.ts.map +1 -1
  1561. package/dist/util/document.js +2 -3
  1562. package/dist/util/document.js.map +1 -1
  1563. package/dist/util/entrypoint_deprecation.js +2 -0
  1564. package/dist/util/env.cjs +2 -2
  1565. package/dist/util/env.js +2 -0
  1566. package/dist/util/extname.cjs.map +1 -1
  1567. package/dist/util/extname.js.map +1 -1
  1568. package/dist/util/hub.cjs +9 -11
  1569. package/dist/util/hub.cjs.map +1 -1
  1570. package/dist/util/hub.js +5 -7
  1571. package/dist/util/hub.js.map +1 -1
  1572. package/dist/util/is-network-error/index.cjs +2 -3
  1573. package/dist/util/is-network-error/index.cjs.map +1 -1
  1574. package/dist/util/is-network-error/index.js +2 -3
  1575. package/dist/util/is-network-error/index.js.map +1 -1
  1576. package/dist/util/load.cjs +1 -2
  1577. package/dist/util/load.cjs.map +1 -1
  1578. package/dist/util/load.d.cts.map +1 -1
  1579. package/dist/util/load.d.ts.map +1 -1
  1580. package/dist/util/load.js +1 -2
  1581. package/dist/util/load.js.map +1 -1
  1582. package/dist/util/math.cjs +7 -6
  1583. package/dist/util/math.js +4 -4
  1584. package/dist/util/ml-distance/distances.cjs.map +1 -1
  1585. package/dist/util/ml-distance/distances.js.map +1 -1
  1586. package/dist/util/ml-distance/similarities.cjs.map +1 -1
  1587. package/dist/util/ml-distance/similarities.d.cts.map +1 -1
  1588. package/dist/util/ml-distance/similarities.d.ts.map +1 -1
  1589. package/dist/util/ml-distance/similarities.js.map +1 -1
  1590. package/dist/util/ml-distance-euclidean/euclidean.cjs.map +1 -1
  1591. package/dist/util/ml-distance-euclidean/euclidean.js.map +1 -1
  1592. package/dist/util/openapi.cjs +6 -7
  1593. package/dist/util/openapi.cjs.map +1 -1
  1594. package/dist/util/openapi.d.cts.map +1 -1
  1595. package/dist/util/openapi.d.ts.map +1 -1
  1596. package/dist/util/openapi.js +3 -5
  1597. package/dist/util/openapi.js.map +1 -1
  1598. package/dist/util/p-retry/index.cjs +2 -2
  1599. package/dist/util/p-retry/index.cjs.map +1 -1
  1600. package/dist/util/p-retry/index.js +2 -2
  1601. package/dist/util/p-retry/index.js.map +1 -1
  1602. package/dist/util/parse.cjs +3 -2
  1603. package/dist/util/parse.cjs.map +1 -1
  1604. package/dist/util/parse.js.map +1 -1
  1605. package/dist/util/set.cjs.map +1 -1
  1606. package/dist/util/set.js.map +1 -1
  1607. package/dist/util/sql_utils.cjs +16 -28
  1608. package/dist/util/sql_utils.cjs.map +1 -1
  1609. package/dist/util/sql_utils.d.cts.map +1 -1
  1610. package/dist/util/sql_utils.d.ts.map +1 -1
  1611. package/dist/util/sql_utils.js +16 -28
  1612. package/dist/util/sql_utils.js.map +1 -1
  1613. package/dist/util/time.cjs +3 -3
  1614. package/dist/util/time.cjs.map +1 -1
  1615. package/dist/util/time.d.cts.map +1 -1
  1616. package/dist/util/time.d.ts.map +1 -1
  1617. package/dist/util/time.js +2 -3
  1618. package/dist/util/time.js.map +1 -1
  1619. package/dist/vectorstores/memory.cjs +15 -22
  1620. package/dist/vectorstores/memory.cjs.map +1 -1
  1621. package/dist/vectorstores/memory.d.cts +0 -1
  1622. package/dist/vectorstores/memory.d.cts.map +1 -1
  1623. package/dist/vectorstores/memory.d.ts +0 -1
  1624. package/dist/vectorstores/memory.d.ts.map +1 -1
  1625. package/dist/vectorstores/memory.js +9 -17
  1626. package/dist/vectorstores/memory.js.map +1 -1
  1627. package/package.json +18 -18
  1628. package/dist/_virtual/rolldown_runtime.js +0 -25
@@ -5,7 +5,6 @@ import { BaseLanguageModelInterface } from "@langchain/core/language_models/base
5
5
  import { InputValues, MemoryVariables, OutputValues } from "@langchain/core/memory";
6
6
 
7
7
  //#region src/memory/entity_memory.d.ts
8
-
9
8
  /**
10
9
  * Interface for the input parameters required by the EntityMemory class.
11
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"entity_memory.d.ts","names":["BaseLanguageModelInterface","PromptTemplate","InputValues","MemoryVariables","OutputValues","BaseEntityStore","BaseChatMemory","BaseChatMemoryInput","EntityMemoryInput","EntityMemory","Promise"],"sources":["../../src/memory/entity_memory.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { PromptTemplate } from \"@langchain/core/prompts\";\nimport { InputValues, MemoryVariables, OutputValues } from \"@langchain/core/memory\";\nimport { BaseEntityStore } from \"./stores/entity/base.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\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 * 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 declare class EntityMemory extends BaseChatMemory implements EntityMemoryInput {\n private entityExtractionChain;\n private entitySummarizationChain;\n entityStore: BaseEntityStore;\n entityCache: string[];\n k: number;\n chatHistoryKey: string;\n llm: BaseLanguageModelInterface;\n entitiesKey: string;\n humanPrefix?: string;\n aiPrefix?: string;\n constructor(fields: EntityMemoryInput);\n get memoryKeys(): string[];\n get memoryVariables(): string[];\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 loadMemoryVariables(inputs: InputValues): Promise<MemoryVariables>;\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 saveContext(inputs: InputValues, outputs: OutputValues): Promise<void>;\n /**\n * Method to clear the memory contents.\n * @returns Promise resolving to void.\n */\n clear(): Promise<void>;\n}\n//# sourceMappingURL=entity_memory.d.ts.map"],"mappings":";;;;;;;;;;AAQA;AACSA,UADQQ,iBAAAA,SAA0BD,mBAClCP,CAAAA;EAGoBC,GAAAA,EAHpBD,0BAGoBC;EACGA,WAAAA,CAAAA,EAAAA,MAAAA;EAKdI,QAAAA,CAAAA,EAAAA,MAAAA;EAVyBE,sBAAAA,CAAAA,EAIdN,cAJcM;EAAmB,yBAAA,CAAA,EAK9BN,cAL8B;EA8CzCQ,WAAAA,CAAAA,EAAAA,MAAY,EAAA;EAGhBJ,CAAAA,CAAAA,EAAAA,MAAAA;EAIRL,cAAAA,CAAAA,EAAAA,MAAAA;EAIeQ,WAAAA,CAAAA,EAAAA,MAAAA;EAQQN,WAAAA,CAAAA,EAvDdG,eAuDcH;;;;;;;;;AAnBqD;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAhEO,YAAAA,SAAqBH,cAAAA,YAA0BE;;;eAGnDH;;;;OAIRL;;;;sBAIeQ;;;;;;;;8BAQQN,cAAcQ,QAAQP;;;;;;;;sBAQ9BD,sBAAsBE,eAAeM;;;;;WAKhDA"}
1
+ {"version":3,"file":"entity_memory.d.ts","names":[],"sources":["../../src/memory/entity_memory.ts"],"mappings":";;;;;;;;;AAsBA;UAAiB,iBAAA,SAA0B,mBAAA;EACzC,GAAA,EAAK,0BAAA;EACL,WAAA;EACA,QAAA;EACA,sBAAA,GAAyB,cAAA;EACzB,yBAAA,GAA4B,cAAA;EAC5B,WAAA;EACA,CAAA;EACA,cAAA;EACA,WAAA;EACA,WAAA,GAAc,eAAA;AAAA;;;;;;;;;;;;;;;AAsChB;;;;;;;;;;;;;;;;;;;;cAAa,YAAA,SAAqB,cAAA,YAA0B,iBAAA;EAAA,QAClD,qBAAA;EAAA,QAEA,wBAAA;EAER,WAAA,EAAa,eAAA;EAEb,WAAA;EAEA,CAAA;EAEA,cAAA;EAEA,GAAA,EAAK,0BAAA;EAEL,WAAA;EAEA,WAAA;EAEA,QAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,iBAAA;EAAA,IAyBhB,UAAA,CAAA;EAAA,IAKA,eAAA,CAAA;EALA;;;;;EAeE,mBAAA,CAAoB,MAAA,EAAQ,WAAA,GAAc,OAAA,CAAQ,eAAA;EAAA;;;;;;;EA0ClD,WAAA,CAAY,MAAA,EAAQ,WAAA,EAAa,OAAA,EAAS,YAAA,GAAe,OAAA;EAmCpD;;;;EAAL,KAAA,CAAA,GAAK,OAAA;AAAA"}
@@ -114,8 +114,7 @@ var EntityMemory = class extends BaseChatMemory {
114
114
  async saveContext(inputs, outputs) {
115
115
  await super.saveContext(inputs, outputs);
116
116
  const promptInputKey = this.inputKey ?? getPromptInputKey(inputs, this.memoryVariables);
117
- const messages = await this.chatHistory.getMessages();
118
- const serializedMessages = getBufferString(messages.slice(-this.k * 2), this.humanPrefix, this.aiPrefix);
117
+ const serializedMessages = getBufferString((await this.chatHistory.getMessages()).slice(-this.k * 2), this.humanPrefix, this.aiPrefix);
119
118
  const inputData = inputs[promptInputKey];
120
119
  for (const entity of this.entityCache) {
121
120
  const existingSummary = await this.entityStore.get(entity, "No current information known.");
@@ -1 +1 @@
1
- {"version":3,"file":"entity_memory.js","names":["fields: EntityMemoryInput","inputs: InputValues","entities: string[]","entitySummaries: { [key: string]: string | undefined }","outputs: OutputValues"],"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,CAAE;CAE1B,IAAI;CAEJ,iBAAiB;CAEjB;CAEA,cAAc;CAEd;CAEA;CAEA,YAAYA,QAA2B;EACrC,MAAM;GACJ,aAAa,OAAO;GACpB,gBAAgB,OAAO,kBAAkB;GACzC,UAAU,OAAO;GACjB,WAAW,OAAO;EACnB,EAAC;EACF,KAAK,MAAM,OAAO;EAClB,KAAK,cAAc,OAAO;EAC1B,KAAK,WAAW,OAAO;EACvB,KAAK,iBAAiB,OAAO,kBAAkB,KAAK;EACpD,KAAK,cAAc,OAAO,eAAe,KAAK;EAC9C,KAAK,wBAAwB,IAAI,SAAS;GACxC,KAAK,KAAK;GACV,QAAQ,OAAO,0BAA0B;EAC1C;EACD,KAAK,2BAA2B,IAAI,SAAS;GAC3C,KAAK,KAAK;GACV,QAAQ,OAAO,6BAA6B;EAC7C;EACD,KAAK,cAAc,OAAO,eAAe,IAAI;EAC7C,KAAK,cAAc,OAAO,eAAe,KAAK;EAC9C,KAAK,IAAI,OAAO,KAAK,KAAK;CAC3B;CAED,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,cAAe;CAC7B;CAGD,IAAI,kBAA4B;AAC9B,SAAO,CAAC,KAAK,aAAa,KAAK,cAAe;CAC/C;;;;;;CAQD,MAAM,oBAAoBC,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;EACf,EAAC;EACF,MAAMC,WACJ,OAAO,MAAM,KAAK,SAAS,CAAE,IAAG,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;EACxE,MAAMC,kBAAyD,CAAE;AAEjE,OAAK,MAAM,UAAU,UACnB,gBAAgB,UAAU,MAAM,KAAK,YAAY,IAC/C,QACA,gCACD;EAEH,KAAK,cAAc,CAAC,GAAG,QAAS;EAChC,MAAM,SAAS,KAAK,iBAChB,SAAS,MAAM,CAAC,KAAK,IAAI,EAAE,GAC3B;AAEJ,SAAO;IACJ,KAAK,iBAAiB;IACtB,KAAK,cAAc;EACrB;CACF;;;;;;;;CAUD,MAAM,YAAYF,QAAqBG,SAAsC;EAC3E,MAAM,MAAM,YAAY,QAAQ,QAAQ;EAExC,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,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;GACR,EAAC;AACF,OAAI,OAAO,MAAM,KAAK,aACpB,MAAM,KAAK,YAAY,IAAI,QAAQ,OAAO,MAAM,CAAC;EAEpD;CACF;;;;;CAOD,MAAM,QAAQ;EACZ,MAAM,MAAM,OAAO;EACnB,MAAM,KAAK,YAAY,OAAO;CAC/B;AACF"}
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,4 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  const require_prompt = require('./prompt.cjs');
3
4
  const require_memory_chat_memory = require('./chat_memory.cjs');
4
5
  const require_summary = require('./summary.cjs');
@@ -9,19 +10,18 @@ const require_vector_store = require('./vector_store.cjs');
9
10
  const require_entity_memory = require('./entity_memory.cjs');
10
11
  const require_combined_memory = require('./combined_memory.cjs');
11
12
  const require_buffer_token_memory = require('./buffer_token_memory.cjs');
12
- const __langchain_core_messages = require_rolldown_runtime.__toESM(require("@langchain/core/messages"));
13
- const __langchain_core_chat_history = require_rolldown_runtime.__toESM(require("@langchain/core/chat_history"));
14
- const __langchain_core_memory = require_rolldown_runtime.__toESM(require("@langchain/core/memory"));
13
+ let _langchain_core_messages = require("@langchain/core/messages");
14
+ let _langchain_core_chat_history = require("@langchain/core/chat_history");
15
+ let _langchain_core_memory = require("@langchain/core/memory");
15
16
 
16
17
  //#region src/memory/index.ts
17
- var memory_exports = {};
18
- require_rolldown_runtime.__export(memory_exports, {
18
+ var memory_exports = /* @__PURE__ */ require_runtime.__exportAll({
19
19
  BaseChatMemory: () => require_memory_chat_memory.BaseChatMemory,
20
20
  BaseConversationSummaryMemory: () => require_summary.BaseConversationSummaryMemory,
21
- BaseMemory: () => __langchain_core_memory.BaseMemory,
21
+ BaseMemory: () => _langchain_core_memory.BaseMemory,
22
22
  BufferMemory: () => require_buffer_memory.BufferMemory,
23
23
  BufferWindowMemory: () => require_buffer_window_memory.BufferWindowMemory,
24
- ChatMessageHistory: () => __langchain_core_chat_history.InMemoryChatMessageHistory,
24
+ ChatMessageHistory: () => _langchain_core_chat_history.InMemoryChatMessageHistory,
25
25
  CombinedMemory: () => require_combined_memory.CombinedMemory,
26
26
  ConversationSummaryBufferMemory: () => require_summary_buffer.ConversationSummaryBufferMemory,
27
27
  ConversationSummaryMemory: () => require_summary.ConversationSummaryMemory,
@@ -29,9 +29,9 @@ require_rolldown_runtime.__export(memory_exports, {
29
29
  ENTITY_MEMORY_CONVERSATION_TEMPLATE: () => require_prompt.ENTITY_MEMORY_CONVERSATION_TEMPLATE,
30
30
  EntityMemory: () => require_entity_memory.EntityMemory,
31
31
  VectorStoreRetrieverMemory: () => require_vector_store.VectorStoreRetrieverMemory,
32
- getBufferString: () => __langchain_core_messages.getBufferString,
33
- getInputValue: () => __langchain_core_memory.getInputValue,
34
- getOutputValue: () => __langchain_core_memory.getOutputValue
32
+ getBufferString: () => _langchain_core_messages.getBufferString,
33
+ getInputValue: () => _langchain_core_memory.getInputValue,
34
+ getOutputValue: () => _langchain_core_memory.getOutputValue
35
35
  });
36
36
 
37
37
  //#endregion
@@ -40,7 +40,7 @@ exports.BaseConversationSummaryMemory = require_summary.BaseConversationSummaryM
40
40
  Object.defineProperty(exports, 'BaseMemory', {
41
41
  enumerable: true,
42
42
  get: function () {
43
- return __langchain_core_memory.BaseMemory;
43
+ return _langchain_core_memory.BaseMemory;
44
44
  }
45
45
  });
46
46
  exports.BufferMemory = require_buffer_memory.BufferMemory;
@@ -48,7 +48,7 @@ exports.BufferWindowMemory = require_buffer_window_memory.BufferWindowMemory;
48
48
  Object.defineProperty(exports, 'ChatMessageHistory', {
49
49
  enumerable: true,
50
50
  get: function () {
51
- return __langchain_core_chat_history.InMemoryChatMessageHistory;
51
+ return _langchain_core_chat_history.InMemoryChatMessageHistory;
52
52
  }
53
53
  });
54
54
  exports.CombinedMemory = require_combined_memory.CombinedMemory;
@@ -61,19 +61,19 @@ exports.VectorStoreRetrieverMemory = require_vector_store.VectorStoreRetrieverMe
61
61
  Object.defineProperty(exports, 'getBufferString', {
62
62
  enumerable: true,
63
63
  get: function () {
64
- return __langchain_core_messages.getBufferString;
64
+ return _langchain_core_messages.getBufferString;
65
65
  }
66
66
  });
67
67
  Object.defineProperty(exports, 'getInputValue', {
68
68
  enumerable: true,
69
69
  get: function () {
70
- return __langchain_core_memory.getInputValue;
70
+ return _langchain_core_memory.getInputValue;
71
71
  }
72
72
  });
73
73
  Object.defineProperty(exports, 'getOutputValue', {
74
74
  enumerable: true,
75
75
  get: function () {
76
- return __langchain_core_memory.getOutputValue;
76
+ return _langchain_core_memory.getOutputValue;
77
77
  }
78
78
  });
79
79
  Object.defineProperty(exports, 'memory_exports', {
@@ -1,4 +1,4 @@
1
- import { __export } from "../_virtual/rolldown_runtime.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { ENTITY_MEMORY_CONVERSATION_TEMPLATE } from "./prompt.js";
3
3
  import { BaseChatMemory } from "./chat_memory.js";
4
4
  import { BaseConversationSummaryMemory, ConversationSummaryMemory } from "./summary.js";
@@ -14,8 +14,7 @@ import { InMemoryChatMessageHistory as ChatMessageHistory } from "@langchain/cor
14
14
  import { BaseMemory, getInputValue, getOutputValue } from "@langchain/core/memory";
15
15
 
16
16
  //#region src/memory/index.ts
17
- var memory_exports = {};
18
- __export(memory_exports, {
17
+ var memory_exports = /* @__PURE__ */ __exportAll({
19
18
  BaseChatMemory: () => BaseChatMemory,
20
19
  BaseConversationSummaryMemory: () => BaseConversationSummaryMemory,
21
20
  BaseMemory: () => BaseMemory,
@@ -1,5 +1,5 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const __langchain_core_prompts = require_rolldown_runtime.__toESM(require("@langchain/core/prompts"));
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
+ let _langchain_core_prompts = require("@langchain/core/prompts");
3
3
 
4
4
  //#region src/memory/prompt.ts
5
5
  const _DEFAULT_SUMMARIZER_TEMPLATE = `Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.
@@ -23,7 +23,7 @@ New lines of conversation:
23
23
  {new_lines}
24
24
 
25
25
  New summary:`;
26
- const SUMMARY_PROMPT = /* @__PURE__ */ new __langchain_core_prompts.PromptTemplate({
26
+ const SUMMARY_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
27
27
  inputVariables: ["summary", "new_lines"],
28
28
  template: _DEFAULT_SUMMARIZER_TEMPLATE
29
29
  });
@@ -43,7 +43,7 @@ Current conversation:
43
43
  Last line:
44
44
  Human: {input}
45
45
  You:`;
46
- const ENTITY_MEMORY_CONVERSATION_TEMPLATE = /* @__PURE__ */ new __langchain_core_prompts.PromptTemplate({
46
+ const ENTITY_MEMORY_CONVERSATION_TEMPLATE = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
47
47
  inputVariables: [
48
48
  "entities",
49
49
  "history",
@@ -85,7 +85,7 @@ Last line of conversation (for extraction):
85
85
  Human: {input}
86
86
 
87
87
  Output:`;
88
- const ENTITY_EXTRACTION_PROMPT = /* @__PURE__ */ new __langchain_core_prompts.PromptTemplate({
88
+ const ENTITY_EXTRACTION_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
89
89
  inputVariables: ["history", "input"],
90
90
  template: _DEFAULT_ENTITY_EXTRACTION_TEMPLATE
91
91
  });
@@ -106,7 +106,7 @@ Existing summary of {entity}:
106
106
  Last line of conversation:
107
107
  Human: {input}
108
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({
109
+ const ENTITY_SUMMARIZATION_PROMPT = /* @__PURE__ */ new _langchain_core_prompts.PromptTemplate({
110
110
  inputVariables: [
111
111
  "entity",
112
112
  "summary",
@@ -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,CAAC;;;;;;;;;;;;;;;;;;;;YAoB1B,CAAC;AAEb,MAAa,iCAA+B,IAAIA,wCAAe;CAC7D,gBAAgB,CAAC,WAAW,WAAY;CACxC,UAAU;AACX;AAED,MAAa,+CAA+C,CAAC;;;;;;;;;;;;;;;IAezD,CAAC;AAEL,MAAa,sDACG,IAAIA,wCAAe;CAC/B,gBAAgB;EAAC;EAAY;EAAW;CAAQ;CAChD,UAAU;AACX;AAEH,MAAa,sCAAsC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiC7C,CAAC;AAER,MAAa,2CAAyC,IAAIA,wCAAe;CACvE,gBAAgB,CAAC,WAAW,OAAQ;CACpC,UAAU;AACX;AAED,MAAa,yCAAyC,CAAC;;;;;;;;;;;;;;;;sGAgB+C,CAAC;AAEvG,MAAa,8CAA4C,IAAIA,wCAAe;CAC1E,gBAAgB;EAAC;EAAU;EAAW;EAAW;CAAQ;CACzD,UAAU;AACX"}
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,7 +1,6 @@
1
1
  import { PromptTemplate } from "@langchain/core/prompts";
2
2
 
3
3
  //#region src/memory/prompt.d.ts
4
-
5
4
  declare const ENTITY_MEMORY_CONVERSATION_TEMPLATE: PromptTemplate<{
6
5
  entities: any;
7
6
  history: any;
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.cts","names":["PromptTemplate","SUMMARY_PROMPT","_DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE","ENTITY_MEMORY_CONVERSATION_TEMPLATE","_DEFAULT_ENTITY_EXTRACTION_TEMPLATE","ENTITY_EXTRACTION_PROMPT","_DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE","ENTITY_SUMMARIZATION_PROMPT"],"sources":["../../src/memory/prompt.d.ts"],"sourcesContent":["import { PromptTemplate } from \"@langchain/core/prompts\";\nexport declare const SUMMARY_PROMPT: PromptTemplate<{\n new_lines: any;\n summary: any;\n}, any>;\nexport declare 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:\";\nexport declare const ENTITY_MEMORY_CONVERSATION_TEMPLATE: PromptTemplate<{\n entities: any;\n history: any;\n input: any;\n}, any>;\nexport declare 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:\";\nexport declare const ENTITY_EXTRACTION_PROMPT: PromptTemplate<{\n history: any;\n input: any;\n}, any>;\nexport declare 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):\";\nexport declare const ENTITY_SUMMARIZATION_PROMPT: PromptTemplate<{\n entity: any;\n history: any;\n input: any;\n summary: any;\n}, any>;\n//# sourceMappingURL=prompt.d.ts.map"],"mappings":";;;;cAMqBG,qCAAqCH"}
1
+ {"version":3,"file":"prompt.d.cts","names":[],"sources":["../../src/memory/prompt.ts"],"mappings":";;;cA8Ca,mCAAA,EAAmC,cAAA"}
@@ -1,7 +1,6 @@
1
1
  import { PromptTemplate } from "@langchain/core/prompts";
2
2
 
3
3
  //#region src/memory/prompt.d.ts
4
-
5
4
  declare const ENTITY_MEMORY_CONVERSATION_TEMPLATE: PromptTemplate<{
6
5
  entities: any;
7
6
  history: any;
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","names":["PromptTemplate","SUMMARY_PROMPT","_DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE","ENTITY_MEMORY_CONVERSATION_TEMPLATE","_DEFAULT_ENTITY_EXTRACTION_TEMPLATE","ENTITY_EXTRACTION_PROMPT","_DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE","ENTITY_SUMMARIZATION_PROMPT"],"sources":["../../src/memory/prompt.d.ts"],"sourcesContent":["import { PromptTemplate } from \"@langchain/core/prompts\";\nexport declare const SUMMARY_PROMPT: PromptTemplate<{\n new_lines: any;\n summary: any;\n}, any>;\nexport declare 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:\";\nexport declare const ENTITY_MEMORY_CONVERSATION_TEMPLATE: PromptTemplate<{\n entities: any;\n history: any;\n input: any;\n}, any>;\nexport declare 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:\";\nexport declare const ENTITY_EXTRACTION_PROMPT: PromptTemplate<{\n history: any;\n input: any;\n}, any>;\nexport declare 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):\";\nexport declare const ENTITY_SUMMARIZATION_PROMPT: PromptTemplate<{\n entity: any;\n history: any;\n input: any;\n summary: any;\n}, any>;\n//# sourceMappingURL=prompt.d.ts.map"],"mappings":";;;;cAMqBG,qCAAqCH"}
1
+ {"version":3,"file":"prompt.d.ts","names":[],"sources":["../../src/memory/prompt.ts"],"mappings":";;;cA8Ca,mCAAA,EAAmC,cAAA"}
@@ -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,CAAC;;;;;;;;;;;;;;;;;;;;YAoB1B,CAAC;AAEb,MAAa,iCAA+B,IAAI,eAAe;CAC7D,gBAAgB,CAAC,WAAW,WAAY;CACxC,UAAU;AACX;AAED,MAAa,+CAA+C,CAAC;;;;;;;;;;;;;;;IAezD,CAAC;AAEL,MAAa,sDACG,IAAI,eAAe;CAC/B,gBAAgB;EAAC;EAAY;EAAW;CAAQ;CAChD,UAAU;AACX;AAEH,MAAa,sCAAsC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiC7C,CAAC;AAER,MAAa,2CAAyC,IAAI,eAAe;CACvE,gBAAgB,CAAC,WAAW,OAAQ;CACpC,UAAU;AACX;AAED,MAAa,yCAAyC,CAAC;;;;;;;;;;;;;;;;sGAgB+C,CAAC;AAEvG,MAAa,8CAA4C,IAAI,eAAe;CAC1E,gBAAgB;EAAC;EAAU;EAAW;EAAW;CAAQ;CACzD,UAAU;AACX"}
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,12 +1,12 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- const __langchain_core_load_serializable = require_rolldown_runtime.__toESM(require("@langchain/core/load/serializable"));
1
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
2
+ let _langchain_core_load_serializable = require("@langchain/core/load/serializable");
3
3
 
4
4
  //#region src/memory/stores/entity/base.ts
5
5
  /**
6
6
  * Base class for all entity stores. All entity stores should extend this
7
7
  * class.
8
8
  */
9
- var BaseEntityStore = class extends __langchain_core_load_serializable.Serializable {};
9
+ var BaseEntityStore = class extends _langchain_core_load_serializable.Serializable {};
10
10
 
11
11
  //#endregion
12
12
  exports.BaseEntityStore = BaseEntityStore;
@@ -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,gDAAa,CAU1D"}
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,7 +1,6 @@
1
1
  import { Serializable } from "@langchain/core/load/serializable";
2
2
 
3
3
  //#region src/memory/stores/entity/base.d.ts
4
-
5
4
  /**
6
5
  * Base class for all entity stores. All entity stores should extend this
7
6
  * class.
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.cts","names":["Serializable","BaseEntityStore","Promise"],"sources":["../../../../src/memory/stores/entity/base.d.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n/**\n * Base class for all entity stores. All entity stores should extend this\n * class.\n */\nexport declare abstract class BaseEntityStore extends Serializable {\n abstract get(key: string, defaultValue?: string): Promise<string | undefined>;\n abstract set(key: string, value?: string): Promise<void>;\n abstract delete(key: string): Promise<void>;\n abstract exists(key: string): Promise<boolean>;\n abstract clear(): Promise<void>;\n}\n//# sourceMappingURL=base.d.ts.map"],"mappings":";;;;;;AAKA;;AAE+CE,uBAFjBD,eAAAA,SAAwBD,YAAAA,CAEPE;EACbA,SAAAA,GAAAA,CAAAA,GAAAA,EAAAA,MAAAA,EAAAA,YAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAFoBA,OAEpBA,CAAAA,MAAAA,GAAAA,SAAAA,CAAAA;EACAA,SAAAA,GAAAA,CAAAA,GAAAA,EAAAA,MAAAA,EAAAA,KAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAFaA,OAEbA,CAAAA,IAAAA,CAAAA;EACZA,SAAAA,MAAAA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAFYA,OAEZA,CAAAA,IAAAA,CAAAA;EALgCF,SAAAA,MAAAA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAIpBE,OAJoBF,CAAAA,OAAAA,CAAAA;EAAY,SAAA,KAAA,CAAA,CAAA,EAK5CE,OAL4C,CAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"base.d.cts","names":[],"sources":["../../../../src/memory/stores/entity/base.ts"],"mappings":";;;;;AAMA;;uBAAsB,eAAA,SAAwB,YAAA;EAAA,SACnC,GAAA,CAAI,GAAA,UAAa,YAAA,YAAwB,OAAA;EAAA,SAEzC,GAAA,CAAI,GAAA,UAAa,KAAA,YAAiB,OAAA;EAAA,SAElC,MAAA,CAAO,GAAA,WAAc,OAAA;EAAA,SAErB,MAAA,CAAO,GAAA,WAAc,OAAA;EAAA,SAErB,KAAA,CAAA,GAAS,OAAA;AAAA"}
@@ -1,7 +1,6 @@
1
1
  import { Serializable } from "@langchain/core/load/serializable";
2
2
 
3
3
  //#region src/memory/stores/entity/base.d.ts
4
-
5
4
  /**
6
5
  * Base class for all entity stores. All entity stores should extend this
7
6
  * class.
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","names":["Serializable","BaseEntityStore","Promise"],"sources":["../../../../src/memory/stores/entity/base.d.ts"],"sourcesContent":["import { Serializable } from \"@langchain/core/load/serializable\";\n/**\n * Base class for all entity stores. All entity stores should extend this\n * class.\n */\nexport declare abstract class BaseEntityStore extends Serializable {\n abstract get(key: string, defaultValue?: string): Promise<string | undefined>;\n abstract set(key: string, value?: string): Promise<void>;\n abstract delete(key: string): Promise<void>;\n abstract exists(key: string): Promise<boolean>;\n abstract clear(): Promise<void>;\n}\n//# sourceMappingURL=base.d.ts.map"],"mappings":";;;;;;AAKA;;AAE+CE,uBAFjBD,eAAAA,SAAwBD,YAAAA,CAEPE;EACbA,SAAAA,GAAAA,CAAAA,GAAAA,EAAAA,MAAAA,EAAAA,YAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAFoBA,OAEpBA,CAAAA,MAAAA,GAAAA,SAAAA,CAAAA;EACAA,SAAAA,GAAAA,CAAAA,GAAAA,EAAAA,MAAAA,EAAAA,KAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAFaA,OAEbA,CAAAA,IAAAA,CAAAA;EACZA,SAAAA,MAAAA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAFYA,OAEZA,CAAAA,IAAAA,CAAAA;EALgCF,SAAAA,MAAAA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAIpBE,OAJoBF,CAAAA,OAAAA,CAAAA;EAAY,SAAA,KAAA,CAAA,CAAA,EAK5CE,OAL4C,CAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"base.d.ts","names":[],"sources":["../../../../src/memory/stores/entity/base.ts"],"mappings":";;;;;AAMA;;uBAAsB,eAAA,SAAwB,YAAA;EAAA,SACnC,GAAA,CAAI,GAAA,UAAa,YAAA,YAAwB,OAAA;EAAA,SAEzC,GAAA,CAAI,GAAA,UAAa,KAAA,YAAiB,OAAA;EAAA,SAElC,MAAA,CAAO,GAAA,WAAc,OAAA;EAAA,SAErB,MAAA,CAAO,GAAA,WAAc,OAAA;EAAA,SAErB,KAAA,CAAA,GAAS,OAAA;AAAA"}
@@ -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,CAU1D"}
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 +1 @@
1
- {"version":3,"file":"in_memory.cjs","names":["BaseEntityStore","key: string","defaultValue: string | undefined","value: string | undefined"],"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;CAAY;CAE7D,AAAQ;CAER,cAAc;EACZ,OAAO;EACP,KAAK,QAAQ,OAAO,OAAO,KAAK;CACjC;;;;;;;;;CAUD,MAAM,IACJC,KACAC,cAC6B;AAC7B,SAAO,OAAO,KAAK,QAAQ,KAAK,MAAM,OAAO;CAC9C;;;;;;CAOD,MAAM,IAAID,KAAaE,OAA0C;EAC/D,KAAK,MAAM,OAAO;CACnB;;;;;CAMD,MAAM,OAAOF,KAA4B;EACvC,OAAO,KAAK,MAAM;CACnB;;;;;;CAOD,MAAM,OAAOA,KAA+B;AAC1C,SAAO,OAAO,KAAK;CACpB;;;;CAKD,MAAM,QAAuB;EAC3B,KAAK,QAAQ,OAAO,OAAO,KAAK;CACjC;AACF"}
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 +1 @@
1
- {"version":3,"file":"in_memory.js","names":["key: string","defaultValue: string | undefined","value: string | undefined"],"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;CAAY;CAE7D,AAAQ;CAER,cAAc;EACZ,OAAO;EACP,KAAK,QAAQ,OAAO,OAAO,KAAK;CACjC;;;;;;;;;CAUD,MAAM,IACJA,KACAC,cAC6B;AAC7B,SAAO,OAAO,KAAK,QAAQ,KAAK,MAAM,OAAO;CAC9C;;;;;;CAOD,MAAM,IAAID,KAAaE,OAA0C;EAC/D,KAAK,MAAM,OAAO;CACnB;;;;;CAMD,MAAM,OAAOF,KAA4B;EACvC,OAAO,KAAK,MAAM;CACnB;;;;;;CAOD,MAAM,OAAOA,KAA+B;AAC1C,SAAO,OAAO,KAAK;CACpB;;;;CAKD,MAAM,QAAuB;EAC3B,KAAK,QAAQ,OAAO,OAAO,KAAK;CACjC;AACF"}
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,8 +1,8 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
2
  const require_llm_chain = require('../chains/llm_chain.cjs');
3
3
  const require_prompt = require('./prompt.cjs');
4
4
  const require_memory_chat_memory = require('./chat_memory.cjs');
5
- const __langchain_core_messages = require_rolldown_runtime.__toESM(require("@langchain/core/messages"));
5
+ let _langchain_core_messages = require("@langchain/core/messages");
6
6
 
7
7
  //#region src/memory/summary.ts
8
8
  /**
@@ -16,7 +16,7 @@ var BaseConversationSummaryMemory = class extends require_memory_chat_memory.Bas
16
16
  aiPrefix = "AI";
17
17
  llm;
18
18
  prompt = require_prompt.SUMMARY_PROMPT;
19
- summaryChatMessageClass = __langchain_core_messages.SystemMessage;
19
+ summaryChatMessageClass = _langchain_core_messages.SystemMessage;
20
20
  constructor(fields) {
21
21
  const { returnMessages, inputKey, outputKey, chatHistory, humanPrefix, aiPrefix, llm, prompt, summaryChatMessageClass } = fields;
22
22
  super({
@@ -40,12 +40,11 @@ var BaseConversationSummaryMemory = class extends require_memory_chat_memory.Bas
40
40
  * @returns A promise that resolves to a new summary string.
41
41
  */
42
42
  async predictNewSummary(messages, existingSummary) {
43
- const newLines = (0, __langchain_core_messages.getBufferString)(messages, this.humanPrefix, this.aiPrefix);
44
- const chain = new require_llm_chain.LLMChain({
43
+ const newLines = (0, _langchain_core_messages.getBufferString)(messages, this.humanPrefix, this.aiPrefix);
44
+ return await new require_llm_chain.LLMChain({
45
45
  llm: this.llm,
46
46
  prompt: this.prompt
47
- });
48
- return await chain.predict({
47
+ }).predict({
49
48
  summary: existingSummary,
50
49
  new_lines: newLines
51
50
  });
@@ -93,12 +92,8 @@ var ConversationSummaryMemory = class extends BaseConversationSummaryMemory {
93
92
  * @returns A promise that resolves to an object containing the memory variables.
94
93
  */
95
94
  async loadMemoryVariables(_) {
96
- if (this.returnMessages) {
97
- const result$1 = { [this.memoryKey]: [new this.summaryChatMessageClass(this.buffer)] };
98
- return result$1;
99
- }
100
- const result = { [this.memoryKey]: this.buffer };
101
- return result;
95
+ if (this.returnMessages) return { [this.memoryKey]: [new this.summaryChatMessageClass(this.buffer)] };
96
+ return { [this.memoryKey]: this.buffer };
102
97
  }
103
98
  /**
104
99
  * Saves the context of the conversation memory.
@@ -1 +1 @@
1
- {"version":3,"file":"summary.cjs","names":["BaseChatMemory","SUMMARY_PROMPT","SystemMessage","fields: BaseConversationSummaryMemoryInput","messages: BaseMessage[]","existingSummary: string","LLMChain","fields: ConversationSummaryMemoryInput","_: InputValues","result","inputValues: InputValues","outputValues: OutputValues"],"sources":["../../src/memory/summary.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport {\n BaseMessage,\n SystemMessage,\n getBufferString,\n} from \"@langchain/core/messages\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { LLMChain } from \"../chains/llm_chain.js\";\nimport { SUMMARY_PROMPT } from \"./prompt.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the ConversationSummaryMemory\n * class.\n */\nexport interface ConversationSummaryMemoryInput extends BaseConversationSummaryMemoryInput {}\n\n/**\n * Interface for the input parameters of the BaseConversationSummaryMemory\n * class.\n */\nexport interface BaseConversationSummaryMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n memoryKey?: string;\n humanPrefix?: string;\n aiPrefix?: string;\n prompt?: BasePromptTemplate;\n summaryChatMessageClass?: new (content: string) => BaseMessage;\n}\n\n/**\n * Abstract class that provides a structure for storing and managing the\n * memory of a conversation. It includes methods for predicting a new\n * summary for the conversation given the existing messages and summary.\n */\nexport abstract class BaseConversationSummaryMemory extends BaseChatMemory {\n memoryKey = \"history\";\n\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n llm: BaseLanguageModelInterface;\n\n prompt: BasePromptTemplate = SUMMARY_PROMPT;\n\n summaryChatMessageClass: new (content: string) => BaseMessage = SystemMessage;\n\n constructor(fields: BaseConversationSummaryMemoryInput) {\n const {\n returnMessages,\n inputKey,\n outputKey,\n chatHistory,\n humanPrefix,\n aiPrefix,\n llm,\n prompt,\n summaryChatMessageClass,\n } = fields;\n\n super({ returnMessages, inputKey, outputKey, chatHistory });\n\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.humanPrefix = humanPrefix ?? this.humanPrefix;\n this.aiPrefix = aiPrefix ?? this.aiPrefix;\n this.llm = llm;\n this.prompt = prompt ?? this.prompt;\n this.summaryChatMessageClass =\n summaryChatMessageClass ?? this.summaryChatMessageClass;\n }\n\n /**\n * Predicts a new summary for the conversation given the existing messages\n * and summary.\n * @param messages Existing messages in the conversation.\n * @param existingSummary Current summary of the conversation.\n * @returns A promise that resolves to a new summary string.\n */\n async predictNewSummary(\n messages: BaseMessage[],\n existingSummary: string\n ): Promise<string> {\n const newLines = getBufferString(messages, this.humanPrefix, this.aiPrefix);\n const chain = new LLMChain({ llm: this.llm, prompt: this.prompt });\n return await chain.predict({\n summary: existingSummary,\n new_lines: newLines,\n });\n }\n}\n\n/**\n * Class that provides a concrete implementation of the conversation\n * memory. It includes methods for loading memory variables, saving\n * context, and clearing the memory.\n * @example\n * ```typescript\n * const memory = new ConversationSummaryMemory({\n * memoryKey: \"chat_history\",\n * llm: new ChatOpenAI({ model: \"gpt-3.5-turbo\", temperature: 0 }),\n * });\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\" });\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n *\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n * const chain = new LLMChain({ llm: model, prompt, memory });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res1, memory: await memory.loadMemoryVariables({}) });\n *\n * const res2 = await chain.call({ input: \"What's my name?\" });\n * console.log({ res2, memory: await memory.loadMemoryVariables({}) });\n *\n * ```\n */\nexport class ConversationSummaryMemory extends BaseConversationSummaryMemory {\n buffer = \"\";\n\n constructor(fields: ConversationSummaryMemoryInput) {\n super(fields);\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables for the conversation memory.\n * @returns A promise that resolves to an object containing the memory variables.\n */\n async loadMemoryVariables(_: InputValues): Promise<MemoryVariables> {\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: [new this.summaryChatMessageClass(this.buffer)],\n };\n return result;\n }\n const result = { [this.memoryKey]: this.buffer };\n return result;\n }\n\n /**\n * Saves the context of the conversation memory.\n * @param inputValues Input values for the conversation.\n * @param outputValues Output values from the conversation.\n * @returns A promise that resolves when the context has been saved.\n */\n async saveContext(\n inputValues: InputValues,\n outputValues: OutputValues\n ): Promise<void> {\n await super.saveContext(inputValues, outputValues);\n const messages = await this.chatHistory.getMessages();\n this.buffer = await this.predictNewSummary(messages.slice(-2), this.buffer);\n }\n\n /**\n * Clears the conversation memory.\n * @returns A promise that resolves when the memory has been cleared.\n */\n async clear() {\n await super.clear();\n this.buffer = \"\";\n }\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,IAAsB,gCAAtB,cAA4DA,0CAAe;CACzE,YAAY;CAEZ,cAAc;CAEd,WAAW;CAEX;CAEA,SAA6BC;CAE7B,0BAAgEC;CAEhE,YAAYC,QAA4C;EACtD,MAAM,EACJ,gBACA,UACA,WACA,aACA,aACA,UACA,KACA,QACA,yBACD,GAAG;EAEJ,MAAM;GAAE;GAAgB;GAAU;GAAW;EAAa,EAAC;EAE3D,KAAK,YAAY,QAAQ,aAAa,KAAK;EAC3C,KAAK,cAAc,eAAe,KAAK;EACvC,KAAK,WAAW,YAAY,KAAK;EACjC,KAAK,MAAM;EACX,KAAK,SAAS,UAAU,KAAK;EAC7B,KAAK,0BACH,2BAA2B,KAAK;CACnC;;;;;;;;CASD,MAAM,kBACJC,UACAC,iBACiB;EACjB,MAAM,0DAA2B,UAAU,KAAK,aAAa,KAAK,SAAS;EAC3E,MAAM,QAAQ,IAAIC,2BAAS;GAAE,KAAK,KAAK;GAAK,QAAQ,KAAK;EAAQ;AACjE,SAAO,MAAM,MAAM,QAAQ;GACzB,SAAS;GACT,WAAW;EACZ,EAAC;CACH;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BD,IAAa,4BAAb,cAA+C,8BAA8B;CAC3E,SAAS;CAET,YAAYC,QAAwC;EAClD,MAAM,OAAO;CACd;CAED,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,SAAU;CACxB;;;;;CAMD,MAAM,oBAAoBC,GAA0C;AAClE,MAAI,KAAK,gBAAgB;GACvB,MAAMC,WAAS,GACZ,KAAK,YAAY,CAAC,IAAI,KAAK,wBAAwB,KAAK,OAAQ,EAClE;AACD,UAAOA;EACR;EACD,MAAM,SAAS,GAAG,KAAK,YAAY,KAAK,OAAQ;AAChD,SAAO;CACR;;;;;;;CAQD,MAAM,YACJC,aACAC,cACe;EACf,MAAM,MAAM,YAAY,aAAa,aAAa;EAClD,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;EACrD,KAAK,SAAS,MAAM,KAAK,kBAAkB,SAAS,MAAM,GAAG,EAAE,KAAK,OAAO;CAC5E;;;;;CAMD,MAAM,QAAQ;EACZ,MAAM,MAAM,OAAO;EACnB,KAAK,SAAS;CACf;AACF"}
1
+ {"version":3,"file":"summary.cjs","names":["BaseChatMemory","SUMMARY_PROMPT","SystemMessage","LLMChain"],"sources":["../../src/memory/summary.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport {\n BaseMessage,\n SystemMessage,\n getBufferString,\n} from \"@langchain/core/messages\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport {\n InputValues,\n MemoryVariables,\n OutputValues,\n} from \"@langchain/core/memory\";\nimport { LLMChain } from \"../chains/llm_chain.js\";\nimport { SUMMARY_PROMPT } from \"./prompt.js\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n\n/**\n * Interface for the input parameters of the ConversationSummaryMemory\n * class.\n */\nexport interface ConversationSummaryMemoryInput extends BaseConversationSummaryMemoryInput {}\n\n/**\n * Interface for the input parameters of the BaseConversationSummaryMemory\n * class.\n */\nexport interface BaseConversationSummaryMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n memoryKey?: string;\n humanPrefix?: string;\n aiPrefix?: string;\n prompt?: BasePromptTemplate;\n summaryChatMessageClass?: new (content: string) => BaseMessage;\n}\n\n/**\n * Abstract class that provides a structure for storing and managing the\n * memory of a conversation. It includes methods for predicting a new\n * summary for the conversation given the existing messages and summary.\n */\nexport abstract class BaseConversationSummaryMemory extends BaseChatMemory {\n memoryKey = \"history\";\n\n humanPrefix = \"Human\";\n\n aiPrefix = \"AI\";\n\n llm: BaseLanguageModelInterface;\n\n prompt: BasePromptTemplate = SUMMARY_PROMPT;\n\n summaryChatMessageClass: new (content: string) => BaseMessage = SystemMessage;\n\n constructor(fields: BaseConversationSummaryMemoryInput) {\n const {\n returnMessages,\n inputKey,\n outputKey,\n chatHistory,\n humanPrefix,\n aiPrefix,\n llm,\n prompt,\n summaryChatMessageClass,\n } = fields;\n\n super({ returnMessages, inputKey, outputKey, chatHistory });\n\n this.memoryKey = fields?.memoryKey ?? this.memoryKey;\n this.humanPrefix = humanPrefix ?? this.humanPrefix;\n this.aiPrefix = aiPrefix ?? this.aiPrefix;\n this.llm = llm;\n this.prompt = prompt ?? this.prompt;\n this.summaryChatMessageClass =\n summaryChatMessageClass ?? this.summaryChatMessageClass;\n }\n\n /**\n * Predicts a new summary for the conversation given the existing messages\n * and summary.\n * @param messages Existing messages in the conversation.\n * @param existingSummary Current summary of the conversation.\n * @returns A promise that resolves to a new summary string.\n */\n async predictNewSummary(\n messages: BaseMessage[],\n existingSummary: string\n ): Promise<string> {\n const newLines = getBufferString(messages, this.humanPrefix, this.aiPrefix);\n const chain = new LLMChain({ llm: this.llm, prompt: this.prompt });\n return await chain.predict({\n summary: existingSummary,\n new_lines: newLines,\n });\n }\n}\n\n/**\n * Class that provides a concrete implementation of the conversation\n * memory. It includes methods for loading memory variables, saving\n * context, and clearing the memory.\n * @example\n * ```typescript\n * const memory = new ConversationSummaryMemory({\n * memoryKey: \"chat_history\",\n * llm: new ChatOpenAI({ model: \"gpt-3.5-turbo\", temperature: 0 }),\n * });\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\" });\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n *\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n * const chain = new LLMChain({ llm: model, prompt, memory });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res1, memory: await memory.loadMemoryVariables({}) });\n *\n * const res2 = await chain.call({ input: \"What's my name?\" });\n * console.log({ res2, memory: await memory.loadMemoryVariables({}) });\n *\n * ```\n */\nexport class ConversationSummaryMemory extends BaseConversationSummaryMemory {\n buffer = \"\";\n\n constructor(fields: ConversationSummaryMemoryInput) {\n super(fields);\n }\n\n get memoryKeys() {\n return [this.memoryKey];\n }\n\n /**\n * Loads the memory variables for the conversation memory.\n * @returns A promise that resolves to an object containing the memory variables.\n */\n async loadMemoryVariables(_: InputValues): Promise<MemoryVariables> {\n if (this.returnMessages) {\n const result = {\n [this.memoryKey]: [new this.summaryChatMessageClass(this.buffer)],\n };\n return result;\n }\n const result = { [this.memoryKey]: this.buffer };\n return result;\n }\n\n /**\n * Saves the context of the conversation memory.\n * @param inputValues Input values for the conversation.\n * @param outputValues Output values from the conversation.\n * @returns A promise that resolves when the context has been saved.\n */\n async saveContext(\n inputValues: InputValues,\n outputValues: OutputValues\n ): Promise<void> {\n await super.saveContext(inputValues, outputValues);\n const messages = await this.chatHistory.getMessages();\n this.buffer = await this.predictNewSummary(messages.slice(-2), this.buffer);\n }\n\n /**\n * Clears the conversation memory.\n * @returns A promise that resolves when the memory has been cleared.\n */\n async clear() {\n await super.clear();\n this.buffer = \"\";\n }\n}\n"],"mappings":";;;;;;;;;;;;AAwCA,IAAsB,gCAAtB,cAA4DA,0CAAe;CACzE,YAAY;CAEZ,cAAc;CAEd,WAAW;CAEX;CAEA,SAA6BC;CAE7B,0BAAgEC;CAEhE,YAAY,QAA4C;EACtD,MAAM,EACJ,gBACA,UACA,WACA,aACA,aACA,UACA,KACA,QACA,4BACE;AAEJ,QAAM;GAAE;GAAgB;GAAU;GAAW;GAAa,CAAC;AAE3D,OAAK,YAAY,QAAQ,aAAa,KAAK;AAC3C,OAAK,cAAc,eAAe,KAAK;AACvC,OAAK,WAAW,YAAY,KAAK;AACjC,OAAK,MAAM;AACX,OAAK,SAAS,UAAU,KAAK;AAC7B,OAAK,0BACH,2BAA2B,KAAK;;;;;;;;;CAUpC,MAAM,kBACJ,UACA,iBACiB;EACjB,MAAM,yDAA2B,UAAU,KAAK,aAAa,KAAK,SAAS;AAE3E,SAAO,MADO,IAAIC,2BAAS;GAAE,KAAK,KAAK;GAAK,QAAQ,KAAK;GAAQ,CAAC,CAC/C,QAAQ;GACzB,SAAS;GACT,WAAW;GACZ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCN,IAAa,4BAAb,cAA+C,8BAA8B;CAC3E,SAAS;CAET,YAAY,QAAwC;AAClD,QAAM,OAAO;;CAGf,IAAI,aAAa;AACf,SAAO,CAAC,KAAK,UAAU;;;;;;CAOzB,MAAM,oBAAoB,GAA0C;AAClE,MAAI,KAAK,eAIP,QAHe,GACZ,KAAK,YAAY,CAAC,IAAI,KAAK,wBAAwB,KAAK,OAAO,CAAC,EAClE;AAIH,SADe,GAAG,KAAK,YAAY,KAAK,QAAQ;;;;;;;;CAUlD,MAAM,YACJ,aACA,cACe;AACf,QAAM,MAAM,YAAY,aAAa,aAAa;EAClD,MAAM,WAAW,MAAM,KAAK,YAAY,aAAa;AACrD,OAAK,SAAS,MAAM,KAAK,kBAAkB,SAAS,MAAM,GAAG,EAAE,KAAK,OAAO;;;;;;CAO7E,MAAM,QAAQ;AACZ,QAAM,MAAM,OAAO;AACnB,OAAK,SAAS"}
@@ -5,7 +5,6 @@ import { BaseLanguageModelInterface } from "@langchain/core/language_models/base
5
5
  import { InputValues, MemoryVariables, OutputValues } from "@langchain/core/memory";
6
6
 
7
7
  //#region src/memory/summary.d.ts
8
-
9
8
  /**
10
9
  * Interface for the input parameters of the ConversationSummaryMemory
11
10
  * class.
@@ -1 +1 @@
1
- {"version":3,"file":"summary.d.cts","names":["BaseLanguageModelInterface","BaseMessage","BasePromptTemplate","InputValues","MemoryVariables","OutputValues","BaseChatMemory","BaseChatMemoryInput","ConversationSummaryMemoryInput","BaseConversationSummaryMemoryInput","BaseConversationSummaryMemory","Promise","ConversationSummaryMemory"],"sources":["../../src/memory/summary.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { InputValues, MemoryVariables, OutputValues } from \"@langchain/core/memory\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"./chat_memory.js\";\n/**\n * Interface for the input parameters of the ConversationSummaryMemory\n * class.\n */\nexport interface ConversationSummaryMemoryInput extends BaseConversationSummaryMemoryInput {\n}\n/**\n * Interface for the input parameters of the BaseConversationSummaryMemory\n * class.\n */\nexport interface BaseConversationSummaryMemoryInput extends BaseChatMemoryInput {\n llm: BaseLanguageModelInterface;\n memoryKey?: string;\n humanPrefix?: string;\n aiPrefix?: string;\n prompt?: BasePromptTemplate;\n summaryChatMessageClass?: new (content: string) => BaseMessage;\n}\n/**\n * Abstract class that provides a structure for storing and managing the\n * memory of a conversation. It includes methods for predicting a new\n * summary for the conversation given the existing messages and summary.\n */\nexport declare abstract class BaseConversationSummaryMemory extends BaseChatMemory {\n memoryKey: string;\n humanPrefix: string;\n aiPrefix: string;\n llm: BaseLanguageModelInterface;\n prompt: BasePromptTemplate;\n summaryChatMessageClass: new (content: string) => BaseMessage;\n constructor(fields: BaseConversationSummaryMemoryInput);\n /**\n * Predicts a new summary for the conversation given the existing messages\n * and summary.\n * @param messages Existing messages in the conversation.\n * @param existingSummary Current summary of the conversation.\n * @returns A promise that resolves to a new summary string.\n */\n predictNewSummary(messages: BaseMessage[], existingSummary: string): Promise<string>;\n}\n/**\n * Class that provides a concrete implementation of the conversation\n * memory. It includes methods for loading memory variables, saving\n * context, and clearing the memory.\n * @example\n * ```typescript\n * const memory = new ConversationSummaryMemory({\n * memoryKey: \"chat_history\",\n * llm: new ChatOpenAI({ model: \"gpt-3.5-turbo\", temperature: 0 }),\n * });\n *\n * const model = new ChatOpenAI({ model: \"gpt-4o-mini\" });\n * const prompt =\n * PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n *\n * Current conversation:\n * {chat_history}\n * Human: {input}\n * AI:`);\n * const chain = new LLMChain({ llm: model, prompt, memory });\n *\n * const res1 = await chain.call({ input: \"Hi! I'm Jim.\" });\n * console.log({ res1, memory: await memory.loadMemoryVariables({}) });\n *\n * const res2 = await chain.call({ input: \"What's my name?\" });\n * console.log({ res2, memory: await memory.loadMemoryVariables({}) });\n *\n * ```\n */\nexport declare class ConversationSummaryMemory extends BaseConversationSummaryMemory {\n buffer: string;\n constructor(fields: ConversationSummaryMemoryInput);\n get memoryKeys(): string[];\n /**\n * Loads the memory variables for the conversation memory.\n * @returns A promise that resolves to an object containing the memory variables.\n */\n loadMemoryVariables(_: InputValues): Promise<MemoryVariables>;\n /**\n * Saves the context of the conversation memory.\n * @param inputValues Input values for the conversation.\n * @param outputValues Output values from the conversation.\n * @returns A promise that resolves when the context has been saved.\n */\n saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>;\n /**\n * Clears the conversation memory.\n * @returns A promise that resolves when the memory has been cleared.\n */\n clear(): Promise<void>;\n}\n//# sourceMappingURL=summary.d.ts.map"],"mappings":";;;;;;;;;;AASA;AAMA;AACSA,UAPQQ,8BAAAA,SAAuCC,kCAO/CT,CAAAA;;;AADsE;AAa/E;AAISA,UAjBQS,kCAAAA,SAA2CF,mBAiBnDP,CAAAA;EACGE,GAAAA,EAjBHF,0BAiBGE;EAC0CD,SAAAA,CAAAA,EAAAA,MAAAA;EAC9BQ,WAAAA,CAAAA,EAAAA,MAAAA;EAQQR,QAAAA,CAAAA,EAAAA,MAAAA;EAAyCU,MAAAA,CAAAA,EAvB5DT,kBAuB4DS;EAfLL,uBAAAA,CAAAA,EAAAA,KAAAA,OAAAA,EAAAA,MAAAA,EAAAA,GAPbL,WAOaK;AAAc;AA8ClF;;;;;AAe6BH,uBA7DCO,6BAAAA,SAAsCJ,cAAAA,CA6DvCH;EAA2BE,SAAAA,EAAAA,MAAAA;EAAeM,WAAAA,EAAAA,MAAAA;EAK1DA,QAAAA,EAAAA,MAAAA;EApB0CD,GAAAA,EA1C9CV,0BA0C8CU;EAA6B,MAAA,EAzCxER,kBAyCwE;oDAxC9BD;sBAC9BQ;;;;;;;;8BAQQR,yCAAyCU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BpDC,yBAAAA,SAAkCF,6BAAAA;;sBAE/BF;;;;;;yBAMGL,cAAcQ,QAAQP;;;;;;;2BAOpBD,2BAA2BE,eAAeM;;;;;WAK1DA"}
1
+ {"version":3,"file":"summary.d.cts","names":[],"sources":["../../src/memory/summary.ts"],"mappings":";;;;;;;;;AAoBA;;UAAiB,8BAAA,SAAuC,kCAAA;;AAMxD;;;UAAiB,kCAAA,SAA2C,mBAAA;EAC1D,GAAA,EAAK,0BAAA;EACL,SAAA;EACA,WAAA;EACA,QAAA;EACA,MAAA,GAAS,kBAAA;EACT,uBAAA,QAA+B,OAAA,aAAoB,WAAA;AAAA;;;;;;uBAQ/B,6BAAA,SAAsC,cAAA;EAC1D,SAAA;EAEA,WAAA;EAEA,QAAA;EAEA,GAAA,EAAK,0BAAA;EAEL,MAAA,EAAQ,kBAAA;EAER,uBAAA,OAA8B,OAAA,aAAoB,WAAA;EAElD,WAAA,CAAY,MAAA,EAAQ,kCAAA;;;;;;;;EA+Bd,iBAAA,CACJ,QAAA,EAAU,WAAA,IACV,eAAA,WACC,OAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;AAuCL;;;;;;;cAAa,yBAAA,SAAkC,6BAAA;EAC7C,MAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,8BAAA;EAAA,IAIhB,UAAA,CAAA;EAPyC;;;;EAevC,mBAAA,CAAoB,CAAA,EAAG,WAAA,GAAc,OAAA,CAAQ,eAAA;EAZnD;;;;;;EA6BM,WAAA,CACJ,WAAA,EAAa,WAAA,EACb,YAAA,EAAc,YAAA,GACb,OAAA;EApBwC;;;;EA8BrC,KAAA,CAAA,GAAK,OAAA;AAAA"}