langchain 1.0.0-alpha.5 → 1.0.0-alpha.7

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 (405) hide show
  1. package/dist/agents/ReactAgent.cjs +5 -5
  2. package/dist/agents/ReactAgent.cjs.map +1 -1
  3. package/dist/agents/ReactAgent.d.cts +2 -5
  4. package/dist/agents/ReactAgent.d.cts.map +1 -1
  5. package/dist/agents/ReactAgent.d.ts +2 -5
  6. package/dist/agents/ReactAgent.d.ts.map +1 -1
  7. package/dist/agents/ReactAgent.js +6 -6
  8. package/dist/agents/ReactAgent.js.map +1 -1
  9. package/dist/agents/annotation.cjs.map +1 -1
  10. package/dist/agents/annotation.d.cts +13 -8
  11. package/dist/agents/annotation.d.cts.map +1 -1
  12. package/dist/agents/annotation.d.ts +13 -8
  13. package/dist/agents/annotation.d.ts.map +1 -1
  14. package/dist/agents/annotation.js.map +1 -1
  15. package/dist/agents/createAgent.cjs.map +1 -1
  16. package/dist/agents/createAgent.js.map +1 -1
  17. package/dist/agents/index.cjs +2 -2
  18. package/dist/agents/index.cjs.map +1 -1
  19. package/dist/agents/index.d.cts +50 -50
  20. package/dist/agents/index.d.cts.map +1 -1
  21. package/dist/agents/index.d.ts +50 -50
  22. package/dist/agents/index.d.ts.map +1 -1
  23. package/dist/agents/index.js +2 -2
  24. package/dist/agents/index.js.map +1 -1
  25. package/dist/agents/interrupt.d.cts +14 -1
  26. package/dist/agents/interrupt.d.cts.map +1 -1
  27. package/dist/agents/interrupt.d.ts +14 -1
  28. package/dist/agents/interrupt.d.ts.map +1 -1
  29. package/dist/agents/middlewareAgent/ReactAgent.cjs +273 -66
  30. package/dist/agents/middlewareAgent/ReactAgent.cjs.map +1 -1
  31. package/dist/agents/middlewareAgent/ReactAgent.d.cts +102 -16
  32. package/dist/agents/middlewareAgent/ReactAgent.d.cts.map +1 -1
  33. package/dist/agents/middlewareAgent/ReactAgent.d.ts +102 -16
  34. package/dist/agents/middlewareAgent/ReactAgent.d.ts.map +1 -1
  35. package/dist/agents/middlewareAgent/ReactAgent.js +275 -68
  36. package/dist/agents/middlewareAgent/ReactAgent.js.map +1 -1
  37. package/dist/agents/middlewareAgent/annotation.cjs +12 -6
  38. package/dist/agents/middlewareAgent/annotation.cjs.map +1 -1
  39. package/dist/agents/middlewareAgent/annotation.js +12 -6
  40. package/dist/agents/middlewareAgent/annotation.js.map +1 -1
  41. package/dist/agents/middlewareAgent/constants.d.cts +5 -0
  42. package/dist/agents/middlewareAgent/constants.d.cts.map +1 -0
  43. package/dist/agents/middlewareAgent/constants.d.ts +5 -0
  44. package/dist/agents/middlewareAgent/constants.d.ts.map +1 -0
  45. package/dist/agents/middlewareAgent/index.cjs.map +1 -1
  46. package/dist/agents/middlewareAgent/index.js.map +1 -1
  47. package/dist/agents/middlewareAgent/middleware/bigTool.cjs +162 -0
  48. package/dist/agents/middlewareAgent/middleware/bigTool.cjs.map +1 -0
  49. package/dist/agents/middlewareAgent/middleware/bigTool.d.cts +113 -0
  50. package/dist/agents/middlewareAgent/middleware/bigTool.d.cts.map +1 -0
  51. package/dist/agents/middlewareAgent/middleware/bigTool.d.ts +113 -0
  52. package/dist/agents/middlewareAgent/middleware/bigTool.d.ts.map +1 -0
  53. package/dist/agents/middlewareAgent/middleware/bigTool.js +161 -0
  54. package/dist/agents/middlewareAgent/middleware/bigTool.js.map +1 -0
  55. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.cjs +58 -0
  56. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.cjs.map +1 -0
  57. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.cts +46 -0
  58. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.cts.map +1 -0
  59. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.ts +46 -0
  60. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.d.ts.map +1 -0
  61. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.js +58 -0
  62. package/dist/agents/middlewareAgent/middleware/dynamicSystemPrompt.js.map +1 -0
  63. package/dist/agents/middlewareAgent/middleware/hitl.cjs +311 -0
  64. package/dist/agents/middlewareAgent/middleware/hitl.cjs.map +1 -0
  65. package/dist/agents/middlewareAgent/middleware/hitl.d.cts +419 -0
  66. package/dist/agents/middlewareAgent/middleware/hitl.d.cts.map +1 -0
  67. package/dist/agents/middlewareAgent/middleware/hitl.d.ts +419 -0
  68. package/dist/agents/middlewareAgent/middleware/hitl.d.ts.map +1 -0
  69. package/dist/agents/middlewareAgent/middleware/hitl.js +310 -0
  70. package/dist/agents/middlewareAgent/middleware/hitl.js.map +1 -0
  71. package/dist/agents/middlewareAgent/middleware/index.cjs +32 -0
  72. package/dist/agents/middlewareAgent/middleware/index.cjs.map +1 -0
  73. package/dist/agents/middlewareAgent/middleware/index.d.cts +6 -0
  74. package/dist/agents/middlewareAgent/middleware/index.d.ts +6 -0
  75. package/dist/agents/middlewareAgent/middleware/index.js +21 -0
  76. package/dist/agents/middlewareAgent/middleware/index.js.map +1 -0
  77. package/dist/agents/middlewareAgent/{middlewares → middleware}/promptCaching.cjs +72 -27
  78. package/dist/agents/middlewareAgent/middleware/promptCaching.cjs.map +1 -0
  79. package/dist/agents/middlewareAgent/{middlewares → middleware}/promptCaching.d.cts +60 -15
  80. package/dist/agents/middlewareAgent/middleware/promptCaching.d.cts.map +1 -0
  81. package/dist/agents/middlewareAgent/{middlewares → middleware}/promptCaching.d.ts +60 -15
  82. package/dist/agents/middlewareAgent/middleware/promptCaching.d.ts.map +1 -0
  83. package/dist/agents/middlewareAgent/{middlewares → middleware}/promptCaching.js +71 -26
  84. package/dist/agents/middlewareAgent/middleware/promptCaching.js.map +1 -0
  85. package/dist/agents/middlewareAgent/{middlewares → middleware}/summarization.cjs +35 -23
  86. package/dist/agents/middlewareAgent/middleware/summarization.cjs.map +1 -0
  87. package/dist/agents/middlewareAgent/{middlewares → middleware}/summarization.d.cts +7 -5
  88. package/dist/agents/middlewareAgent/middleware/summarization.d.cts.map +1 -0
  89. package/dist/agents/middlewareAgent/{middlewares → middleware}/summarization.d.ts +7 -5
  90. package/dist/agents/middlewareAgent/middleware/summarization.d.ts.map +1 -0
  91. package/dist/agents/middlewareAgent/{middlewares → middleware}/summarization.js +29 -17
  92. package/dist/agents/middlewareAgent/middleware/summarization.js.map +1 -0
  93. package/dist/agents/middlewareAgent/middleware.cjs +8 -5
  94. package/dist/agents/middlewareAgent/middleware.cjs.map +1 -1
  95. package/dist/agents/middlewareAgent/middleware.d.cts +67 -7
  96. package/dist/agents/middlewareAgent/middleware.d.cts.map +1 -1
  97. package/dist/agents/middlewareAgent/middleware.d.ts +67 -7
  98. package/dist/agents/middlewareAgent/middleware.d.ts.map +1 -1
  99. package/dist/agents/middlewareAgent/middleware.js +8 -5
  100. package/dist/agents/middlewareAgent/middleware.js.map +1 -1
  101. package/dist/agents/middlewareAgent/nodes/AfterModalNode.cjs +2 -2
  102. package/dist/agents/middlewareAgent/nodes/AfterModalNode.cjs.map +1 -1
  103. package/dist/agents/middlewareAgent/nodes/AfterModalNode.js +2 -2
  104. package/dist/agents/middlewareAgent/nodes/AfterModalNode.js.map +1 -1
  105. package/dist/agents/middlewareAgent/nodes/AgentNode.cjs +125 -83
  106. package/dist/agents/middlewareAgent/nodes/AgentNode.cjs.map +1 -1
  107. package/dist/agents/middlewareAgent/nodes/AgentNode.js +128 -86
  108. package/dist/agents/middlewareAgent/nodes/AgentNode.js.map +1 -1
  109. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.cjs +2 -2
  110. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.cjs.map +1 -1
  111. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.js +2 -2
  112. package/dist/agents/middlewareAgent/nodes/BeforeModalNode.js.map +1 -1
  113. package/dist/agents/middlewareAgent/nodes/middleware.cjs +42 -17
  114. package/dist/agents/middlewareAgent/nodes/middleware.cjs.map +1 -1
  115. package/dist/agents/middlewareAgent/nodes/middleware.js +42 -18
  116. package/dist/agents/middlewareAgent/nodes/middleware.js.map +1 -1
  117. package/dist/agents/middlewareAgent/nodes/utils.cjs +30 -16
  118. package/dist/agents/middlewareAgent/nodes/utils.cjs.map +1 -1
  119. package/dist/agents/middlewareAgent/nodes/utils.js +28 -14
  120. package/dist/agents/middlewareAgent/nodes/utils.js.map +1 -1
  121. package/dist/agents/middlewareAgent/types.d.cts +162 -88
  122. package/dist/agents/middlewareAgent/types.d.cts.map +1 -1
  123. package/dist/agents/middlewareAgent/types.d.ts +162 -88
  124. package/dist/agents/middlewareAgent/types.d.ts.map +1 -1
  125. package/dist/agents/model.cjs +13 -0
  126. package/dist/agents/model.cjs.map +1 -0
  127. package/dist/agents/model.js +11 -0
  128. package/dist/agents/model.js.map +1 -0
  129. package/dist/agents/nodes/AgentNode.cjs +60 -32
  130. package/dist/agents/nodes/AgentNode.cjs.map +1 -1
  131. package/dist/agents/nodes/AgentNode.js +61 -33
  132. package/dist/agents/nodes/AgentNode.js.map +1 -1
  133. package/dist/agents/nodes/ToolNode.cjs +4 -4
  134. package/dist/agents/nodes/ToolNode.cjs.map +1 -1
  135. package/dist/agents/nodes/ToolNode.d.cts +2 -3
  136. package/dist/agents/nodes/ToolNode.d.cts.map +1 -1
  137. package/dist/agents/nodes/ToolNode.d.ts +1 -2
  138. package/dist/agents/nodes/ToolNode.d.ts.map +1 -1
  139. package/dist/agents/nodes/ToolNode.js +5 -5
  140. package/dist/agents/nodes/ToolNode.js.map +1 -1
  141. package/dist/agents/responses.cjs +53 -11
  142. package/dist/agents/responses.cjs.map +1 -1
  143. package/dist/agents/responses.d.cts +12 -20
  144. package/dist/agents/responses.d.cts.map +1 -1
  145. package/dist/agents/responses.d.ts +12 -20
  146. package/dist/agents/responses.d.ts.map +1 -1
  147. package/dist/agents/responses.js +53 -12
  148. package/dist/agents/responses.js.map +1 -1
  149. package/dist/agents/types.d.cts +3 -6
  150. package/dist/agents/types.d.cts.map +1 -1
  151. package/dist/agents/types.d.ts +3 -6
  152. package/dist/agents/types.d.ts.map +1 -1
  153. package/dist/agents/utils.cjs +11 -29
  154. package/dist/agents/utils.cjs.map +1 -1
  155. package/dist/agents/utils.js +9 -26
  156. package/dist/agents/utils.js.map +1 -1
  157. package/dist/agents/withAgentName.cjs.map +1 -1
  158. package/dist/agents/withAgentName.js.map +1 -1
  159. package/dist/chains/api/prompts.cjs.map +1 -1
  160. package/dist/chains/api/prompts.js.map +1 -1
  161. package/dist/chains/constitutional_ai/constitutional_chain.cjs.map +1 -1
  162. package/dist/chains/constitutional_ai/constitutional_chain.js.map +1 -1
  163. package/dist/chains/index.cjs +0 -3
  164. package/dist/chains/index.cjs.map +1 -1
  165. package/dist/chains/index.d.cts +1 -2
  166. package/dist/chains/index.d.ts +1 -2
  167. package/dist/chains/index.js +1 -3
  168. package/dist/chains/index.js.map +1 -1
  169. package/dist/chains/openai_functions/extraction.cjs.map +1 -1
  170. package/dist/chains/openai_functions/extraction.d.cts +1 -3
  171. package/dist/chains/openai_functions/extraction.d.cts.map +1 -1
  172. package/dist/chains/openai_functions/extraction.d.ts +1 -3
  173. package/dist/chains/openai_functions/extraction.d.ts.map +1 -1
  174. package/dist/chains/openai_functions/extraction.js.map +1 -1
  175. package/dist/chains/openai_functions/index.cjs +0 -5
  176. package/dist/chains/openai_functions/index.cjs.map +1 -1
  177. package/dist/chains/openai_functions/index.d.cts +1 -2
  178. package/dist/chains/openai_functions/index.d.ts +1 -2
  179. package/dist/chains/openai_functions/index.js +1 -4
  180. package/dist/chains/openai_functions/index.js.map +1 -1
  181. package/dist/chains/openai_functions/openapi.cjs +4 -4
  182. package/dist/chains/openai_functions/openapi.cjs.map +1 -1
  183. package/dist/chains/openai_functions/openapi.d.cts +1 -1
  184. package/dist/chains/openai_functions/openapi.js +4 -4
  185. package/dist/chains/openai_functions/openapi.js.map +1 -1
  186. package/dist/chains/openai_functions/tagging.cjs.map +1 -1
  187. package/dist/chains/openai_functions/tagging.d.cts +1 -3
  188. package/dist/chains/openai_functions/tagging.d.cts.map +1 -1
  189. package/dist/chains/openai_functions/tagging.d.ts +1 -3
  190. package/dist/chains/openai_functions/tagging.d.ts.map +1 -1
  191. package/dist/chains/openai_functions/tagging.js.map +1 -1
  192. package/dist/chains/query_constructor/index.cjs +4 -4
  193. package/dist/chains/query_constructor/index.cjs.map +1 -1
  194. package/dist/chains/query_constructor/index.d.cts +4 -2
  195. package/dist/chains/query_constructor/index.d.cts.map +1 -1
  196. package/dist/chains/query_constructor/index.d.ts +4 -2
  197. package/dist/chains/query_constructor/index.d.ts.map +1 -1
  198. package/dist/chains/query_constructor/index.js +1 -1
  199. package/dist/chains/query_constructor/index.js.map +1 -1
  200. package/dist/chains/question_answering/load.d.ts +2 -2
  201. package/dist/chains/question_answering/load.d.ts.map +1 -1
  202. package/dist/chains/question_answering/map_reduce_prompts.cjs.map +1 -1
  203. package/dist/chains/question_answering/map_reduce_prompts.js.map +1 -1
  204. package/dist/chains/question_answering/refine_prompts.cjs.map +1 -1
  205. package/dist/chains/question_answering/refine_prompts.js.map +1 -1
  206. package/dist/chains/question_answering/stuff_prompts.cjs.map +1 -1
  207. package/dist/chains/question_answering/stuff_prompts.js.map +1 -1
  208. package/dist/chains/router/multi_prompt.cjs +4 -4
  209. package/dist/chains/router/multi_prompt.cjs.map +1 -1
  210. package/dist/chains/router/multi_prompt.js +1 -1
  211. package/dist/chains/router/multi_prompt.js.map +1 -1
  212. package/dist/chains/router/multi_retrieval_qa.cjs +4 -4
  213. package/dist/chains/router/multi_retrieval_qa.cjs.map +1 -1
  214. package/dist/chains/router/multi_retrieval_qa.js +1 -1
  215. package/dist/chains/router/multi_retrieval_qa.js.map +1 -1
  216. package/dist/chains/sql_db/sql_db_prompt.cjs.map +1 -1
  217. package/dist/chains/sql_db/sql_db_prompt.d.cts.map +1 -1
  218. package/dist/chains/sql_db/sql_db_prompt.d.ts.map +1 -1
  219. package/dist/chains/sql_db/sql_db_prompt.js.map +1 -1
  220. package/dist/chains/summarization/stuff_prompts.cjs.map +1 -1
  221. package/dist/chains/summarization/stuff_prompts.js.map +1 -1
  222. package/dist/chat_models/universal.cjs +8 -5
  223. package/dist/chat_models/universal.cjs.map +1 -1
  224. package/dist/chat_models/universal.d.cts +2 -2
  225. package/dist/chat_models/universal.d.cts.map +1 -1
  226. package/dist/chat_models/universal.d.ts +2 -2
  227. package/dist/chat_models/universal.d.ts.map +1 -1
  228. package/dist/chat_models/universal.js +8 -5
  229. package/dist/chat_models/universal.js.map +1 -1
  230. package/dist/document_loaders/fs/directory.cjs.map +1 -1
  231. package/dist/document_loaders/fs/directory.d.cts +0 -1
  232. package/dist/document_loaders/fs/directory.d.cts.map +1 -1
  233. package/dist/document_loaders/fs/directory.d.ts +0 -1
  234. package/dist/document_loaders/fs/directory.d.ts.map +1 -1
  235. package/dist/document_loaders/fs/directory.js.map +1 -1
  236. package/dist/document_loaders/fs/json.cjs +7 -1
  237. package/dist/document_loaders/fs/json.cjs.map +1 -1
  238. package/dist/document_loaders/fs/json.js +7 -1
  239. package/dist/document_loaders/fs/json.js.map +1 -1
  240. package/dist/embeddings/cache_backed.cjs +1 -1
  241. package/dist/embeddings/cache_backed.cjs.map +1 -1
  242. package/dist/embeddings/cache_backed.d.cts +1 -1
  243. package/dist/embeddings/cache_backed.d.ts +2 -2
  244. package/dist/embeddings/cache_backed.js +2 -2
  245. package/dist/embeddings/cache_backed.js.map +1 -1
  246. package/dist/evaluation/agents/trajectory.d.cts.map +1 -1
  247. package/dist/evaluation/comparison/pairwise.d.cts.map +1 -1
  248. package/dist/evaluation/criteria/criteria.d.cts.map +1 -1
  249. package/dist/evaluation/embedding_distance/base.cjs +2 -4
  250. package/dist/evaluation/embedding_distance/base.cjs.map +1 -1
  251. package/dist/evaluation/embedding_distance/base.js +2 -3
  252. package/dist/evaluation/embedding_distance/base.js.map +1 -1
  253. package/dist/evaluation/loader.cjs +7 -12
  254. package/dist/evaluation/loader.cjs.map +1 -1
  255. package/dist/evaluation/loader.d.cts +8 -2
  256. package/dist/evaluation/loader.d.cts.map +1 -1
  257. package/dist/evaluation/loader.d.ts +8 -2
  258. package/dist/evaluation/loader.d.ts.map +1 -1
  259. package/dist/evaluation/loader.js +7 -12
  260. package/dist/evaluation/loader.js.map +1 -1
  261. package/dist/hub/base.cjs.map +1 -1
  262. package/dist/hub/base.js.map +1 -1
  263. package/dist/index.cjs +38 -6
  264. package/dist/index.cjs.map +1 -1
  265. package/dist/index.d.cts +11 -4
  266. package/dist/index.d.ts +11 -4
  267. package/dist/index.js +18 -4
  268. package/dist/index.js.map +1 -1
  269. package/dist/langchain-core/dist/load/serializable.d.cts.map +1 -1
  270. package/dist/langchain-core/dist/messages/base.d.cts +24 -33
  271. package/dist/langchain-core/dist/messages/base.d.cts.map +1 -1
  272. package/dist/langchain-core/dist/messages/content/index.d.cts +21 -2
  273. package/dist/langchain-core/dist/messages/content/index.d.cts.map +1 -1
  274. package/dist/langchain-core/dist/messages/content/tools.d.cts +67 -6
  275. package/dist/langchain-core/dist/messages/content/tools.d.cts.map +1 -1
  276. package/dist/langchain-core/dist/messages/message.d.cts +598 -0
  277. package/dist/langchain-core/dist/messages/message.d.cts.map +1 -0
  278. package/dist/langchain-core/dist/messages/metadata.d.cts +97 -0
  279. package/dist/langchain-core/dist/messages/metadata.d.cts.map +1 -0
  280. package/dist/langchain-core/dist/messages/utils.d.cts +75 -0
  281. package/dist/langchain-core/dist/messages/utils.d.cts.map +1 -0
  282. package/dist/langchain-core/dist/prompt_values.d.cts.map +1 -1
  283. package/dist/langchain-core/dist/utils/types/index.d.cts.map +1 -1
  284. package/dist/libs/langchain-core/dist/load/serializable.d.ts.map +1 -1
  285. package/dist/libs/langchain-core/dist/messages/base.d.ts +24 -33
  286. package/dist/libs/langchain-core/dist/messages/base.d.ts.map +1 -1
  287. package/dist/libs/langchain-core/dist/messages/content/index.d.ts +21 -2
  288. package/dist/libs/langchain-core/dist/messages/content/index.d.ts.map +1 -1
  289. package/dist/libs/langchain-core/dist/messages/content/tools.d.ts +67 -6
  290. package/dist/libs/langchain-core/dist/messages/content/tools.d.ts.map +1 -1
  291. package/dist/libs/langchain-core/dist/messages/message.d.ts +598 -0
  292. package/dist/libs/langchain-core/dist/messages/message.d.ts.map +1 -0
  293. package/dist/libs/langchain-core/dist/messages/metadata.d.ts +97 -0
  294. package/dist/libs/langchain-core/dist/messages/metadata.d.ts.map +1 -0
  295. package/dist/libs/langchain-core/dist/messages/utils.d.ts +75 -0
  296. package/dist/libs/langchain-core/dist/messages/utils.d.ts.map +1 -0
  297. package/dist/libs/langchain-core/dist/prompt_values.d.ts.map +1 -1
  298. package/dist/libs/langchain-core/dist/utils/types/index.d.ts +2 -0
  299. package/dist/libs/langchain-core/dist/utils/types/index.d.ts.map +1 -1
  300. package/dist/libs/langchain-core/dist/utils/types/zod.d.ts +1 -0
  301. package/dist/load/import_map.cjs +3 -14
  302. package/dist/load/import_map.cjs.map +1 -1
  303. package/dist/load/import_map.js +3 -14
  304. package/dist/load/import_map.js.map +1 -1
  305. package/dist/memory/prompt.cjs.map +1 -1
  306. package/dist/memory/prompt.d.cts.map +1 -1
  307. package/dist/memory/prompt.d.ts.map +1 -1
  308. package/dist/memory/prompt.js.map +1 -1
  309. package/dist/output_parsers/combining.cjs +1 -1
  310. package/dist/output_parsers/combining.cjs.map +1 -1
  311. package/dist/output_parsers/combining.js +1 -1
  312. package/dist/output_parsers/combining.js.map +1 -1
  313. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.cjs.map +1 -1
  314. package/dist/output_parsers/expression_type_handlers/array_literal_expression_handler.js.map +1 -1
  315. package/dist/output_parsers/expression_type_handlers/base.cjs +1 -1
  316. package/dist/output_parsers/expression_type_handlers/base.cjs.map +1 -1
  317. package/dist/output_parsers/expression_type_handlers/base.js +1 -1
  318. package/dist/output_parsers/expression_type_handlers/base.js.map +1 -1
  319. package/dist/output_parsers/regex.cjs.map +1 -1
  320. package/dist/output_parsers/regex.js.map +1 -1
  321. package/dist/output_parsers/structured.cjs +4 -4
  322. package/dist/output_parsers/structured.cjs.map +1 -1
  323. package/dist/output_parsers/structured.d.cts +1 -1
  324. package/dist/output_parsers/structured.d.cts.map +1 -1
  325. package/dist/output_parsers/structured.d.ts +1 -1
  326. package/dist/output_parsers/structured.d.ts.map +1 -1
  327. package/dist/output_parsers/structured.js +2 -2
  328. package/dist/output_parsers/structured.js.map +1 -1
  329. package/dist/retrievers/ensemble.cjs.map +1 -1
  330. package/dist/retrievers/ensemble.js.map +1 -1
  331. package/dist/storage/file_system.cjs +1 -1
  332. package/dist/storage/file_system.cjs.map +1 -1
  333. package/dist/storage/file_system.js +1 -1
  334. package/dist/storage/file_system.js.map +1 -1
  335. package/dist/tools/fs.cjs +5 -5
  336. package/dist/tools/fs.cjs.map +1 -1
  337. package/dist/tools/fs.d.cts +1 -1
  338. package/dist/tools/fs.d.cts.map +1 -1
  339. package/dist/tools/fs.d.ts +1 -1
  340. package/dist/tools/fs.d.ts.map +1 -1
  341. package/dist/tools/fs.js +1 -1
  342. package/dist/tools/fs.js.map +1 -1
  343. package/dist/tools/retriever.cjs +2 -2
  344. package/dist/tools/retriever.cjs.map +1 -1
  345. package/dist/tools/retriever.d.cts +1 -1
  346. package/dist/tools/retriever.d.cts.map +1 -1
  347. package/dist/tools/retriever.d.ts +1 -1
  348. package/dist/tools/retriever.d.ts.map +1 -1
  349. package/dist/tools/retriever.js +1 -1
  350. package/dist/tools/retriever.js.map +1 -1
  351. package/dist/tools/sql.cjs +1 -2
  352. package/dist/tools/sql.cjs.map +1 -1
  353. package/dist/tools/sql.d.cts +1 -1
  354. package/dist/tools/sql.d.cts.map +1 -1
  355. package/dist/tools/sql.d.ts +1 -1
  356. package/dist/tools/sql.d.ts.map +1 -1
  357. package/dist/tools/sql.js +1 -2
  358. package/dist/tools/sql.js.map +1 -1
  359. package/dist/types/expression-parser.d.cts +2 -0
  360. package/dist/types/expression-parser.d.cts.map +1 -1
  361. package/dist/types/expression-parser.d.ts +2 -0
  362. package/dist/types/expression-parser.d.ts.map +1 -1
  363. package/dist/util/hub.cjs +1 -1
  364. package/dist/util/hub.js +1 -1
  365. package/dist/util/openapi.cjs +1 -1
  366. package/dist/util/openapi.cjs.map +1 -1
  367. package/dist/util/openapi.js +1 -1
  368. package/dist/util/openapi.js.map +1 -1
  369. package/package.json +15 -21
  370. package/dist/agents/middlewareAgent/middlewares/hitl.cjs +0 -235
  371. package/dist/agents/middlewareAgent/middlewares/hitl.cjs.map +0 -1
  372. package/dist/agents/middlewareAgent/middlewares/hitl.d.cts +0 -199
  373. package/dist/agents/middlewareAgent/middlewares/hitl.d.cts.map +0 -1
  374. package/dist/agents/middlewareAgent/middlewares/hitl.d.ts +0 -199
  375. package/dist/agents/middlewareAgent/middlewares/hitl.d.ts.map +0 -1
  376. package/dist/agents/middlewareAgent/middlewares/hitl.js +0 -234
  377. package/dist/agents/middlewareAgent/middlewares/hitl.js.map +0 -1
  378. package/dist/agents/middlewareAgent/middlewares/index.cjs +0 -8
  379. package/dist/agents/middlewareAgent/middlewares/index.d.cts +0 -4
  380. package/dist/agents/middlewareAgent/middlewares/index.d.ts +0 -4
  381. package/dist/agents/middlewareAgent/middlewares/index.js +0 -5
  382. package/dist/agents/middlewareAgent/middlewares/promptCaching.cjs.map +0 -1
  383. package/dist/agents/middlewareAgent/middlewares/promptCaching.d.cts.map +0 -1
  384. package/dist/agents/middlewareAgent/middlewares/promptCaching.d.ts.map +0 -1
  385. package/dist/agents/middlewareAgent/middlewares/promptCaching.js.map +0 -1
  386. package/dist/agents/middlewareAgent/middlewares/summarization.cjs.map +0 -1
  387. package/dist/agents/middlewareAgent/middlewares/summarization.d.cts.map +0 -1
  388. package/dist/agents/middlewareAgent/middlewares/summarization.d.ts.map +0 -1
  389. package/dist/agents/middlewareAgent/middlewares/summarization.js.map +0 -1
  390. package/dist/chains/openai_functions/structured_output.cjs +0 -107
  391. package/dist/chains/openai_functions/structured_output.cjs.map +0 -1
  392. package/dist/chains/openai_functions/structured_output.d.cts +0 -38
  393. package/dist/chains/openai_functions/structured_output.d.cts.map +0 -1
  394. package/dist/chains/openai_functions/structured_output.d.ts +0 -38
  395. package/dist/chains/openai_functions/structured_output.d.ts.map +0 -1
  396. package/dist/chains/openai_functions/structured_output.js +0 -105
  397. package/dist/chains/openai_functions/structured_output.js.map +0 -1
  398. package/dist/chains/openai_moderation.cjs +0 -107
  399. package/dist/chains/openai_moderation.cjs.map +0 -1
  400. package/dist/chains/openai_moderation.d.cts +0 -74
  401. package/dist/chains/openai_moderation.d.cts.map +0 -1
  402. package/dist/chains/openai_moderation.d.ts +0 -74
  403. package/dist/chains/openai_moderation.d.ts.map +0 -1
  404. package/dist/chains/openai_moderation.js +0 -106
  405. package/dist/chains/openai_moderation.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","names":["ContentBlock","ResponseMetadata","UsageMetadata","$MergeDiscriminatedUnion","$MergeObjects","MessageType","NonNullable","MessageOutputVersion","MessageToolDefinition","TInput","TOutput","MessageToolSet","$MessageToolCallBlock","MessageStructure","TStructure","K","Tools","ToolCall","Partial","Record","$NormalizeMessageOutputVersion","T","Extract","$MergeOutputVersion","U","TV","UV","Exclude","$MergeContentDefinition","$MergeMessageStructure","StandardMessageStructure","Text","$NormalizedMessageStructure","$InferMessageContentBlocks","S","C","PropertyKey","TRole","$InferMessageContent","Array","$InferMessageProperties","P","Omit","$InferMessageProperty","$InferResponseMetadata","Message","isMessage"],"sources":["../../../../../../langchain-core/dist/messages/message.d.ts"],"sourcesContent":["import { ContentBlock } from \"./content/index.js\";\nimport { ResponseMetadata, UsageMetadata } from \"./metadata.js\";\nimport { $MergeDiscriminatedUnion, $MergeObjects } from \"./utils.js\";\n\n//#region src/messages/message.d.ts\n\n/**\n * Represents the possible types of messages in the system.\n * Includes standard message types (\"ai\", \"human\", \"tool\", \"system\")\n * and allows for custom string types that are non-null.\n *\n * @example\n * ```ts\n * // Standard message types\n * const messageType1: MessageType = \"ai\";\n * const messageType2: MessageType = \"human\";\n *\n * // Custom message type\n * const messageType3: MessageType = \"custom_type\";\n * ```\n */\ntype MessageType = \"ai\" | \"human\" | \"tool\" | \"system\" | (string & NonNullable<unknown>);\n/**\n * Represents the output version format for message content.\n *\n * This type determines how the content field is structured in a message:\n * - \"v0\": Content is represented as a simple string or array of content blocks\n * - provides backward compatibility with simpler content representations\n * - \"v1\": Content follows the structured ContentBlock format with typed discriminated unions\n * - enables full type safety and structured content block handling\n *\n * @example\n * ```ts\n * // v0 format - simple content representation\n * const v0Message: Message<{ outputVersion: \"v0\", content: ... }> = {\n * type: \"human\",\n * content: \"Hello world\" // string | Array<ContentBlock | ContentBlock.Text>\n * };\n *\n * // v1 format - structured content blocks\n * const v1Message: Message<{ outputVersion: \"v1\", content: ... }> = {\n * type: \"human\",\n * content: [\n * { type: \"text\", text: \"Hello world\" },\n * { type: \"image\", image_url: \"...\" }\n * ] // Array<ContentBlock | ...> (determined by the structure)\n * };\n * ```\n */\ntype MessageOutputVersion = \"v0\" | \"v1\";\n/**\n * Represents the input and output types of a tool that can be used in messages.\n *\n * @template TInput - The type of input the tool accepts.\n * @template TOutput - The type of output the tool produces.\n *\n * @example\n * ```ts\n * // Tool that takes a string input and returns a number\n * interface StringToNumberTool extends MessageToolDefinition<string, number> {\n * input: string;\n * output: number;\n * }\n * ```\n */\ninterface MessageToolDefinition<TInput = unknown, TOutput = unknown> {\n input: TInput;\n output: TOutput;\n}\n/**\n * Represents a structured set of tools by mapping tool names to definitions\n * that can be used in messages.\n *\n * @example\n * ```ts\n * interface MyToolSet extends MessageToolSet {\n * calculator: MessageToolDefinition<\n * { operation: string; numbers: number[] },\n * number\n * >;\n * translator: MessageToolDefinition<\n * { text: string; targetLanguage: string },\n * string\n * >;\n * }\n * ```\n */\ninterface MessageToolSet {\n [key: string]: MessageToolDefinition;\n}\n/**\n * Represents a tool call block within a message structure by mapping tool names to their\n * corresponding tool call formats, including the input arguments and an optional identifier.\n *\n * @template TStructure - A message structure type that may contain tool definitions\n *\n * @example\n * ```ts\n * // Given a message structure with a calculator tool:\n * interface MyStructure extends MessageStructure {\n * tools: {\n * calculator: MessageToolDefinition<{ operation: string, numbers: number[] }, number>\n * }\n * }\n *\n * // The tool call block would be:\n * type CalcToolCall = $MessageToolCallBlock<MyStructure>;\n * // Resolves to:\n * // {\n * // type: \"tool_call\";\n * // name: \"calculator\";\n * // args: { operation: string, numbers: number[] };\n * // id?: string;\n * // }\n * ```\n */\ntype $MessageToolCallBlock<TStructure extends MessageStructure> = TStructure[\"tools\"] extends MessageToolSet ? { [K in keyof TStructure[\"tools\"]]: K extends string ? TStructure[\"tools\"][K] extends MessageToolDefinition ? ContentBlock.Tools.ToolCall<K, TStructure[\"tools\"][K][\"input\"]> : never : never }[keyof TStructure[\"tools\"]] : never;\n/**\n * Core interface that defines the structure of messages.\n *\n * @example\n * ```ts\n * // Basic message structure with just content blocks\n * interface SimpleMessageStructure extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * // allows for text + reasoning blocks in ai messages\n * ai: ContentBlock.Text | ContentBlock.Reasoning;\n * }\n * }\n *\n * // Message structure with tools and properties\n * interface AdvancedMessageStructure extends MessageStructure {\n * tools: {\n * calculator: MessageToolDefinition<\n * { operation: string; numbers: number[] },\n * number\n * >;\n * };\n * content: {\n * // allows for text + image blocks in human messages\n * human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * // only allows for text blocks in ai messages\n * ai: ContentBlock.Text;\n * };\n * properties: {\n * // pins properties to ai messages\n * ai: {\n * response_metadata: {\n * confidence: number;\n * model: string;\n * };\n * };\n * }\n * }\n *\n * // Using with $MergeMessageStructure to combine structures\n * // The resulting type when passed into BaseMessage will have a calculator tool,\n * // allow for text + image blocks in human messages,\n * // and text + reasoning blocks + additional arbitrary properties in ai messages.\n * type CombinedStructure = $MergeMessageStructure<\n * SimpleMessageStructure,\n * AdvancedMessageStructure\n * >;\n *\n * // Using in a Message object\n * const message: Message<CombinedStructure> = {\n * id: \"msg-123\",\n * type: \"human\",\n * content: [\n * { type: \"text\", text: \"Hello!\" }\n * { type: \"image\", mimeType: \"image/jpeg\", url: \"https://example.com/image.jpg\" }\n * // this block will throw an error because it's not defined in the structure\n * { type: \"reasoning\", reasoning: \"The answer is 42\" }\n * ]\n * };\n * ```\n */\ninterface MessageStructure {\n /**\n * Optional output version for the message structure.\n * If not provided, defaults to \"v0\".\n */\n readonly outputVersion?: MessageOutputVersion;\n /**\n * Optional set of tool definitions that can be used in messages.\n * Each tool is defined with input/output types and can be referenced in tool messages.\n */\n readonly tools?: MessageToolSet;\n /**\n * Optional mapping of message types to their allowed content blocks.\n * Each message type can specify what content block types it supports (text, images, etc).\n */\n readonly content?: Partial<{ [key in MessageType]: ContentBlock }>;\n /**\n * Optional mapping of message types to arbitrary property objects.\n * Allows attaching custom metadata or other information to specific message types.\n */\n readonly properties?: Partial<{ [key in MessageType]: Record<string, unknown> }>;\n}\n/**\n * Normalizes an arbitrary type to a message output version or undefined.\n * Accepts unknown and narrows to a valid MessageOutputVersion if present.\n */\ntype $NormalizeMessageOutputVersion<T> = Extract<T, MessageOutputVersion> | undefined;\n/**\n * Merges two output version types from message structures.\n *\n * This utility type determines the resulting output version when combining two message structures.\n * The merge logic follows these rules:\n *\n * - If both T and U are undefined, defaults to \"v0\" for backwards compatibility\n * - If T is undefined but U is defined, uses U's version\n * - If U is undefined but T is defined, uses T's version\n * - If both T and U are defined, U takes precedence (later structure wins)\n *\n * @template T - The output version from the first message structure\n * @template U - The output version from the second message structure\n *\n * @example\n * ```ts\n * // Both undefined - defaults to \"v0\"\n * type Result1 = $MergeOutputVersion<undefined, undefined>; // \"v0\"\n *\n * // One defined - uses the defined version\n * type Result2 = $MergeOutputVersion<undefined, \"v1\">; // \"v1\"\n * type Result3 = $MergeOutputVersion<\"v0\", undefined>; // \"v0\"\n *\n * // Both defined - second takes precedence\n * type Result4 = $MergeOutputVersion<\"v0\", \"v1\">; // \"v1\"\n * ```\n */\ntype $MergeOutputVersion<T, U> = $NormalizeMessageOutputVersion<T> extends infer TV ? $NormalizeMessageOutputVersion<U> extends infer UV ? [TV, UV] extends [undefined, undefined] ? \"v0\" : [TV] extends [undefined] ? Exclude<UV, undefined> : [UV] extends [undefined] ? Exclude<TV, undefined> : UV : never : never;\n/**\n * Merges two content definition objects from message structures.\n *\n * This utility type combines content definitions from two message structures, handling\n * the merging of content block types for each message type. The merge logic follows\n * these rules:\n *\n * - For keys that exist in both T and U: Merges the content blocks using discriminated\n * union merging based on the \"type\" property. This allows combining different content\n * block types (e.g., text + image) for the same message type.\n * - For keys that exist only in T: Uses T's content definition as-is\n * - For keys that exist only in U: Uses U's content definition as-is\n *\n * @template T - The content definition from the first message structure\n * @template U - The content definition from the second message structure\n *\n * @example\n * ```ts\n * // T allows text content for human messages\n * type ContentA = {\n * human: ContentBlock.Text;\n * };\n *\n * // U allows image content for human messages and text for AI messages\n * type ContentB = {\n * human: ContentBlock.Multimodal.Image;\n * ai: ContentBlock.Text;\n * };\n *\n * // Merged result allows both text and images for human messages, text for AI\n * type Merged = $MergeContentDefinition<ContentA, ContentB>;\n * // Result: {\n * // human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * // ai: ContentBlock.Text;\n * // }\n * ```\n */\ntype $MergeContentDefinition<T, U> = { [K in keyof T | keyof U as Extract<(K extends keyof T ? T[K] : never) | (K extends keyof U ? U[K] : never), ContentBlock> extends never ? never : K]: K extends keyof T ? K extends keyof U ? $MergeDiscriminatedUnion<Extract<T[K], ContentBlock>, Extract<U[K], ContentBlock>, \"type\"> : Extract<T[K], ContentBlock> : K extends keyof U ? Extract<U[K], ContentBlock> : never };\n/**\n * Merges two message structures A and B into a combined structure.\n * This is a type utility that handles merging of tools, content blocks, and properties\n * from two message structures. The resulting type is usable as its own message structure.\n *\n * @example\n * ```ts\n * // Structure A allows text in human messages and has a confidence property on AI messages\n * interface StructureA extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * };\n * properties: {\n * ai: { confidence: number };\n * }\n * }\n *\n * // Structure B allows images in human messages and has a model property on AI messages\n * interface StructureB extends MessageStructure {\n * content: {\n * human: ContentBlock.Multimodal.Image;\n * };\n * properties: {\n * ai: { model: string };\n * }\n * }\n *\n * // Merged structure allows both text and images in human messages\n * // AI messages have both confidence and model properties\n * type Merged = $MergeMessageStructure<StructureA, StructureB>;\n * ```\n *\n * @template A - First message structure to merge\n * @template B - Second message structure to merge (takes precedence over A)\n */\ntype $MergeMessageStructure<T extends MessageStructure, U extends MessageStructure> = {\n outputVersion: $MergeOutputVersion<T[\"outputVersion\"], U[\"outputVersion\"]>;\n tools: $MergeObjects<T[\"tools\"], U[\"tools\"]>;\n content: $MergeContentDefinition<T[\"content\"], U[\"content\"]>;\n properties: $MergeObjects<T[\"properties\"], U[\"properties\"]>;\n};\n/**\n * Standard message structured used to define the most basic message structure that's\n * used throughout the library.\n *\n * This is also the message structure that's used when a message structure is not provided.\n */\ninterface StandardMessageStructure extends MessageStructure {\n content: {\n /** Text content for AI messages */\n ai: ContentBlock.Text;\n /** Text content for human messages */\n human: ContentBlock.Text;\n /** Text content for system messages */\n system: ContentBlock.Text;\n /** Text content for tool messages */\n tool: ContentBlock.Text;\n };\n properties: {\n /** Properties specific to AI messages */\n ai: {\n /** Metadata about the AI model response */\n response_metadata: ResponseMetadata;\n /** Usage statistics for the AI response */\n usage_metadata: UsageMetadata;\n };\n human: {\n /** Metadata about the human message */\n response_metadata: Record<string, unknown>;\n };\n system: {\n /** Metadata about the system message */\n response_metadata: Record<string, unknown>;\n };\n tool: {\n /** Metadata about the tool message */\n response_metadata: Record<string, unknown>;\n };\n };\n}\n/**\n * Takes a message structure type T and normalizes it by merging it with the standard message structure.\n * If T is already a standard message structure, returns T unchanged.\n *\n * This ensures that any custom message structure includes all the standard message structure fields\n * by default while allowing overrides and extensions.\n *\n * @template T - The message structure type to normalize, must extend MessageStructure\n * @returns Either T if it's already a standard structure, or the merged result of T with standard structure\n */\ntype $NormalizedMessageStructure<T extends MessageStructure> = T extends StandardMessageStructure ? T : $MergeMessageStructure<StandardMessageStructure, T>;\n/**\n * Infers the content blocks for a specific message type in a message structure.\n *\n * This utility type extracts the content block type that corresponds to a given message type\n * from the message structure's content definition.\n *\n * @template TStructure - The message structure to infer content from\n * @template TRole - The message role/type to get content for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The content block type for the specified type, or never if its not defined in the structure\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.ToolCall;\n * };\n * }\n *\n * type HumanContent = $InferMessageContentBlocks<MyStructure, \"human\">;\n * // HumanContent = ContentBlock.Text\n *\n * type AIContent = $InferMessageContentBlocks<MyStructure, \"ai\">;\n * // AIContent = ContentBlock.Text | ContentBlock.ToolCall\n * ```\n */\ntype $InferMessageContentBlocks<TStructure extends MessageStructure, TRole extends MessageType> = $NormalizedMessageStructure<TStructure> extends infer S ? S extends MessageStructure ? S[\"content\"] extends infer C ? C extends Record<PropertyKey, ContentBlock> ? TRole extends keyof C ? [$MessageToolCallBlock<TStructure>] extends [never] ? C[TRole] : $MergeDiscriminatedUnion<NonNullable<C[TRole]>, $MessageToolCallBlock<TStructure>, \"type\"> : never : never : never : never : never;\n/**\n * Infers the content type for a specific message type from a message structure.\n *\n * This utility type determines the appropriate content type based on the message structure's\n * output version and the specified message type. The content type varies depending on the\n * output version (see {@link MessageOutputVersion})\n *\n * @template TStructure - The message structure to infer content from\n * @template TRole - The message role/type to get content for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The content type for the specified role based on the output version\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * outputVersion: \"v0\";\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.ToolCall;\n * };\n * }\n *\n * type HumanContentV0 = $InferMessageContent<MyStructure, \"human\">;\n * // HumanContentV0 = string | Array<ContentBlock | ContentBlock.Text>\n *\n * interface MyStructureV1 extends MessageStructure {\n * outputVersion: \"v1\";\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.Reasoning;\n * };\n * }\n *\n * type HumanContentV1 = $InferMessageContent<MyStructureV1, \"human\">;\n * // HumanContentV1 = ContentBlock.Text\n *\n * type AIContentV1 = $InferMessageContent<MyStructureV1, \"ai\">;\n * // AIContentV1 = ContentBlock.Text | ContentBlock.Reasoning\n * ```\n */\ntype $InferMessageContent<TStructure extends MessageStructure, TRole extends MessageType> = TStructure[\"outputVersion\"] extends \"v1\" ? Array<$InferMessageContentBlocks<TStructure, TRole>> : string | Array<ContentBlock | ContentBlock.Text>;\n/**\n * Infers the properties for a specific message type from a message structure.\n *\n * This utility type extracts the properties object that corresponds to a given message type\n * from the message structure's properties definition, and excludes the reserved\n * \"content\" and \"type\" properties to avoid conflicts with the core message structure.\n *\n * If the specified type is not defined in the message structure's properties, it returns\n * a generic Record<string, unknown> type to allow for arbitrary properties.\n *\n * @template TStructure - The message structure to infer properties from\n * @template TRole - The message type/role to get properties for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The properties object type for the specified type, excluding \"content\" and \"type\"\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string };\n * usage_metadata: { tokens: number };\n * content: string; // This will be omitted\n * type: string; // This will be omitted\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type AIProperties = $InferMessageProperties<MyStructure, \"ai\">;\n * // AIProperties = { response_metadata: { model: string }; usage_metadata: { tokens: number } }\n *\n * type HumanProperties = $InferMessageProperties<MyStructure, \"human\">;\n * // HumanProperties = { metadata: Record<string, unknown> }\n *\n * type SystemProperties = $InferMessageProperties<MyStructure, \"system\">;\n * // SystemProperties = Record<string, unknown> (fallback for undefined role)\n * ```\n */\ntype $InferMessageProperties<TStructure extends MessageStructure, TRole extends MessageType> = $NormalizedMessageStructure<TStructure> extends infer S ? S extends MessageStructure ? S[\"properties\"] extends infer P | undefined ? P extends Record<PropertyKey, unknown> ? TRole extends keyof P ? Omit<P[TRole], \"content\" | \"type\"> : Record<string, unknown> : Record<string, unknown> : Record<string, unknown> : never : never;\n/**\n * Infers the type of a specific property for a message type from a message structure.\n *\n * This utility type extracts the type of a single property by name from the properties\n * object that corresponds to a given message type. If the specified property key does\n * not exist in the type's properties, it returns `never`.\n *\n * @template TStructure - The message structure to infer the property from\n * @template TRole - The message type/role to get the property for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @template K - The property key to extract the type for\n * @returns The type of the specified property, or `never` if the property doesn't exist\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string; temperature: number };\n * usage_metadata: { input_tokens: number; output_tokens: number };\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type ResponseMetadata = $InferMessageProperty<MyStructure, \"ai\", \"response_metadata\">;\n * // ResponseMetadata = { model: string; temperature: number }\n *\n * type UsageMetadata = $InferMessageProperty<MyStructure, \"ai\", \"usage_metadata\">;\n * // UsageMetadata = { input_tokens: number; output_tokens: number }\n *\n * type NonExistentProperty = $InferMessageProperty<MyStructure, \"ai\", \"nonExistent\">;\n * // NonExistentProperty = Record<string, unknown>\n *\n * type HumanMetadata = $InferMessageProperty<MyStructure, \"human\", \"metadata\">;\n * // HumanMetadata = Record<string, unknown>\n * ```\n */\ntype $InferMessageProperty<TStructure extends MessageStructure, TRole extends MessageType, K extends string> = K extends keyof $InferMessageProperties<TStructure, TRole> ? $InferMessageProperties<TStructure, TRole>[K] : never;\n/**\n * Infers the response metadata type for a specific message type from a message structure.\n *\n * This utility type extracts the `response_metadata` property type for a given message type.\n *\n * @template TStructure - The message structure to infer the response metadata from\n * @template TRole - The message type/role to get the response metadata for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The type of the response_metadata property, or `Record<string, unknown>` as fallback\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string; temperature: number; tokens: number };\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type AIResponseMetadata = $InferResponseMetadata<MyStructure, \"ai\">;\n * // AIResponseMetadata = { model: string; temperature: number; tokens: number }\n *\n * type HumanResponseMetadata = $InferResponseMetadata<MyStructure, \"human\">;\n * // HumanResponseMetadata = Record<string, unknown> (fallback since not defined)\n * ```\n */\ntype $InferResponseMetadata<TStructure extends MessageStructure, TRole extends MessageType> = $InferMessageProperty<TStructure, TRole, \"response_metadata\"> extends infer P ? [P] extends [never] ? Record<string, unknown> : P : never;\n/**\n * Represents a message object that organizes context for an LLM.\n *\n * @example\n * ```ts\n * // Basic message with text content\n * const message: Message = {\n * id: \"msg-123\",\n * name: \"user\",\n * type: \"human\",\n * content: [{ type: \"text\", text: \"Hello!\" }]\n * };\n *\n * // Basic ai message interface extension\n * interface MyMessage extends Message<StandardMessageStructure, \"ai\"> {\n * // Additional AI-specific properties can be added here\n * }\n *`\n * // Custom message structure\n * interface CustomStructure extends MessageStructure {\n * content: {\n * ai: ContentBlock.Text | ContentBlock.ToolCall<\"search\", { query: string }>;\n * human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * };\n * }\n *\n * // Create a message with custom structure\n * const message: Message<CustomStructure> = {\n * id: \"msg-123\",\n * name: \"user\",\n * type: \"ai\",\n * content: [\n * { type: \"text\", text: \"Hello!\" },\n * {\n * type: \"tool_call\",\n * name: \"search\",\n * args: { query: \"What is the capital of France?\" }\n * }\n * ]\n * };\n * ```\n */\ninterface Message<TStructure extends MessageStructure = StandardMessageStructure, TRole extends MessageType = MessageType> {\n /** The message type/role */\n readonly type: TRole;\n /** Unique identifier for this message */\n id?: string;\n /** Optional name/identifier for the entity that created this message */\n name?: string;\n /** Array of content blocks that make up the message content */\n content: $InferMessageContent<TStructure, TRole>;\n /** Metadata about the message */\n response_metadata?: Partial<$InferResponseMetadata<TStructure, TRole>>;\n}\n/**\n * Type guard to check if a value is a valid Message object.\n *\n * @param message - The value to check\n * @returns true if the value is a valid Message object, false otherwise\n */\ndeclare function isMessage(message: unknown): message is Message;\n//#endregion\nexport { $InferMessageContent, $InferMessageContentBlocks, $InferMessageProperties, $InferMessageProperty, $InferResponseMetadata, $MergeContentDefinition, $MergeMessageStructure, $MergeOutputVersion, $MessageToolCallBlock, $NormalizedMessageStructure, Message, MessageOutputVersion, MessageStructure, MessageToolDefinition, MessageToolSet, MessageType, StandardMessageStructure, isMessage };\n//# sourceMappingURL=message.d.ts.map"],"mappings":"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"}
@@ -0,0 +1,97 @@
1
+ //#region ../langchain-core/dist/messages/metadata.d.ts
2
+ //#region src/messages/metadata.d.ts
3
+ type ResponseMetadata = {
4
+ model_provider?: string;
5
+ model_name?: string;
6
+ [key: string]: unknown;
7
+ };
8
+ type ModalitiesTokenDetails = {
9
+ /**
10
+ * Text tokens.
11
+ * Does not need to be reported, but some models will do so.
12
+ */
13
+ text?: number;
14
+ /**
15
+ * Image (non-video) tokens.
16
+ */
17
+ image?: number;
18
+ /**
19
+ * Audio tokens.
20
+ */
21
+ audio?: number;
22
+ /**
23
+ * Video tokens.
24
+ */
25
+ video?: number;
26
+ /**
27
+ * Document tokens.
28
+ * e.g. PDF
29
+ */
30
+ document?: number;
31
+ };
32
+ /**
33
+ * Breakdown of input token counts.
34
+ *
35
+ * Does not *need* to sum to full input token count. Does *not* need to have all keys.
36
+ */
37
+ type InputTokenDetails = ModalitiesTokenDetails & {
38
+ /**
39
+ * Input tokens that were cached and there was a cache hit.
40
+ *
41
+ * Since there was a cache hit, the tokens were read from the cache.
42
+ * More precisely, the model state given these tokens was read from the cache.
43
+ */
44
+ cache_read?: number;
45
+ /**
46
+ * Input tokens that were cached and there was a cache miss.
47
+ *
48
+ * Since there was a cache miss, the cache was created from these tokens.
49
+ */
50
+ cache_creation?: number;
51
+ };
52
+ /**
53
+ * Breakdown of output token counts.
54
+ *
55
+ * Does *not* need to sum to full output token count. Does *not* need to have all keys.
56
+ */
57
+ type OutputTokenDetails = ModalitiesTokenDetails & {
58
+ /**
59
+ * Reasoning output tokens.
60
+ *
61
+ * Tokens generated by the model in a chain of thought process (i.e. by
62
+ * OpenAI's o1 models) that are not returned as part of model output.
63
+ */
64
+ reasoning?: number;
65
+ };
66
+ /**
67
+ * Usage metadata for a message, such as token counts.
68
+ */
69
+ type UsageMetadata = {
70
+ /**
71
+ * Count of input (or prompt) tokens. Sum of all input token types.
72
+ */
73
+ input_tokens: number;
74
+ /**
75
+ * Count of output (or completion) tokens. Sum of all output token types.
76
+ */
77
+ output_tokens: number;
78
+ /**
79
+ * Total token count. Sum of input_tokens + output_tokens.
80
+ */
81
+ total_tokens: number;
82
+ /**
83
+ * Breakdown of input token counts.
84
+ *
85
+ * Does *not* need to sum to full input token count. Does *not* need to have all keys.
86
+ */
87
+ input_token_details?: InputTokenDetails;
88
+ /**
89
+ * Breakdown of output token counts.
90
+ *
91
+ * Does *not* need to sum to full output token count. Does *not* need to have all keys.
92
+ */
93
+ output_token_details?: OutputTokenDetails;
94
+ };
95
+ //#endregion
96
+ export { ResponseMetadata, UsageMetadata };
97
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","names":["ResponseMetadata","mergeResponseMetadata","ModalitiesTokenDetails","InputTokenDetails","OutputTokenDetails","UsageMetadata","mergeUsageMetadata"],"sources":["../../../../../../langchain-core/dist/messages/metadata.d.ts"],"sourcesContent":["//#region src/messages/metadata.d.ts\ntype ResponseMetadata = {\n model_provider?: string;\n model_name?: string;\n [key: string]: unknown;\n};\ndeclare function mergeResponseMetadata(a?: ResponseMetadata, b?: ResponseMetadata): ResponseMetadata;\ntype ModalitiesTokenDetails = {\n /**\n * Text tokens.\n * Does not need to be reported, but some models will do so.\n */\n text?: number;\n /**\n * Image (non-video) tokens.\n */\n image?: number;\n /**\n * Audio tokens.\n */\n audio?: number;\n /**\n * Video tokens.\n */\n video?: number;\n /**\n * Document tokens.\n * e.g. PDF\n */\n document?: number;\n};\n/**\n * Breakdown of input token counts.\n *\n * Does not *need* to sum to full input token count. Does *not* need to have all keys.\n */\ntype InputTokenDetails = ModalitiesTokenDetails & {\n /**\n * Input tokens that were cached and there was a cache hit.\n *\n * Since there was a cache hit, the tokens were read from the cache.\n * More precisely, the model state given these tokens was read from the cache.\n */\n cache_read?: number;\n /**\n * Input tokens that were cached and there was a cache miss.\n *\n * Since there was a cache miss, the cache was created from these tokens.\n */\n cache_creation?: number;\n};\n/**\n * Breakdown of output token counts.\n *\n * Does *not* need to sum to full output token count. Does *not* need to have all keys.\n */\ntype OutputTokenDetails = ModalitiesTokenDetails & {\n /**\n * Reasoning output tokens.\n *\n * Tokens generated by the model in a chain of thought process (i.e. by\n * OpenAI's o1 models) that are not returned as part of model output.\n */\n reasoning?: number;\n};\n/**\n * Usage metadata for a message, such as token counts.\n */\ntype UsageMetadata = {\n /**\n * Count of input (or prompt) tokens. Sum of all input token types.\n */\n input_tokens: number;\n /**\n * Count of output (or completion) tokens. Sum of all output token types.\n */\n output_tokens: number;\n /**\n * Total token count. Sum of input_tokens + output_tokens.\n */\n total_tokens: number;\n /**\n * Breakdown of input token counts.\n *\n * Does *not* need to sum to full input token count. Does *not* need to have all keys.\n */\n input_token_details?: InputTokenDetails;\n /**\n * Breakdown of output token counts.\n *\n * Does *not* need to sum to full output token count. Does *not* need to have all keys.\n */\n output_token_details?: OutputTokenDetails;\n};\ndeclare function mergeUsageMetadata(a?: UsageMetadata, b?: UsageMetadata): UsageMetadata;\n//#endregion\nexport { InputTokenDetails, ModalitiesTokenDetails, OutputTokenDetails, ResponseMetadata, UsageMetadata, mergeResponseMetadata, mergeUsageMetadata };\n//# sourceMappingURL=metadata.d.ts.map"],"mappings":";;KACKA,gBAAAA,GAAgB;EAK+E,cAC/FE,CAAAA,EAAAA,MAAAA;EAAsB,UA6BtBC,CAAAA,EAAAA,MAAAA;EAA0C,CAAA,GAoB1CC,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;AAA2C,CAAA;KAjD3CF,sBAAAA,GA+EmBC;EAAiB;AAME;;;;;;;;;;;;;;;;;;;;;;;;;;;KAxDtCA,iBAAAA,GAAoBD;;;;;;;;;;;;;;;;;;;;KAoBpBE,kBAAAA,GAAqBF;;;;;;;;;;;;KAYrBG,aAAAA;;;;;;;;;;;;;;;;;;wBAkBmBF;;;;;;yBAMCC"}
@@ -0,0 +1,75 @@
1
+ //#region ../langchain-core/dist/messages/utils.d.ts
2
+
3
+ /**
4
+ * Extracts the explicitly declared keys from a type T.
5
+ *
6
+ * @template T - The type to extract keys from
7
+ * @returns A union of keys that are not string, number, or symbol
8
+ */
9
+ type $KnownKeys<T> = { [K in keyof T]: string extends K ? never : number extends K ? never : symbol extends K ? never : K }[keyof T];
10
+ /**
11
+ * Detects if T has an index signature.
12
+ *
13
+ * @template T - The type to check for index signatures
14
+ * @returns True if T has an index signature, false otherwise
15
+ */
16
+ type $HasIndexSignature<T> = string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : false;
17
+ /**
18
+ * Detects if T has an index signature and no known keys.
19
+ *
20
+ * @template T - The type to check for index signatures and no known keys
21
+ * @returns True if T has an index signature and no known keys, false otherwise
22
+ */
23
+ type $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<T>] extends [never] ? true : false : false;
24
+ /**
25
+ * Recursively merges two object types T and U, with U taking precedence over T.
26
+ *
27
+ * This utility type performs a deep merge of two object types:
28
+ * - For keys that exist in both T and U:
29
+ * - If both values are objects (Record<string, unknown>), recursively merge them
30
+ * - Otherwise, U's value takes precedence
31
+ * - For keys that exist only in T, use T's value
32
+ * - For keys that exist only in U, use U's value
33
+ *
34
+ * @template T - The first object type to merge
35
+ * @template U - The second object type to merge (takes precedence over T)
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * type ObjectA = {
40
+ * shared: { a: string; b: number };
41
+ * onlyInA: boolean;
42
+ * };
43
+ *
44
+ * type ObjectB = {
45
+ * shared: { b: string; c: Date };
46
+ * onlyInB: symbol;
47
+ * };
48
+ *
49
+ * type Merged = $MergeObjects<ObjectA, ObjectB>;
50
+ * // Result: {
51
+ * // shared: { a: string; b: string; c: Date };
52
+ * // onlyInA: boolean;
53
+ * // onlyInB: symbol;
54
+ * // }
55
+ * ```
56
+ */
57
+ type $MergeObjects<T, U> =
58
+ // If U is purely index-signature based, prefer U as a whole
59
+ $OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true ? U : { [K in keyof T | keyof U]: K extends keyof T ? K extends keyof U ? T[K] extends Record<string, unknown> ? U[K] extends Record<string, unknown> ? $MergeObjects<T[K], U[K]> : U[K] : U[K] : T[K] : K extends keyof U ? U[K] : never };
60
+ /**
61
+ * Merges two discriminated unions A and B based on a discriminator key (defaults to "type").
62
+ * For each possible value of the discriminator across both unions:
63
+ * - If B has a member with that discriminator value, use B's member
64
+ * - Otherwise use A's member with that discriminator value
65
+ * This effectively merges the unions while giving B's members precedence over A's members.
66
+ *
67
+ * @template A - First discriminated union type that extends Record<Key, PropertyKey>
68
+ * @template B - Second discriminated union type that extends Record<Key, PropertyKey>
69
+ * @template Key - The discriminator key property, defaults to "type"
70
+ */
71
+ type $MergeDiscriminatedUnion<A extends Record<Key, PropertyKey>, B extends Record<Key, PropertyKey>, Key extends PropertyKey = "type"> = { [T in A[Key] | B[Key]]: [Extract<B, Record<Key, T>>] extends [never] // Check if B has a member with this discriminator value
72
+ ? Extract<A, Record<Key, T>> : [Extract<A, Record<Key, T>>] extends [never] ? Extract<B, Record<Key, T>> : $MergeObjects<Extract<A, Record<Key, T>>, Extract<B, Record<Key, T>>> }[A[Key] | B[Key]];
73
+ //#endregion
74
+ export { $MergeDiscriminatedUnion, $MergeObjects };
75
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","names":["BaseMessage","BaseMessageLike","StoredMessage","ToolMessage","AIMessage","AIMessageChunk","ChatMessage","ChatMessageChunk","FunctionMessage","FunctionMessageChunk","HumanMessage","HumanMessageChunk","SystemMessage","SystemMessageChunk","MessageStructure","$Expand","T","U","K","$KnownKeys","$HasIndexSignature","$OnlyIndexSignatures","$MergeObjects","Record","$MergeDiscriminatedUnion","Key","PropertyKey","A","B","Extract","Constructor","iife","coerceMessageLikeToMessage","getBufferString","mapStoredMessageToChatMessage","mapStoredMessagesToChatMessages","mapChatMessagesToStoredMessages","convertToChunk"],"sources":["../../../../../../langchain-core/dist/messages/utils.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageLike, StoredMessage } from \"./base.js\";\nimport { ToolMessage } from \"./tool.js\";\nimport { AIMessage, AIMessageChunk } from \"./ai.js\";\nimport { ChatMessage, ChatMessageChunk } from \"./chat.js\";\nimport { FunctionMessage, FunctionMessageChunk } from \"./function.js\";\nimport { HumanMessage, HumanMessageChunk } from \"./human.js\";\nimport { SystemMessage, SystemMessageChunk } from \"./system.js\";\nimport { MessageStructure } from \"./message.js\";\n\n//#region src/messages/utils.d.ts\ntype $Expand<T> = T extends infer U ? { [K in keyof U]: U[K] } : never;\n/**\n * Extracts the explicitly declared keys from a type T.\n *\n * @template T - The type to extract keys from\n * @returns A union of keys that are not string, number, or symbol\n */\ntype $KnownKeys<T> = { [K in keyof T]: string extends K ? never : number extends K ? never : symbol extends K ? never : K }[keyof T];\n/**\n * Detects if T has an index signature.\n *\n * @template T - The type to check for index signatures\n * @returns True if T has an index signature, false otherwise\n */\ntype $HasIndexSignature<T> = string extends keyof T ? true : number extends keyof T ? true : symbol extends keyof T ? true : false;\n/**\n * Detects if T has an index signature and no known keys.\n *\n * @template T - The type to check for index signatures and no known keys\n * @returns True if T has an index signature and no known keys, false otherwise\n */\ntype $OnlyIndexSignatures<T> = $HasIndexSignature<T> extends true ? [$KnownKeys<T>] extends [never] ? true : false : false;\n/**\n * Recursively merges two object types T and U, with U taking precedence over T.\n *\n * This utility type performs a deep merge of two object types:\n * - For keys that exist in both T and U:\n * - If both values are objects (Record<string, unknown>), recursively merge them\n * - Otherwise, U's value takes precedence\n * - For keys that exist only in T, use T's value\n * - For keys that exist only in U, use U's value\n *\n * @template T - The first object type to merge\n * @template U - The second object type to merge (takes precedence over T)\n *\n * @example\n * ```ts\n * type ObjectA = {\n * shared: { a: string; b: number };\n * onlyInA: boolean;\n * };\n *\n * type ObjectB = {\n * shared: { b: string; c: Date };\n * onlyInB: symbol;\n * };\n *\n * type Merged = $MergeObjects<ObjectA, ObjectB>;\n * // Result: {\n * // shared: { a: string; b: string; c: Date };\n * // onlyInA: boolean;\n * // onlyInB: symbol;\n * // }\n * ```\n */\ntype $MergeObjects<T, U> =\n// If U is purely index-signature based, prefer U as a whole\n$OnlyIndexSignatures<U> extends true ? U : $OnlyIndexSignatures<T> extends true ? U : { [K in keyof T | keyof U]: K extends keyof T ? K extends keyof U ? T[K] extends Record<string, unknown> ? U[K] extends Record<string, unknown> ? $MergeObjects<T[K], U[K]> : U[K] : U[K] : T[K] : K extends keyof U ? U[K] : never };\n/**\n * Merges two discriminated unions A and B based on a discriminator key (defaults to \"type\").\n * For each possible value of the discriminator across both unions:\n * - If B has a member with that discriminator value, use B's member\n * - Otherwise use A's member with that discriminator value\n * This effectively merges the unions while giving B's members precedence over A's members.\n *\n * @template A - First discriminated union type that extends Record<Key, PropertyKey>\n * @template B - Second discriminated union type that extends Record<Key, PropertyKey>\n * @template Key - The discriminator key property, defaults to \"type\"\n */\ntype $MergeDiscriminatedUnion<A extends Record<Key, PropertyKey>, B extends Record<Key, PropertyKey>, Key extends PropertyKey = \"type\"> = { [T in A[Key] | B[Key]]: [Extract<B, Record<Key, T>>] extends [never] // Check if B has a member with this discriminator value\n? Extract<A, Record<Key, T>> : [Extract<A, Record<Key, T>>] extends [never] ? Extract<B, Record<Key, T>> : $MergeObjects<Extract<A, Record<Key, T>>, Extract<B, Record<Key, T>>> }[A[Key] | B[Key]];\ntype Constructor<T> = new (...args: unknown[]) => T;\n/**\n * Immediately-invoked function expression.\n *\n * @param fn - The function to execute\n * @returns The result of the function\n */\ndeclare const iife: <T>(fn: () => T) => T;\ndeclare function coerceMessageLikeToMessage(messageLike: BaseMessageLike): BaseMessage;\n/**\n * This function is used by memory classes to get a string representation\n * of the chat message history, based on the message content and role.\n */\ndeclare function getBufferString(messages: BaseMessage[], humanPrefix?: string, aiPrefix?: string): string;\ndeclare function mapStoredMessageToChatMessage(message: StoredMessage): AIMessage<MessageStructure> | ChatMessage<MessageStructure> | FunctionMessage<MessageStructure> | HumanMessage<MessageStructure> | SystemMessage<MessageStructure> | ToolMessage<MessageStructure>;\n/**\n * Transforms an array of `StoredMessage` instances into an array of\n * `BaseMessage` instances. It uses the `mapV1MessageToStoredMessage`\n * function to ensure all messages are in the `StoredMessage` format, then\n * creates new instances of the appropriate `BaseMessage` subclass based\n * on the type of each message. This function is used to prepare stored\n * messages for use in a chat context.\n */\ndeclare function mapStoredMessagesToChatMessages(messages: StoredMessage[]): BaseMessage[];\n/**\n * Transforms an array of `BaseMessage` instances into an array of\n * `StoredMessage` instances. It does this by calling the `toDict` method\n * on each `BaseMessage`, which returns a `StoredMessage`. This function\n * is used to prepare chat messages for storage.\n */\ndeclare function mapChatMessagesToStoredMessages(messages: BaseMessage[]): StoredMessage[];\ndeclare function convertToChunk(message: BaseMessage): AIMessageChunk<MessageStructure> | ChatMessageChunk<MessageStructure> | FunctionMessageChunk<MessageStructure> | HumanMessageChunk<MessageStructure> | SystemMessageChunk<MessageStructure>;\n//#endregion\nexport { $Expand, $MergeDiscriminatedUnion, $MergeObjects, Constructor, coerceMessageLikeToMessage, convertToChunk, getBufferString, iife, mapChatMessagesToStoredMessages, mapStoredMessageToChatMessage, mapStoredMessagesToChatMessages };\n//# sourceMappingURL=utils.d.ts.map"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompt_values.d.ts","names":["Serializable","BaseMessage","HumanMessage","BasePromptValueInterface","StringPromptValueInterface","ChatPromptValueInterface","BasePromptValue","StringPromptValue","ChatPromptValueFields","ChatPromptValue","ImageContent","ImagePromptValueFields","ImagePromptValue"],"sources":["../../../../../langchain-core/dist/prompt_values.d.ts"],"sourcesContent":["import { Serializable } from \"./load/serializable.js\";\nimport { BaseMessage } from \"./messages/base.js\";\nimport { HumanMessage } from \"./messages/human.js\";\n\n//#region src/prompt_values.d.ts\ninterface BasePromptValueInterface extends Serializable {\n toString(): string;\n toChatMessages(): BaseMessage[];\n}\ninterface StringPromptValueInterface extends BasePromptValueInterface {\n value: string;\n}\ninterface ChatPromptValueInterface extends BasePromptValueInterface {\n messages: BaseMessage[];\n}\n/**\n * Base PromptValue class. All prompt values should extend this class.\n */\ndeclare abstract class BasePromptValue extends Serializable implements BasePromptValueInterface {\n abstract toString(): string;\n abstract toChatMessages(): BaseMessage[];\n}\n/**\n * Represents a prompt value as a string. It extends the BasePromptValue\n * class and overrides the toString and toChatMessages methods.\n */\ndeclare class StringPromptValue extends BasePromptValue implements StringPromptValueInterface {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n value: string;\n constructor(value: string);\n toString(): string;\n toChatMessages(): HumanMessage[];\n}\n/**\n * Interface for the fields of a ChatPromptValue.\n */\ninterface ChatPromptValueFields {\n messages: BaseMessage[];\n}\n/**\n * Class that represents a chat prompt value. It extends the\n * BasePromptValue and includes an array of BaseMessage instances.\n */\ndeclare class ChatPromptValue extends BasePromptValue implements ChatPromptValueInterface {\n lc_namespace: string[];\n lc_serializable: boolean;\n static lc_name(): string;\n messages: BaseMessage[];\n constructor(messages: BaseMessage[]);\n constructor(fields: ChatPromptValueFields);\n toString(): string;\n toChatMessages(): BaseMessage[];\n}\ntype ImageContent = {\n /** Specifies the detail level of the image. */\n detail?: \"auto\" | \"low\" | \"high\";\n /** Either a URL of the image or the base64 encoded image data. */\n url: string;\n};\ninterface ImagePromptValueFields {\n imageUrl: ImageContent;\n}\n/**\n * Class that represents an image prompt value. It extends the\n * BasePromptValue and includes an ImageURL instance.\n */\ndeclare class ImagePromptValue extends BasePromptValue {\n lc_namespace: string[];\n lc_serializable: boolean;\n static lc_name(): string;\n imageUrl: ImageContent;\n /** @ignore */\n value: string;\n constructor(fields: ImagePromptValueFields);\n constructor(fields: ImageContent);\n toString(): string;\n toChatMessages(): HumanMessage[];\n}\n//#endregion\nexport { BasePromptValue, BasePromptValueInterface, ChatPromptValue, ChatPromptValueFields, ChatPromptValueInterface, ImageContent, ImagePromptValue, ImagePromptValueFields, StringPromptValue, StringPromptValueInterface };\n//# sourceMappingURL=prompt_values.d.ts.map"],"mappings":";;;;;AAEmD;UAGzCG,wBAAAA,SAAiCH,YAAT,CAAA;EAAA,QAEdC,EAAAA,EAAAA,MAAAA;EAAW,cAFYD,EAAAA,EAEvBC,WAFuBD,EAAAA;AAAY"}
1
+ {"version":3,"file":"prompt_values.d.ts","names":["Serializable","BaseMessage","HumanMessage","MessageStructure","MessageType","BasePromptValueInterface","StringPromptValueInterface","ChatPromptValueInterface","BasePromptValue","StringPromptValue","ChatPromptValueFields","ChatPromptValue","ImageContent","ImagePromptValueFields","ImagePromptValue"],"sources":["../../../../../langchain-core/dist/prompt_values.d.ts"],"sourcesContent":["import { Serializable } from \"./load/serializable.js\";\nimport { BaseMessage } from \"./messages/base.js\";\nimport { HumanMessage } from \"./messages/human.js\";\nimport { MessageStructure, MessageType } from \"./messages/message.js\";\n\n//#region src/prompt_values.d.ts\ninterface BasePromptValueInterface extends Serializable {\n toString(): string;\n toChatMessages(): BaseMessage[];\n}\ninterface StringPromptValueInterface extends BasePromptValueInterface {\n value: string;\n}\ninterface ChatPromptValueInterface extends BasePromptValueInterface {\n messages: BaseMessage[];\n}\n/**\n * Base PromptValue class. All prompt values should extend this class.\n */\ndeclare abstract class BasePromptValue extends Serializable implements BasePromptValueInterface {\n abstract toString(): string;\n abstract toChatMessages(): BaseMessage[];\n}\n/**\n * Represents a prompt value as a string. It extends the BasePromptValue\n * class and overrides the toString and toChatMessages methods.\n */\ndeclare class StringPromptValue extends BasePromptValue implements StringPromptValueInterface {\n static lc_name(): string;\n lc_namespace: string[];\n lc_serializable: boolean;\n value: string;\n constructor(value: string);\n toString(): string;\n toChatMessages(): HumanMessage<MessageStructure>[];\n}\n/**\n * Interface for the fields of a ChatPromptValue.\n */\ninterface ChatPromptValueFields {\n messages: BaseMessage[];\n}\n/**\n * Class that represents a chat prompt value. It extends the\n * BasePromptValue and includes an array of BaseMessage instances.\n */\ndeclare class ChatPromptValue extends BasePromptValue implements ChatPromptValueInterface {\n lc_namespace: string[];\n lc_serializable: boolean;\n static lc_name(): string;\n messages: BaseMessage[];\n constructor(messages: BaseMessage[]);\n constructor(fields: ChatPromptValueFields);\n toString(): string;\n toChatMessages(): BaseMessage<MessageStructure, MessageType>[];\n}\ntype ImageContent = {\n /** Specifies the detail level of the image. */\n detail?: \"auto\" | \"low\" | \"high\";\n /** Either a URL of the image or the base64 encoded image data. */\n url: string;\n};\ninterface ImagePromptValueFields {\n imageUrl: ImageContent;\n}\n/**\n * Class that represents an image prompt value. It extends the\n * BasePromptValue and includes an ImageURL instance.\n */\ndeclare class ImagePromptValue extends BasePromptValue {\n lc_namespace: string[];\n lc_serializable: boolean;\n static lc_name(): string;\n imageUrl: ImageContent;\n /** @ignore */\n value: string;\n constructor(fields: ImagePromptValueFields);\n constructor(fields: ImageContent);\n toString(): string;\n toChatMessages(): HumanMessage<MessageStructure>[];\n}\n//#endregion\nexport { BasePromptValue, BasePromptValueInterface, ChatPromptValue, ChatPromptValueFields, ChatPromptValueInterface, ImageContent, ImagePromptValue, ImagePromptValueFields, StringPromptValue, StringPromptValueInterface };\n//# sourceMappingURL=prompt_values.d.ts.map"],"mappings":";;;;;;UAMUK,wBAAAA,SAAiCL,YAEvBC,CAAAA;EAAW,QAFYD,EAAAA,EAAAA,MAAAA;EAAY,cAAA,EAAA,EAEnCC,WAFmC,EAAA"}
@@ -1,3 +1,5 @@
1
+ import "./zod.js";
2
+
1
3
  //#region ../langchain-core/dist/utils/types/index.d.ts
2
4
 
3
5
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["InferInteropZodInput","InferInteropZodOutput","InteropZodIssue","InteropZodObject","InteropZodObjectShape","InteropZodType","Mutable","ZodObjectV3","ZodObjectV4","ZodStringV3","ZodStringV4","extendInteropZodObject","getInteropZodDefaultGetter","getInteropZodObjectShape","getSchemaDescription","interopParse","interopParseAsync","interopSafeParse","interopSafeParseAsync","interopZodObjectPartial","interopZodObjectPassthrough","interopZodObjectStrict","interopZodTransformInputSchema","isInteropZodObject","isInteropZodSchema","isShapelessZodSchema","isSimpleStringZodSchema","isZodArrayV4","isZodObjectV3","isZodObjectV4","isZodSchema","isZodSchemaV3","isZodSchemaV4","StringWithAutocomplete","T","Record","InputValues","K","PartialValues","Promise","ChainValues"],"sources":["../../../../../../../langchain-core/dist/utils/types/index.d.ts"],"sourcesContent":["import { InferInteropZodInput, InferInteropZodOutput, InteropZodIssue, InteropZodObject, InteropZodObjectShape, InteropZodType, Mutable, ZodObjectV3, ZodObjectV4, ZodStringV3, ZodStringV4, extendInteropZodObject, getInteropZodDefaultGetter, getInteropZodObjectShape, getSchemaDescription, interopParse, interopParseAsync, interopSafeParse, interopSafeParseAsync, interopZodObjectPartial, interopZodObjectPassthrough, interopZodObjectStrict, interopZodTransformInputSchema, isInteropZodObject, isInteropZodSchema, isShapelessZodSchema, isSimpleStringZodSchema, isZodArrayV4, isZodObjectV3, isZodObjectV4, isZodSchema, isZodSchemaV3, isZodSchemaV4 } from \"./zod.js\";\n\n//#region src/utils/types/index.d.ts\n\n/**\n * Represents a string value with autocompleted, but not required, suggestions.\n */\ntype StringWithAutocomplete<T> = T | (string & Record<never, never>);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype InputValues<K extends string = string> = Record<K, any>;\ntype PartialValues<K extends string = string> = Record<K, string | (() => Promise<string>) | (() => string)>;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ChainValues = Record<string, any>;\n//#endregion\nexport { ChainValues, InferInteropZodInput, InferInteropZodOutput, InputValues, InteropZodIssue, InteropZodObject, InteropZodObjectShape, InteropZodType, Mutable, PartialValues, StringWithAutocomplete, ZodObjectV3, ZodObjectV4, ZodStringV3, ZodStringV4, extendInteropZodObject, getInteropZodDefaultGetter, getInteropZodObjectShape, getSchemaDescription, interopParse, interopParseAsync, interopSafeParse, interopSafeParseAsync, interopZodObjectPartial, interopZodObjectPassthrough, interopZodObjectStrict, interopZodTransformInputSchema, isInteropZodObject, isInteropZodSchema, isShapelessZodSchema, isSimpleStringZodSchema, isZodArrayV4, isZodObjectV3, isZodObjectV4, isZodSchema, isZodSchemaV3, isZodSchemaV4 };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;KAYKwC,WAAAA,GAAcL"}
1
+ {"version":3,"file":"index.d.ts","names":["InferInteropZodInput","InferInteropZodOutput","InteropZodDefault","InteropZodIssue","InteropZodObject","InteropZodObjectShape","InteropZodOptional","InteropZodType","Mutable","ZodDefaultV3","ZodDefaultV4","ZodObjectV3","ZodObjectV4","ZodOptionalV3","ZodOptionalV4","ZodStringV3","ZodStringV4","extendInteropZodObject","getInteropZodDefaultGetter","getInteropZodObjectShape","getSchemaDescription","interopParse","interopParseAsync","interopSafeParse","interopSafeParseAsync","interopZodObjectMakeFieldsOptional","interopZodObjectPartial","interopZodObjectPassthrough","interopZodObjectStrict","interopZodTransformInputSchema","isInteropZodObject","isInteropZodSchema","isShapelessZodSchema","isSimpleStringZodSchema","isZodArrayV4","isZodObjectV3","isZodObjectV4","isZodSchema","isZodSchemaV3","isZodSchemaV4","StringWithAutocomplete","T","Record","InputValues","K","PartialValues","Promise","ChainValues"],"sources":["../../../../../../../langchain-core/dist/utils/types/index.d.ts"],"sourcesContent":["import { InferInteropZodInput, InferInteropZodOutput, InteropZodDefault, InteropZodIssue, InteropZodObject, InteropZodObjectShape, InteropZodOptional, InteropZodType, Mutable, ZodDefaultV3, ZodDefaultV4, ZodObjectV3, ZodObjectV4, ZodOptionalV3, ZodOptionalV4, ZodStringV3, ZodStringV4, extendInteropZodObject, getInteropZodDefaultGetter, getInteropZodObjectShape, getSchemaDescription, interopParse, interopParseAsync, interopSafeParse, interopSafeParseAsync, interopZodObjectMakeFieldsOptional, interopZodObjectPartial, interopZodObjectPassthrough, interopZodObjectStrict, interopZodTransformInputSchema, isInteropZodObject, isInteropZodSchema, isShapelessZodSchema, isSimpleStringZodSchema, isZodArrayV4, isZodObjectV3, isZodObjectV4, isZodSchema, isZodSchemaV3, isZodSchemaV4 } from \"./zod.js\";\n\n//#region src/utils/types/index.d.ts\n\n/**\n * Represents a string value with autocompleted, but not required, suggestions.\n */\ntype StringWithAutocomplete<T> = T | (string & Record<never, never>);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype InputValues<K extends string = string> = Record<K, any>;\ntype PartialValues<K extends string = string> = Record<K, string | (() => Promise<string>) | (() => string)>;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ChainValues = Record<string, any>;\n//#endregion\nexport { ChainValues, InferInteropZodInput, InferInteropZodOutput, InputValues, InteropZodDefault, InteropZodIssue, InteropZodObject, InteropZodObjectShape, InteropZodOptional, InteropZodType, Mutable, PartialValues, StringWithAutocomplete, ZodDefaultV3, ZodDefaultV4, ZodObjectV3, ZodObjectV4, ZodOptionalV3, ZodOptionalV4, ZodStringV3, ZodStringV4, extendInteropZodObject, getInteropZodDefaultGetter, getInteropZodObjectShape, getSchemaDescription, interopParse, interopParseAsync, interopSafeParse, interopSafeParseAsync, interopZodObjectMakeFieldsOptional, interopZodObjectPartial, interopZodObjectPassthrough, interopZodObjectStrict, interopZodTransformInputSchema, isInteropZodObject, isInteropZodSchema, isShapelessZodSchema, isSimpleStringZodSchema, isZodArrayV4, isZodObjectV3, isZodObjectV4, isZodSchema, isZodSchemaV3, isZodSchemaV4 };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;KAYK+C,WAAAA,GAAcL"}
@@ -0,0 +1 @@
1
+ import "zod/v3";
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_document = require('../document.cjs');
3
3
  const require_chat_models_universal = require('../chat_models/universal.cjs');
4
+ const require_agents_middlewareAgent_middleware_index = require('../agents/middlewareAgent/middleware/index.cjs');
4
5
  const require_index = require('../index.cjs');
5
6
  const require_sql_db = require('../sql_db.cjs');
6
7
  const require_text_splitter = require('../text_splitter.cjs');
@@ -9,11 +10,11 @@ const require_memory_chat_memory = require('../memory/chat_memory.cjs');
9
10
  const require_chains_index = require('../chains/index.cjs');
10
11
  const require_chains_load = require('../chains/load.cjs');
11
12
  const require_chains_retrieval = require('../chains/retrieval.cjs');
13
+ const require_document_loaders_base = require('../document_loaders/base.cjs');
12
14
  const require_storage_encoder_backed = require('../storage/encoder_backed.cjs');
13
15
  const require_embeddings_cache_backed = require('../embeddings/cache_backed.cjs');
14
16
  const require_embeddings_fake = require('../embeddings/fake.cjs');
15
17
  const require_evaluation_index = require('../evaluation/index.cjs');
16
- const require_document_loaders_base = require('../document_loaders/base.cjs');
17
18
  const require_load_serializable = require('./serializable.cjs');
18
19
  const require_tools_chain = require('../tools/chain.cjs');
19
20
  const require_tools_index = require('../tools/index.cjs');
@@ -66,7 +67,6 @@ const __langchain_core_runnables = require_rolldown_runtime.__toESM(require("@la
66
67
  const __langchain_core_prompts = require_rolldown_runtime.__toESM(require("@langchain/core/prompts"));
67
68
  const __langchain_core_output_parsers = require_rolldown_runtime.__toESM(require("@langchain/core/output_parsers"));
68
69
  const __langchain_core_outputs = require_rolldown_runtime.__toESM(require("@langchain/core/outputs"));
69
- const __langchain_openai = require_rolldown_runtime.__toESM(require("@langchain/openai"));
70
70
  const __langchain_core_prompt_values = require_rolldown_runtime.__toESM(require("@langchain/core/prompt_values"));
71
71
 
72
72
  //#region src/load/import_map.ts
@@ -83,8 +83,6 @@ require_rolldown_runtime.__export(import_map_exports, {
83
83
  chains__query_constructor__ir: () => require_chains_query_constructor_ir.ir_exports,
84
84
  chains__retrieval: () => require_chains_retrieval.retrieval_exports,
85
85
  chains__sql_db: () => require_chains_sql_db_index.sql_db_exports,
86
- chat_models__azure_openai: () => chat_models__azure_openai,
87
- chat_models__openai: () => chat_models__openai,
88
86
  chat_models__universal: () => require_chat_models_universal.universal_exports,
89
87
  document: () => require_document.document_exports,
90
88
  document_loaders__base: () => require_document_loaders_base.base_exports,
@@ -93,17 +91,14 @@ require_rolldown_runtime.__export(import_map_exports, {
93
91
  document_loaders__fs__json: () => require_document_loaders_fs_json.json_exports,
94
92
  document_loaders__fs__multi_file: () => require_document_loaders_fs_multi_file.multi_file_exports,
95
93
  document_loaders__fs__text: () => require_document_loaders_fs_text.text_exports,
96
- embeddings__azure_openai: () => embeddings__azure_openai,
97
94
  embeddings__cache_backed: () => require_embeddings_cache_backed.cache_backed_exports,
98
95
  embeddings__fake: () => require_embeddings_fake.fake_exports,
99
- embeddings__openai: () => embeddings__openai,
100
96
  evaluation: () => require_evaluation_index.evaluation_exports,
101
97
  index: () => require_index.src_exports,
102
- llms__azure_openai: () => llms__azure_openai,
103
- llms__openai: () => llms__openai,
104
98
  load__serializable: () => require_load_serializable.serializable_exports,
105
99
  memory: () => require_memory_index.memory_exports,
106
100
  memory__chat_memory: () => require_memory_chat_memory.chat_memory_exports,
101
+ middleware: () => require_agents_middlewareAgent_middleware_index.middleware_exports,
107
102
  output_parsers: () => require_output_parsers_index.output_parsers_exports,
108
103
  output_parsers__expression: () => require_output_parsers_expression.expression_exports,
109
104
  prompts__base: () => prompts__base,
@@ -151,12 +146,6 @@ require_rolldown_runtime.__export(import_map_exports, {
151
146
  util__time: () => require_util_time.time_exports,
152
147
  vectorstores__memory: () => require_vectorstores_memory.memory_exports
153
148
  });
154
- const chat_models__openai = { ChatOpenAI: __langchain_openai.ChatOpenAI };
155
- const chat_models__azure_openai = { AzureChatOpenAI: __langchain_openai.AzureChatOpenAI };
156
- const llms__openai = { OpenAI: __langchain_openai.OpenAI };
157
- const llms__azure_openai = { AzureOpenAI: __langchain_openai.AzureOpenAI };
158
- const embeddings__openai = { OpenAIEmbeddings: __langchain_openai.OpenAIEmbeddings };
159
- const embeddings__azure_openai = { AzureOpenAIEmbeddings: __langchain_openai.AzureOpenAIEmbeddings };
160
149
  const prompts__prompt = { PromptTemplate: __langchain_core_prompts.PromptTemplate };
161
150
  const schema__messages = {
162
151
  AIMessage: __langchain_core_messages.AIMessage,
@@ -1 +1 @@
1
- {"version":3,"file":"import_map.cjs","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["// Auto-generated by import-map plugin. Do not edit manually.\n\nexport * as index from \"../index.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as tools__chain from \"../tools/chain.js\";\nexport * as tools__render from \"../tools/render.js\";\nexport * as tools__retriever from \"../tools/retriever.js\";\nexport * as tools__sql from \"../tools/sql.js\";\nexport * as tools__webbrowser from \"../tools/webbrowser.js\";\nexport * as chains from \"../chains/index.js\";\nexport * as chains__combine_documents from \"../chains/combine_documents/index.js\";\nexport * as chains__combine_documents__reduce from \"../chains/combine_documents/reduce.js\";\nexport * as chains__history_aware_retriever from \"../chains/history_aware_retriever.js\";\nexport * as chains__load from \"../chains/load.js\";\nexport * as chains__openai_functions from \"../chains/openai_functions/index.js\";\nexport * as chains__query_constructor from \"../chains/query_constructor/index.js\";\nexport * as chains__query_constructor__ir from \"../chains/query_constructor/ir.js\";\nexport * as chains__retrieval from \"../chains/retrieval.js\";\nexport * as chains__sql_db from \"../chains/sql_db/index.js\";\nexport * as chains__graph_qa__cypher from \"../chains/graph_qa/cypher.js\";\nexport * as chat_models__universal from \"../chat_models/universal.js\";\nexport * as embeddings__cache_backed from \"../embeddings/cache_backed.js\";\nexport * as embeddings__fake from \"../embeddings/fake.js\";\nexport * as vectorstores__memory from \"../vectorstores/memory.js\";\nexport * as text_splitter from \"../text_splitter.js\";\nexport * as memory from \"../memory/index.js\";\nexport * as memory__chat_memory from \"../memory/chat_memory.js\";\nexport * as document from \"../document.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as document_loaders__fs__buffer from \"../document_loaders/fs/buffer.js\";\nexport * as document_loaders__fs__directory from \"../document_loaders/fs/directory.js\";\nexport * as document_loaders__fs__json from \"../document_loaders/fs/json.js\";\nexport * as document_loaders__fs__multi_file from \"../document_loaders/fs/multi_file.js\";\nexport * as document_loaders__fs__text from \"../document_loaders/fs/text.js\";\nexport * as sql_db from \"../sql_db.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as output_parsers__expression from \"../output_parsers/expression.js\";\nexport * as retrievers__contextual_compression from \"../retrievers/contextual_compression.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as retrievers__ensemble from \"../retrievers/ensemble.js\";\nexport * as retrievers__multi_query from \"../retrievers/multi_query.js\";\nexport * as retrievers__multi_vector from \"../retrievers/multi_vector.js\";\nexport * as retrievers__parent_document from \"../retrievers/parent_document.js\";\nexport * as retrievers__time_weighted from \"../retrievers/time_weighted.js\";\nexport * as retrievers__document_compressors__chain_extract from \"../retrievers/document_compressors/chain_extract.js\";\nexport * as retrievers__document_compressors__embeddings_filter from \"../retrievers/document_compressors/embeddings_filter.js\";\nexport * as retrievers__hyde from \"../retrievers/hyde.js\";\nexport * as retrievers__score_threshold from \"../retrievers/score_threshold.js\";\nexport * as retrievers__self_query from \"../retrievers/self_query/index.js\";\nexport * as retrievers__self_query__functional from \"../retrievers/self_query/functional.js\";\nexport * as retrievers__matryoshka_retriever from \"../retrievers/matryoshka_retriever.js\";\nexport * as stores__doc__base from \"../stores/doc/base.js\";\nexport * as stores__doc__in_memory from \"../stores/doc/in_memory.js\";\nexport * as stores__file__in_memory from \"../stores/file/in_memory.js\";\nexport * as stores__file__node from \"../stores/file/node.js\";\nexport * as stores__message__in_memory from \"../stores/message/in_memory.js\";\nexport * as storage__encoder_backed from \"../storage/encoder_backed.js\";\nexport * as storage__in_memory from \"../storage/in_memory.js\";\nexport * as storage__file_system from \"../storage/file_system.js\";\nexport * as util__document from \"../util/document.js\";\nexport * as util__math from \"../util/math.js\";\nexport * as util__time from \"../util/time.js\";\nexport * as evaluation from \"../evaluation/index.js\";\nimport {\n ChatOpenAI,\n AzureChatOpenAI,\n OpenAI,\n AzureOpenAI,\n OpenAIEmbeddings,\n AzureOpenAIEmbeddings,\n} from \"@langchain/openai\";\nimport {\n PromptTemplate,\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n ImagePromptTemplate,\n PipelinePromptTemplate,\n} from \"@langchain/core/prompts\";\nimport {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n} from \"@langchain/core/messages\";\nimport { StringPromptValue } from \"@langchain/core/prompt_values\";\nimport {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n} from \"@langchain/core/runnables\";\nimport { StringOutputParser } from \"@langchain/core/output_parsers\";\nimport { ChatGenerationChunk, GenerationChunk } from \"@langchain/core/outputs\";\nconst chat_models__openai = {\n ChatOpenAI,\n};\nexport { chat_models__openai };\nconst chat_models__azure_openai = {\n AzureChatOpenAI,\n};\nexport { chat_models__azure_openai };\nconst llms__openai = {\n OpenAI,\n};\nexport { llms__openai };\nconst llms__azure_openai = {\n AzureOpenAI,\n};\nexport { llms__azure_openai };\nconst embeddings__openai = {\n OpenAIEmbeddings,\n};\nexport { embeddings__openai };\nconst embeddings__azure_openai = {\n AzureOpenAIEmbeddings,\n};\nexport { embeddings__azure_openai };\nconst prompts__prompt = {\n PromptTemplate,\n};\nexport { prompts__prompt };\nconst schema__messages = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema__messages };\nconst schema = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema };\nconst prompts__chat = {\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n};\nexport { prompts__chat };\nconst prompts__image = {\n ImagePromptTemplate,\n};\nexport { prompts__image };\nconst prompts__pipeline = {\n PipelinePromptTemplate,\n};\nexport { prompts__pipeline };\nconst prompts__base = {\n StringPromptValue,\n};\nexport { prompts__base };\nconst schema__runnable = {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n};\nexport { schema__runnable };\nconst schema__output_parser = {\n StringOutputParser,\n};\nexport { schema__output_parser };\nconst schema__output = {\n ChatGenerationChunk,\n GenerationChunk,\n};\nexport { schema__output };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHA,MAAM,sBAAsB,EAC1B,0CACD;AAED,MAAM,4BAA4B,EAChC,oDACD;AAED,MAAM,eAAe,EACnB,kCACD;AAED,MAAM,qBAAqB,EACzB,4CACD;AAED,MAAM,qBAAqB,EACzB,sDACD;AAED,MAAM,2BAA2B,EAC/B,gEACD;AAED,MAAM,kBAAkB,EACtB,wDACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,iBAAiB,EACrB,kEACD;AAED,MAAM,oBAAoB,EACxB,wEACD;AAED,MAAM,gBAAgB,EACpB,oEACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,wBAAwB,EAC5B,uEACD;AAED,MAAM,iBAAiB;CACrB;CACA;AACD"}
1
+ {"version":3,"file":"import_map.cjs","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["// Auto-generated by import-map plugin. Do not edit manually.\n\nexport * as index from \"../index.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as tools__chain from \"../tools/chain.js\";\nexport * as tools__render from \"../tools/render.js\";\nexport * as tools__retriever from \"../tools/retriever.js\";\nexport * as tools__sql from \"../tools/sql.js\";\nexport * as tools__webbrowser from \"../tools/webbrowser.js\";\nexport * as chains from \"../chains/index.js\";\nexport * as chains__combine_documents from \"../chains/combine_documents/index.js\";\nexport * as chains__combine_documents__reduce from \"../chains/combine_documents/reduce.js\";\nexport * as chains__history_aware_retriever from \"../chains/history_aware_retriever.js\";\nexport * as chains__load from \"../chains/load.js\";\nexport * as chains__openai_functions from \"../chains/openai_functions/index.js\";\nexport * as chains__query_constructor from \"../chains/query_constructor/index.js\";\nexport * as chains__query_constructor__ir from \"../chains/query_constructor/ir.js\";\nexport * as chains__retrieval from \"../chains/retrieval.js\";\nexport * as chains__sql_db from \"../chains/sql_db/index.js\";\nexport * as chains__graph_qa__cypher from \"../chains/graph_qa/cypher.js\";\nexport * as chat_models__universal from \"../chat_models/universal.js\";\nexport * as embeddings__cache_backed from \"../embeddings/cache_backed.js\";\nexport * as embeddings__fake from \"../embeddings/fake.js\";\nexport * as vectorstores__memory from \"../vectorstores/memory.js\";\nexport * as text_splitter from \"../text_splitter.js\";\nexport * as memory from \"../memory/index.js\";\nexport * as memory__chat_memory from \"../memory/chat_memory.js\";\nexport * as middleware from \"../agents/middlewareAgent/middleware/index.js\";\nexport * as document from \"../document.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as document_loaders__fs__buffer from \"../document_loaders/fs/buffer.js\";\nexport * as document_loaders__fs__directory from \"../document_loaders/fs/directory.js\";\nexport * as document_loaders__fs__json from \"../document_loaders/fs/json.js\";\nexport * as document_loaders__fs__multi_file from \"../document_loaders/fs/multi_file.js\";\nexport * as document_loaders__fs__text from \"../document_loaders/fs/text.js\";\nexport * as sql_db from \"../sql_db.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as output_parsers__expression from \"../output_parsers/expression.js\";\nexport * as retrievers__contextual_compression from \"../retrievers/contextual_compression.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as retrievers__ensemble from \"../retrievers/ensemble.js\";\nexport * as retrievers__multi_query from \"../retrievers/multi_query.js\";\nexport * as retrievers__multi_vector from \"../retrievers/multi_vector.js\";\nexport * as retrievers__parent_document from \"../retrievers/parent_document.js\";\nexport * as retrievers__time_weighted from \"../retrievers/time_weighted.js\";\nexport * as retrievers__document_compressors__chain_extract from \"../retrievers/document_compressors/chain_extract.js\";\nexport * as retrievers__document_compressors__embeddings_filter from \"../retrievers/document_compressors/embeddings_filter.js\";\nexport * as retrievers__hyde from \"../retrievers/hyde.js\";\nexport * as retrievers__score_threshold from \"../retrievers/score_threshold.js\";\nexport * as retrievers__self_query from \"../retrievers/self_query/index.js\";\nexport * as retrievers__self_query__functional from \"../retrievers/self_query/functional.js\";\nexport * as retrievers__matryoshka_retriever from \"../retrievers/matryoshka_retriever.js\";\nexport * as stores__doc__base from \"../stores/doc/base.js\";\nexport * as stores__doc__in_memory from \"../stores/doc/in_memory.js\";\nexport * as stores__file__in_memory from \"../stores/file/in_memory.js\";\nexport * as stores__file__node from \"../stores/file/node.js\";\nexport * as stores__message__in_memory from \"../stores/message/in_memory.js\";\nexport * as storage__encoder_backed from \"../storage/encoder_backed.js\";\nexport * as storage__in_memory from \"../storage/in_memory.js\";\nexport * as storage__file_system from \"../storage/file_system.js\";\nexport * as util__document from \"../util/document.js\";\nexport * as util__math from \"../util/math.js\";\nexport * as util__time from \"../util/time.js\";\nexport * as evaluation from \"../evaluation/index.js\";\nimport {\n PromptTemplate,\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n ImagePromptTemplate,\n PipelinePromptTemplate,\n} from \"@langchain/core/prompts\";\nimport {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n} from \"@langchain/core/messages\";\nimport { StringPromptValue } from \"@langchain/core/prompt_values\";\nimport {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n} from \"@langchain/core/runnables\";\nimport { StringOutputParser } from \"@langchain/core/output_parsers\";\nimport { ChatGenerationChunk, GenerationChunk } from \"@langchain/core/outputs\";\nconst prompts__prompt = {\n PromptTemplate,\n};\nexport { prompts__prompt };\nconst schema__messages = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema__messages };\nconst schema = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema };\nconst prompts__chat = {\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n};\nexport { prompts__chat };\nconst prompts__image = {\n ImagePromptTemplate,\n};\nexport { prompts__image };\nconst prompts__pipeline = {\n PipelinePromptTemplate,\n};\nexport { prompts__pipeline };\nconst prompts__base = {\n StringPromptValue,\n};\nexport { prompts__base };\nconst schema__runnable = {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n};\nexport { schema__runnable };\nconst schema__output_parser = {\n StringOutputParser,\n};\nexport { schema__output_parser };\nconst schema__output = {\n ChatGenerationChunk,\n GenerationChunk,\n};\nexport { schema__output };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA,MAAM,kBAAkB,EACtB,wDACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,iBAAiB,EACrB,kEACD;AAED,MAAM,oBAAoB,EACxB,wEACD;AAED,MAAM,gBAAgB,EACpB,oEACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,wBAAwB,EAC5B,uEACD;AAED,MAAM,iBAAiB;CACrB;CACA;AACD"}
@@ -1,6 +1,7 @@
1
1
  import { __export } from "../_virtual/rolldown_runtime.js";
2
2
  import { document_exports } from "../document.js";
3
3
  import { universal_exports } from "../chat_models/universal.js";
4
+ import { middleware_exports } from "../agents/middlewareAgent/middleware/index.js";
4
5
  import { src_exports } from "../index.js";
5
6
  import { sql_db_exports } from "../sql_db.js";
6
7
  import { text_splitter_exports } from "../text_splitter.js";
@@ -9,11 +10,11 @@ import { chat_memory_exports } from "../memory/chat_memory.js";
9
10
  import { chains_exports } from "../chains/index.js";
10
11
  import { load_exports } from "../chains/load.js";
11
12
  import { retrieval_exports } from "../chains/retrieval.js";
13
+ import { base_exports } from "../document_loaders/base.js";
12
14
  import { encoder_backed_exports } from "../storage/encoder_backed.js";
13
15
  import { cache_backed_exports } from "../embeddings/cache_backed.js";
14
16
  import { fake_exports } from "../embeddings/fake.js";
15
17
  import { evaluation_exports } from "../evaluation/index.js";
16
- import { base_exports } from "../document_loaders/base.js";
17
18
  import { serializable_exports } from "./serializable.js";
18
19
  import { chain_exports } from "../tools/chain.js";
19
20
  import { tools_exports } from "../tools/index.js";
@@ -66,7 +67,6 @@ import { RouterRunnable, RunnableAssign, RunnableBinding, RunnableBranch, Runnab
66
67
  import { AIMessagePromptTemplate, ChatMessagePromptTemplate, ChatPromptTemplate, HumanMessagePromptTemplate, ImagePromptTemplate, MessagesPlaceholder, PipelinePromptTemplate, PromptTemplate, SystemMessagePromptTemplate } from "@langchain/core/prompts";
67
68
  import { StringOutputParser } from "@langchain/core/output_parsers";
68
69
  import { ChatGenerationChunk, GenerationChunk } from "@langchain/core/outputs";
69
- import { AzureChatOpenAI, AzureOpenAI, AzureOpenAIEmbeddings, ChatOpenAI, OpenAI, OpenAIEmbeddings } from "@langchain/openai";
70
70
  import { StringPromptValue } from "@langchain/core/prompt_values";
71
71
 
72
72
  //#region src/load/import_map.ts
@@ -83,8 +83,6 @@ __export(import_map_exports, {
83
83
  chains__query_constructor__ir: () => ir_exports,
84
84
  chains__retrieval: () => retrieval_exports,
85
85
  chains__sql_db: () => sql_db_exports$1,
86
- chat_models__azure_openai: () => chat_models__azure_openai,
87
- chat_models__openai: () => chat_models__openai,
88
86
  chat_models__universal: () => universal_exports,
89
87
  document: () => document_exports,
90
88
  document_loaders__base: () => base_exports,
@@ -93,17 +91,14 @@ __export(import_map_exports, {
93
91
  document_loaders__fs__json: () => json_exports,
94
92
  document_loaders__fs__multi_file: () => multi_file_exports,
95
93
  document_loaders__fs__text: () => text_exports,
96
- embeddings__azure_openai: () => embeddings__azure_openai,
97
94
  embeddings__cache_backed: () => cache_backed_exports,
98
95
  embeddings__fake: () => fake_exports,
99
- embeddings__openai: () => embeddings__openai,
100
96
  evaluation: () => evaluation_exports,
101
97
  index: () => src_exports,
102
- llms__azure_openai: () => llms__azure_openai,
103
- llms__openai: () => llms__openai,
104
98
  load__serializable: () => serializable_exports,
105
99
  memory: () => memory_exports$1,
106
100
  memory__chat_memory: () => chat_memory_exports,
101
+ middleware: () => middleware_exports,
107
102
  output_parsers: () => output_parsers_exports,
108
103
  output_parsers__expression: () => expression_exports,
109
104
  prompts__base: () => prompts__base,
@@ -151,12 +146,6 @@ __export(import_map_exports, {
151
146
  util__time: () => time_exports,
152
147
  vectorstores__memory: () => memory_exports
153
148
  });
154
- const chat_models__openai = { ChatOpenAI };
155
- const chat_models__azure_openai = { AzureChatOpenAI };
156
- const llms__openai = { OpenAI };
157
- const llms__azure_openai = { AzureOpenAI };
158
- const embeddings__openai = { OpenAIEmbeddings };
159
- const embeddings__azure_openai = { AzureOpenAIEmbeddings };
160
149
  const prompts__prompt = { PromptTemplate };
161
150
  const schema__messages = {
162
151
  AIMessage,
@@ -1 +1 @@
1
- {"version":3,"file":"import_map.js","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["// Auto-generated by import-map plugin. Do not edit manually.\n\nexport * as index from \"../index.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as tools__chain from \"../tools/chain.js\";\nexport * as tools__render from \"../tools/render.js\";\nexport * as tools__retriever from \"../tools/retriever.js\";\nexport * as tools__sql from \"../tools/sql.js\";\nexport * as tools__webbrowser from \"../tools/webbrowser.js\";\nexport * as chains from \"../chains/index.js\";\nexport * as chains__combine_documents from \"../chains/combine_documents/index.js\";\nexport * as chains__combine_documents__reduce from \"../chains/combine_documents/reduce.js\";\nexport * as chains__history_aware_retriever from \"../chains/history_aware_retriever.js\";\nexport * as chains__load from \"../chains/load.js\";\nexport * as chains__openai_functions from \"../chains/openai_functions/index.js\";\nexport * as chains__query_constructor from \"../chains/query_constructor/index.js\";\nexport * as chains__query_constructor__ir from \"../chains/query_constructor/ir.js\";\nexport * as chains__retrieval from \"../chains/retrieval.js\";\nexport * as chains__sql_db from \"../chains/sql_db/index.js\";\nexport * as chains__graph_qa__cypher from \"../chains/graph_qa/cypher.js\";\nexport * as chat_models__universal from \"../chat_models/universal.js\";\nexport * as embeddings__cache_backed from \"../embeddings/cache_backed.js\";\nexport * as embeddings__fake from \"../embeddings/fake.js\";\nexport * as vectorstores__memory from \"../vectorstores/memory.js\";\nexport * as text_splitter from \"../text_splitter.js\";\nexport * as memory from \"../memory/index.js\";\nexport * as memory__chat_memory from \"../memory/chat_memory.js\";\nexport * as document from \"../document.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as document_loaders__fs__buffer from \"../document_loaders/fs/buffer.js\";\nexport * as document_loaders__fs__directory from \"../document_loaders/fs/directory.js\";\nexport * as document_loaders__fs__json from \"../document_loaders/fs/json.js\";\nexport * as document_loaders__fs__multi_file from \"../document_loaders/fs/multi_file.js\";\nexport * as document_loaders__fs__text from \"../document_loaders/fs/text.js\";\nexport * as sql_db from \"../sql_db.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as output_parsers__expression from \"../output_parsers/expression.js\";\nexport * as retrievers__contextual_compression from \"../retrievers/contextual_compression.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as retrievers__ensemble from \"../retrievers/ensemble.js\";\nexport * as retrievers__multi_query from \"../retrievers/multi_query.js\";\nexport * as retrievers__multi_vector from \"../retrievers/multi_vector.js\";\nexport * as retrievers__parent_document from \"../retrievers/parent_document.js\";\nexport * as retrievers__time_weighted from \"../retrievers/time_weighted.js\";\nexport * as retrievers__document_compressors__chain_extract from \"../retrievers/document_compressors/chain_extract.js\";\nexport * as retrievers__document_compressors__embeddings_filter from \"../retrievers/document_compressors/embeddings_filter.js\";\nexport * as retrievers__hyde from \"../retrievers/hyde.js\";\nexport * as retrievers__score_threshold from \"../retrievers/score_threshold.js\";\nexport * as retrievers__self_query from \"../retrievers/self_query/index.js\";\nexport * as retrievers__self_query__functional from \"../retrievers/self_query/functional.js\";\nexport * as retrievers__matryoshka_retriever from \"../retrievers/matryoshka_retriever.js\";\nexport * as stores__doc__base from \"../stores/doc/base.js\";\nexport * as stores__doc__in_memory from \"../stores/doc/in_memory.js\";\nexport * as stores__file__in_memory from \"../stores/file/in_memory.js\";\nexport * as stores__file__node from \"../stores/file/node.js\";\nexport * as stores__message__in_memory from \"../stores/message/in_memory.js\";\nexport * as storage__encoder_backed from \"../storage/encoder_backed.js\";\nexport * as storage__in_memory from \"../storage/in_memory.js\";\nexport * as storage__file_system from \"../storage/file_system.js\";\nexport * as util__document from \"../util/document.js\";\nexport * as util__math from \"../util/math.js\";\nexport * as util__time from \"../util/time.js\";\nexport * as evaluation from \"../evaluation/index.js\";\nimport {\n ChatOpenAI,\n AzureChatOpenAI,\n OpenAI,\n AzureOpenAI,\n OpenAIEmbeddings,\n AzureOpenAIEmbeddings,\n} from \"@langchain/openai\";\nimport {\n PromptTemplate,\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n ImagePromptTemplate,\n PipelinePromptTemplate,\n} from \"@langchain/core/prompts\";\nimport {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n} from \"@langchain/core/messages\";\nimport { StringPromptValue } from \"@langchain/core/prompt_values\";\nimport {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n} from \"@langchain/core/runnables\";\nimport { StringOutputParser } from \"@langchain/core/output_parsers\";\nimport { ChatGenerationChunk, GenerationChunk } from \"@langchain/core/outputs\";\nconst chat_models__openai = {\n ChatOpenAI,\n};\nexport { chat_models__openai };\nconst chat_models__azure_openai = {\n AzureChatOpenAI,\n};\nexport { chat_models__azure_openai };\nconst llms__openai = {\n OpenAI,\n};\nexport { llms__openai };\nconst llms__azure_openai = {\n AzureOpenAI,\n};\nexport { llms__azure_openai };\nconst embeddings__openai = {\n OpenAIEmbeddings,\n};\nexport { embeddings__openai };\nconst embeddings__azure_openai = {\n AzureOpenAIEmbeddings,\n};\nexport { embeddings__azure_openai };\nconst prompts__prompt = {\n PromptTemplate,\n};\nexport { prompts__prompt };\nconst schema__messages = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema__messages };\nconst schema = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema };\nconst prompts__chat = {\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n};\nexport { prompts__chat };\nconst prompts__image = {\n ImagePromptTemplate,\n};\nexport { prompts__image };\nconst prompts__pipeline = {\n PipelinePromptTemplate,\n};\nexport { prompts__pipeline };\nconst prompts__base = {\n StringPromptValue,\n};\nexport { prompts__base };\nconst schema__runnable = {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n};\nexport { schema__runnable };\nconst schema__output_parser = {\n StringOutputParser,\n};\nexport { schema__output_parser };\nconst schema__output = {\n ChatGenerationChunk,\n GenerationChunk,\n};\nexport { schema__output };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHA,MAAM,sBAAsB,EAC1B,WACD;AAED,MAAM,4BAA4B,EAChC,gBACD;AAED,MAAM,eAAe,EACnB,OACD;AAED,MAAM,qBAAqB,EACzB,YACD;AAED,MAAM,qBAAqB,EACzB,iBACD;AAED,MAAM,2BAA2B,EAC/B,sBACD;AAED,MAAM,kBAAkB,EACtB,eACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,iBAAiB,EACrB,oBACD;AAED,MAAM,oBAAoB,EACxB,uBACD;AAED,MAAM,gBAAgB,EACpB,kBACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,wBAAwB,EAC5B,mBACD;AAED,MAAM,iBAAiB;CACrB;CACA;AACD"}
1
+ {"version":3,"file":"import_map.js","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["// Auto-generated by import-map plugin. Do not edit manually.\n\nexport * as index from \"../index.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as tools__chain from \"../tools/chain.js\";\nexport * as tools__render from \"../tools/render.js\";\nexport * as tools__retriever from \"../tools/retriever.js\";\nexport * as tools__sql from \"../tools/sql.js\";\nexport * as tools__webbrowser from \"../tools/webbrowser.js\";\nexport * as chains from \"../chains/index.js\";\nexport * as chains__combine_documents from \"../chains/combine_documents/index.js\";\nexport * as chains__combine_documents__reduce from \"../chains/combine_documents/reduce.js\";\nexport * as chains__history_aware_retriever from \"../chains/history_aware_retriever.js\";\nexport * as chains__load from \"../chains/load.js\";\nexport * as chains__openai_functions from \"../chains/openai_functions/index.js\";\nexport * as chains__query_constructor from \"../chains/query_constructor/index.js\";\nexport * as chains__query_constructor__ir from \"../chains/query_constructor/ir.js\";\nexport * as chains__retrieval from \"../chains/retrieval.js\";\nexport * as chains__sql_db from \"../chains/sql_db/index.js\";\nexport * as chains__graph_qa__cypher from \"../chains/graph_qa/cypher.js\";\nexport * as chat_models__universal from \"../chat_models/universal.js\";\nexport * as embeddings__cache_backed from \"../embeddings/cache_backed.js\";\nexport * as embeddings__fake from \"../embeddings/fake.js\";\nexport * as vectorstores__memory from \"../vectorstores/memory.js\";\nexport * as text_splitter from \"../text_splitter.js\";\nexport * as memory from \"../memory/index.js\";\nexport * as memory__chat_memory from \"../memory/chat_memory.js\";\nexport * as middleware from \"../agents/middlewareAgent/middleware/index.js\";\nexport * as document from \"../document.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as document_loaders__fs__buffer from \"../document_loaders/fs/buffer.js\";\nexport * as document_loaders__fs__directory from \"../document_loaders/fs/directory.js\";\nexport * as document_loaders__fs__json from \"../document_loaders/fs/json.js\";\nexport * as document_loaders__fs__multi_file from \"../document_loaders/fs/multi_file.js\";\nexport * as document_loaders__fs__text from \"../document_loaders/fs/text.js\";\nexport * as sql_db from \"../sql_db.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as output_parsers__expression from \"../output_parsers/expression.js\";\nexport * as retrievers__contextual_compression from \"../retrievers/contextual_compression.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as retrievers__ensemble from \"../retrievers/ensemble.js\";\nexport * as retrievers__multi_query from \"../retrievers/multi_query.js\";\nexport * as retrievers__multi_vector from \"../retrievers/multi_vector.js\";\nexport * as retrievers__parent_document from \"../retrievers/parent_document.js\";\nexport * as retrievers__time_weighted from \"../retrievers/time_weighted.js\";\nexport * as retrievers__document_compressors__chain_extract from \"../retrievers/document_compressors/chain_extract.js\";\nexport * as retrievers__document_compressors__embeddings_filter from \"../retrievers/document_compressors/embeddings_filter.js\";\nexport * as retrievers__hyde from \"../retrievers/hyde.js\";\nexport * as retrievers__score_threshold from \"../retrievers/score_threshold.js\";\nexport * as retrievers__self_query from \"../retrievers/self_query/index.js\";\nexport * as retrievers__self_query__functional from \"../retrievers/self_query/functional.js\";\nexport * as retrievers__matryoshka_retriever from \"../retrievers/matryoshka_retriever.js\";\nexport * as stores__doc__base from \"../stores/doc/base.js\";\nexport * as stores__doc__in_memory from \"../stores/doc/in_memory.js\";\nexport * as stores__file__in_memory from \"../stores/file/in_memory.js\";\nexport * as stores__file__node from \"../stores/file/node.js\";\nexport * as stores__message__in_memory from \"../stores/message/in_memory.js\";\nexport * as storage__encoder_backed from \"../storage/encoder_backed.js\";\nexport * as storage__in_memory from \"../storage/in_memory.js\";\nexport * as storage__file_system from \"../storage/file_system.js\";\nexport * as util__document from \"../util/document.js\";\nexport * as util__math from \"../util/math.js\";\nexport * as util__time from \"../util/time.js\";\nexport * as evaluation from \"../evaluation/index.js\";\nimport {\n PromptTemplate,\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n ImagePromptTemplate,\n PipelinePromptTemplate,\n} from \"@langchain/core/prompts\";\nimport {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n} from \"@langchain/core/messages\";\nimport { StringPromptValue } from \"@langchain/core/prompt_values\";\nimport {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n} from \"@langchain/core/runnables\";\nimport { StringOutputParser } from \"@langchain/core/output_parsers\";\nimport { ChatGenerationChunk, GenerationChunk } from \"@langchain/core/outputs\";\nconst prompts__prompt = {\n PromptTemplate,\n};\nexport { prompts__prompt };\nconst schema__messages = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema__messages };\nconst schema = {\n AIMessage,\n AIMessageChunk,\n BaseMessage,\n BaseMessageChunk,\n ChatMessage,\n ChatMessageChunk,\n FunctionMessage,\n FunctionMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n};\nexport { schema };\nconst prompts__chat = {\n AIMessagePromptTemplate,\n ChatMessagePromptTemplate,\n ChatPromptTemplate,\n HumanMessagePromptTemplate,\n MessagesPlaceholder,\n SystemMessagePromptTemplate,\n};\nexport { prompts__chat };\nconst prompts__image = {\n ImagePromptTemplate,\n};\nexport { prompts__image };\nconst prompts__pipeline = {\n PipelinePromptTemplate,\n};\nexport { prompts__pipeline };\nconst prompts__base = {\n StringPromptValue,\n};\nexport { prompts__base };\nconst schema__runnable = {\n RouterRunnable,\n RunnableAssign,\n RunnableBinding,\n RunnableBranch,\n RunnableEach,\n RunnableMap,\n RunnableParallel,\n RunnablePassthrough,\n RunnablePick,\n RunnableRetry,\n RunnableSequence,\n RunnableWithFallbacks,\n RunnableWithMessageHistory,\n};\nexport { schema__runnable };\nconst schema__output_parser = {\n StringOutputParser,\n};\nexport { schema__output_parser };\nconst schema__output = {\n ChatGenerationChunk,\n GenerationChunk,\n};\nexport { schema__output };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA,MAAM,kBAAkB,EACtB,eACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,SAAS;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,iBAAiB,EACrB,oBACD;AAED,MAAM,oBAAoB,EACxB,uBACD;AAED,MAAM,gBAAgB,EACpB,kBACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,wBAAwB,EAC5B,mBACD;AAED,MAAM,iBAAiB;CACrB;CACA;AACD"}
@@ -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\n// eslint-disable-next-line spaced-comment\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 // eslint-disable-next-line spaced-comment\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\n// eslint-disable-next-line spaced-comment\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\n// eslint-disable-next-line spaced-comment\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;AAGb,MAAa,iCAA+B,IAAIA,wCAAe;CAC7D,gBAAgB,CAAC,WAAW,WAAY;CACxC,UAAU;AACX;AAED,MAAa,+CAA+C,CAAC;;;;;;;;;;;;;;;IAezD,CAAC;AAEL,MAAa,sDAEG,IAAIA,wCAAe;CAC/B,gBAAgB;EAAC;EAAY;EAAW;CAAQ;CAChD,UAAU;AACX;AAEH,MAAa,sCAAsC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiC7C,CAAC;AAGR,MAAa,2CAAyC,IAAIA,wCAAe;CACvE,gBAAgB,CAAC,WAAW,OAAQ;CACpC,UAAU;AACX;AAED,MAAa,yCAAyC,CAAC;;;;;;;;;;;;;;;;sGAgB+C,CAAC;AAGvG,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,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"}