@langchain/classic 1.0.9 → 1.0.10-dev-1768440391024

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 (397) hide show
  1. package/dist/agents/chat/outputParser.d.cts +2 -2
  2. package/dist/agents/chat/outputParser.d.cts.map +1 -1
  3. package/dist/agents/openai_tools/index.d.cts +2 -2
  4. package/dist/agents/openai_tools/index.d.cts.map +1 -1
  5. package/dist/agents/openai_tools/index.d.ts +2 -2
  6. package/dist/agents/openai_tools/index.d.ts.map +1 -1
  7. package/dist/agents/react/index.d.cts +2 -2
  8. package/dist/agents/react/index.d.cts.map +1 -1
  9. package/dist/agents/structured_chat/index.d.cts +2 -2
  10. package/dist/agents/structured_chat/index.d.cts.map +1 -1
  11. package/dist/agents/structured_chat/index.d.ts +2 -2
  12. package/dist/agents/structured_chat/index.d.ts.map +1 -1
  13. package/dist/agents/tool_calling/index.d.cts +2 -2
  14. package/dist/agents/tool_calling/index.d.cts.map +1 -1
  15. package/dist/agents/tool_calling/index.d.ts +2 -2
  16. package/dist/agents/tool_calling/index.d.ts.map +1 -1
  17. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts +2 -2
  18. package/dist/agents/toolkits/conversational_retrieval/token_buffer_memory.d.cts.map +1 -1
  19. package/dist/experimental/autogpt/prompt.d.cts +2 -2
  20. package/dist/experimental/autogpt/prompt.d.cts.map +1 -1
  21. package/dist/experimental/prompts/custom_format.d.cts.map +1 -1
  22. package/dist/experimental/prompts/custom_format.d.ts.map +1 -1
  23. package/dist/experimental/prompts/handlebars.d.cts.map +1 -1
  24. package/dist/retrievers/hyde.d.cts.map +1 -1
  25. package/package.json +17 -17
  26. package/agents/format_scratchpad/log.cjs +0 -1
  27. package/agents/format_scratchpad/log.d.cts +0 -1
  28. package/agents/format_scratchpad/log.d.ts +0 -1
  29. package/agents/format_scratchpad/log.js +0 -1
  30. package/agents/format_scratchpad/log_to_message.cjs +0 -1
  31. package/agents/format_scratchpad/log_to_message.d.cts +0 -1
  32. package/agents/format_scratchpad/log_to_message.d.ts +0 -1
  33. package/agents/format_scratchpad/log_to_message.js +0 -1
  34. package/agents/format_scratchpad/openai_functions.cjs +0 -1
  35. package/agents/format_scratchpad/openai_functions.d.cts +0 -1
  36. package/agents/format_scratchpad/openai_functions.d.ts +0 -1
  37. package/agents/format_scratchpad/openai_functions.js +0 -1
  38. package/agents/format_scratchpad/openai_tools.cjs +0 -1
  39. package/agents/format_scratchpad/openai_tools.d.cts +0 -1
  40. package/agents/format_scratchpad/openai_tools.d.ts +0 -1
  41. package/agents/format_scratchpad/openai_tools.js +0 -1
  42. package/agents/format_scratchpad/xml.cjs +0 -1
  43. package/agents/format_scratchpad/xml.d.cts +0 -1
  44. package/agents/format_scratchpad/xml.d.ts +0 -1
  45. package/agents/format_scratchpad/xml.js +0 -1
  46. package/agents/load.cjs +0 -1
  47. package/agents/load.d.cts +0 -1
  48. package/agents/load.d.ts +0 -1
  49. package/agents/load.js +0 -1
  50. package/agents/openai/output_parser.cjs +0 -1
  51. package/agents/openai/output_parser.d.cts +0 -1
  52. package/agents/openai/output_parser.d.ts +0 -1
  53. package/agents/openai/output_parser.js +0 -1
  54. package/agents/react/output_parser.cjs +0 -1
  55. package/agents/react/output_parser.d.cts +0 -1
  56. package/agents/react/output_parser.d.ts +0 -1
  57. package/agents/react/output_parser.js +0 -1
  58. package/agents/toolkits/sql.cjs +0 -1
  59. package/agents/toolkits/sql.d.cts +0 -1
  60. package/agents/toolkits/sql.d.ts +0 -1
  61. package/agents/toolkits/sql.js +0 -1
  62. package/agents/toolkits.cjs +0 -1
  63. package/agents/toolkits.d.cts +0 -1
  64. package/agents/toolkits.d.ts +0 -1
  65. package/agents/toolkits.js +0 -1
  66. package/agents/xml/output_parser.cjs +0 -1
  67. package/agents/xml/output_parser.d.cts +0 -1
  68. package/agents/xml/output_parser.d.ts +0 -1
  69. package/agents/xml/output_parser.js +0 -1
  70. package/agents.cjs +0 -1
  71. package/agents.d.cts +0 -1
  72. package/agents.d.ts +0 -1
  73. package/agents.js +0 -1
  74. package/cache/file_system.cjs +0 -1
  75. package/cache/file_system.d.cts +0 -1
  76. package/cache/file_system.d.ts +0 -1
  77. package/cache/file_system.js +0 -1
  78. package/callbacks.cjs +0 -1
  79. package/callbacks.d.cts +0 -1
  80. package/callbacks.d.ts +0 -1
  81. package/callbacks.js +0 -1
  82. package/chains/combine_documents/reduce.cjs +0 -1
  83. package/chains/combine_documents/reduce.d.cts +0 -1
  84. package/chains/combine_documents/reduce.d.ts +0 -1
  85. package/chains/combine_documents/reduce.js +0 -1
  86. package/chains/combine_documents.cjs +0 -1
  87. package/chains/combine_documents.d.cts +0 -1
  88. package/chains/combine_documents.d.ts +0 -1
  89. package/chains/combine_documents.js +0 -1
  90. package/chains/graph_qa/cypher.cjs +0 -1
  91. package/chains/graph_qa/cypher.d.cts +0 -1
  92. package/chains/graph_qa/cypher.d.ts +0 -1
  93. package/chains/graph_qa/cypher.js +0 -1
  94. package/chains/history_aware_retriever.cjs +0 -1
  95. package/chains/history_aware_retriever.d.cts +0 -1
  96. package/chains/history_aware_retriever.d.ts +0 -1
  97. package/chains/history_aware_retriever.js +0 -1
  98. package/chains/load.cjs +0 -1
  99. package/chains/load.d.cts +0 -1
  100. package/chains/load.d.ts +0 -1
  101. package/chains/load.js +0 -1
  102. package/chains/openai_functions.cjs +0 -1
  103. package/chains/openai_functions.d.cts +0 -1
  104. package/chains/openai_functions.d.ts +0 -1
  105. package/chains/openai_functions.js +0 -1
  106. package/chains/query_constructor/ir.cjs +0 -1
  107. package/chains/query_constructor/ir.d.cts +0 -1
  108. package/chains/query_constructor/ir.d.ts +0 -1
  109. package/chains/query_constructor/ir.js +0 -1
  110. package/chains/query_constructor.cjs +0 -1
  111. package/chains/query_constructor.d.cts +0 -1
  112. package/chains/query_constructor.d.ts +0 -1
  113. package/chains/query_constructor.js +0 -1
  114. package/chains/retrieval.cjs +0 -1
  115. package/chains/retrieval.d.cts +0 -1
  116. package/chains/retrieval.d.ts +0 -1
  117. package/chains/retrieval.js +0 -1
  118. package/chains/sql_db.cjs +0 -1
  119. package/chains/sql_db.d.cts +0 -1
  120. package/chains/sql_db.d.ts +0 -1
  121. package/chains/sql_db.js +0 -1
  122. package/chains.cjs +0 -1
  123. package/chains.d.cts +0 -1
  124. package/chains.d.ts +0 -1
  125. package/chains.js +0 -1
  126. package/chat_models/universal.cjs +0 -1
  127. package/chat_models/universal.d.cts +0 -1
  128. package/chat_models/universal.d.ts +0 -1
  129. package/chat_models/universal.js +0 -1
  130. package/document.cjs +0 -1
  131. package/document.d.cts +0 -1
  132. package/document.d.ts +0 -1
  133. package/document.js +0 -1
  134. package/document_loaders/base.cjs +0 -1
  135. package/document_loaders/base.d.cts +0 -1
  136. package/document_loaders/base.d.ts +0 -1
  137. package/document_loaders/base.js +0 -1
  138. package/document_loaders/fs/buffer.cjs +0 -1
  139. package/document_loaders/fs/buffer.d.cts +0 -1
  140. package/document_loaders/fs/buffer.d.ts +0 -1
  141. package/document_loaders/fs/buffer.js +0 -1
  142. package/document_loaders/fs/directory.cjs +0 -1
  143. package/document_loaders/fs/directory.d.cts +0 -1
  144. package/document_loaders/fs/directory.d.ts +0 -1
  145. package/document_loaders/fs/directory.js +0 -1
  146. package/document_loaders/fs/json.cjs +0 -1
  147. package/document_loaders/fs/json.d.cts +0 -1
  148. package/document_loaders/fs/json.d.ts +0 -1
  149. package/document_loaders/fs/json.js +0 -1
  150. package/document_loaders/fs/multi_file.cjs +0 -1
  151. package/document_loaders/fs/multi_file.d.cts +0 -1
  152. package/document_loaders/fs/multi_file.d.ts +0 -1
  153. package/document_loaders/fs/multi_file.js +0 -1
  154. package/document_loaders/fs/text.cjs +0 -1
  155. package/document_loaders/fs/text.d.cts +0 -1
  156. package/document_loaders/fs/text.d.ts +0 -1
  157. package/document_loaders/fs/text.js +0 -1
  158. package/document_transformers/openai_functions.cjs +0 -1
  159. package/document_transformers/openai_functions.d.cts +0 -1
  160. package/document_transformers/openai_functions.d.ts +0 -1
  161. package/document_transformers/openai_functions.js +0 -1
  162. package/embeddings/cache_backed.cjs +0 -1
  163. package/embeddings/cache_backed.d.cts +0 -1
  164. package/embeddings/cache_backed.d.ts +0 -1
  165. package/embeddings/cache_backed.js +0 -1
  166. package/embeddings/fake.cjs +0 -1
  167. package/embeddings/fake.d.cts +0 -1
  168. package/embeddings/fake.d.ts +0 -1
  169. package/embeddings/fake.js +0 -1
  170. package/evaluation.cjs +0 -1
  171. package/evaluation.d.cts +0 -1
  172. package/evaluation.d.ts +0 -1
  173. package/evaluation.js +0 -1
  174. package/experimental/autogpt.cjs +0 -1
  175. package/experimental/autogpt.d.cts +0 -1
  176. package/experimental/autogpt.d.ts +0 -1
  177. package/experimental/autogpt.js +0 -1
  178. package/experimental/babyagi.cjs +0 -1
  179. package/experimental/babyagi.d.cts +0 -1
  180. package/experimental/babyagi.d.ts +0 -1
  181. package/experimental/babyagi.js +0 -1
  182. package/experimental/chains/violation_of_expectations.cjs +0 -1
  183. package/experimental/chains/violation_of_expectations.d.cts +0 -1
  184. package/experimental/chains/violation_of_expectations.d.ts +0 -1
  185. package/experimental/chains/violation_of_expectations.js +0 -1
  186. package/experimental/generative_agents.cjs +0 -1
  187. package/experimental/generative_agents.d.cts +0 -1
  188. package/experimental/generative_agents.d.ts +0 -1
  189. package/experimental/generative_agents.js +0 -1
  190. package/experimental/masking.cjs +0 -1
  191. package/experimental/masking.d.cts +0 -1
  192. package/experimental/masking.d.ts +0 -1
  193. package/experimental/masking.js +0 -1
  194. package/experimental/openai_assistant.cjs +0 -1
  195. package/experimental/openai_assistant.d.cts +0 -1
  196. package/experimental/openai_assistant.d.ts +0 -1
  197. package/experimental/openai_assistant.js +0 -1
  198. package/experimental/openai_files.cjs +0 -1
  199. package/experimental/openai_files.d.cts +0 -1
  200. package/experimental/openai_files.d.ts +0 -1
  201. package/experimental/openai_files.js +0 -1
  202. package/experimental/plan_and_execute.cjs +0 -1
  203. package/experimental/plan_and_execute.d.cts +0 -1
  204. package/experimental/plan_and_execute.d.ts +0 -1
  205. package/experimental/plan_and_execute.js +0 -1
  206. package/experimental/prompts/custom_format.cjs +0 -1
  207. package/experimental/prompts/custom_format.d.cts +0 -1
  208. package/experimental/prompts/custom_format.d.ts +0 -1
  209. package/experimental/prompts/custom_format.js +0 -1
  210. package/experimental/prompts/handlebars.cjs +0 -1
  211. package/experimental/prompts/handlebars.d.cts +0 -1
  212. package/experimental/prompts/handlebars.d.ts +0 -1
  213. package/experimental/prompts/handlebars.js +0 -1
  214. package/hub/node.cjs +0 -1
  215. package/hub/node.d.cts +0 -1
  216. package/hub/node.d.ts +0 -1
  217. package/hub/node.js +0 -1
  218. package/hub.cjs +0 -1
  219. package/hub.d.cts +0 -1
  220. package/hub.d.ts +0 -1
  221. package/hub.js +0 -1
  222. package/indexes.cjs +0 -1
  223. package/indexes.d.cts +0 -1
  224. package/indexes.d.ts +0 -1
  225. package/indexes.js +0 -1
  226. package/load/serializable.cjs +0 -1
  227. package/load/serializable.d.cts +0 -1
  228. package/load/serializable.d.ts +0 -1
  229. package/load/serializable.js +0 -1
  230. package/load.cjs +0 -1
  231. package/load.d.cts +0 -1
  232. package/load.d.ts +0 -1
  233. package/load.js +0 -1
  234. package/memory/chat_memory.cjs +0 -1
  235. package/memory/chat_memory.d.cts +0 -1
  236. package/memory/chat_memory.d.ts +0 -1
  237. package/memory/chat_memory.js +0 -1
  238. package/memory.cjs +0 -1
  239. package/memory.d.cts +0 -1
  240. package/memory.d.ts +0 -1
  241. package/memory.js +0 -1
  242. package/output_parsers/expression.cjs +0 -1
  243. package/output_parsers/expression.d.cts +0 -1
  244. package/output_parsers/expression.d.ts +0 -1
  245. package/output_parsers/expression.js +0 -1
  246. package/output_parsers.cjs +0 -1
  247. package/output_parsers.d.cts +0 -1
  248. package/output_parsers.d.ts +0 -1
  249. package/output_parsers.js +0 -1
  250. package/retrievers/contextual_compression.cjs +0 -1
  251. package/retrievers/contextual_compression.d.cts +0 -1
  252. package/retrievers/contextual_compression.d.ts +0 -1
  253. package/retrievers/contextual_compression.js +0 -1
  254. package/retrievers/document_compressors/chain_extract.cjs +0 -1
  255. package/retrievers/document_compressors/chain_extract.d.cts +0 -1
  256. package/retrievers/document_compressors/chain_extract.d.ts +0 -1
  257. package/retrievers/document_compressors/chain_extract.js +0 -1
  258. package/retrievers/document_compressors/embeddings_filter.cjs +0 -1
  259. package/retrievers/document_compressors/embeddings_filter.d.cts +0 -1
  260. package/retrievers/document_compressors/embeddings_filter.d.ts +0 -1
  261. package/retrievers/document_compressors/embeddings_filter.js +0 -1
  262. package/retrievers/document_compressors.cjs +0 -1
  263. package/retrievers/document_compressors.d.cts +0 -1
  264. package/retrievers/document_compressors.d.ts +0 -1
  265. package/retrievers/document_compressors.js +0 -1
  266. package/retrievers/ensemble.cjs +0 -1
  267. package/retrievers/ensemble.d.cts +0 -1
  268. package/retrievers/ensemble.d.ts +0 -1
  269. package/retrievers/ensemble.js +0 -1
  270. package/retrievers/hyde.cjs +0 -1
  271. package/retrievers/hyde.d.cts +0 -1
  272. package/retrievers/hyde.d.ts +0 -1
  273. package/retrievers/hyde.js +0 -1
  274. package/retrievers/matryoshka_retriever.cjs +0 -1
  275. package/retrievers/matryoshka_retriever.d.cts +0 -1
  276. package/retrievers/matryoshka_retriever.d.ts +0 -1
  277. package/retrievers/matryoshka_retriever.js +0 -1
  278. package/retrievers/multi_query.cjs +0 -1
  279. package/retrievers/multi_query.d.cts +0 -1
  280. package/retrievers/multi_query.d.ts +0 -1
  281. package/retrievers/multi_query.js +0 -1
  282. package/retrievers/multi_vector.cjs +0 -1
  283. package/retrievers/multi_vector.d.cts +0 -1
  284. package/retrievers/multi_vector.d.ts +0 -1
  285. package/retrievers/multi_vector.js +0 -1
  286. package/retrievers/parent_document.cjs +0 -1
  287. package/retrievers/parent_document.d.cts +0 -1
  288. package/retrievers/parent_document.d.ts +0 -1
  289. package/retrievers/parent_document.js +0 -1
  290. package/retrievers/score_threshold.cjs +0 -1
  291. package/retrievers/score_threshold.d.cts +0 -1
  292. package/retrievers/score_threshold.d.ts +0 -1
  293. package/retrievers/score_threshold.js +0 -1
  294. package/retrievers/self_query/functional.cjs +0 -1
  295. package/retrievers/self_query/functional.d.cts +0 -1
  296. package/retrievers/self_query/functional.d.ts +0 -1
  297. package/retrievers/self_query/functional.js +0 -1
  298. package/retrievers/self_query.cjs +0 -1
  299. package/retrievers/self_query.d.cts +0 -1
  300. package/retrievers/self_query.d.ts +0 -1
  301. package/retrievers/self_query.js +0 -1
  302. package/retrievers/time_weighted.cjs +0 -1
  303. package/retrievers/time_weighted.d.cts +0 -1
  304. package/retrievers/time_weighted.d.ts +0 -1
  305. package/retrievers/time_weighted.js +0 -1
  306. package/schema/prompt_template.cjs +0 -1
  307. package/schema/prompt_template.d.cts +0 -1
  308. package/schema/prompt_template.d.ts +0 -1
  309. package/schema/prompt_template.js +0 -1
  310. package/schema/query_constructor.cjs +0 -1
  311. package/schema/query_constructor.d.cts +0 -1
  312. package/schema/query_constructor.d.ts +0 -1
  313. package/schema/query_constructor.js +0 -1
  314. package/smith.cjs +0 -1
  315. package/smith.d.cts +0 -1
  316. package/smith.d.ts +0 -1
  317. package/smith.js +0 -1
  318. package/sql_db.cjs +0 -1
  319. package/sql_db.d.cts +0 -1
  320. package/sql_db.d.ts +0 -1
  321. package/sql_db.js +0 -1
  322. package/storage/encoder_backed.cjs +0 -1
  323. package/storage/encoder_backed.d.cts +0 -1
  324. package/storage/encoder_backed.d.ts +0 -1
  325. package/storage/encoder_backed.js +0 -1
  326. package/storage/file_system.cjs +0 -1
  327. package/storage/file_system.d.cts +0 -1
  328. package/storage/file_system.d.ts +0 -1
  329. package/storage/file_system.js +0 -1
  330. package/storage/in_memory.cjs +0 -1
  331. package/storage/in_memory.d.cts +0 -1
  332. package/storage/in_memory.d.ts +0 -1
  333. package/storage/in_memory.js +0 -1
  334. package/stores/doc/base.cjs +0 -1
  335. package/stores/doc/base.d.cts +0 -1
  336. package/stores/doc/base.d.ts +0 -1
  337. package/stores/doc/base.js +0 -1
  338. package/stores/doc/in_memory.cjs +0 -1
  339. package/stores/doc/in_memory.d.cts +0 -1
  340. package/stores/doc/in_memory.d.ts +0 -1
  341. package/stores/doc/in_memory.js +0 -1
  342. package/stores/file/in_memory.cjs +0 -1
  343. package/stores/file/in_memory.d.cts +0 -1
  344. package/stores/file/in_memory.d.ts +0 -1
  345. package/stores/file/in_memory.js +0 -1
  346. package/stores/file/node.cjs +0 -1
  347. package/stores/file/node.d.cts +0 -1
  348. package/stores/file/node.d.ts +0 -1
  349. package/stores/file/node.js +0 -1
  350. package/stores/message/in_memory.cjs +0 -1
  351. package/stores/message/in_memory.d.cts +0 -1
  352. package/stores/message/in_memory.d.ts +0 -1
  353. package/stores/message/in_memory.js +0 -1
  354. package/text_splitter.cjs +0 -1
  355. package/text_splitter.d.cts +0 -1
  356. package/text_splitter.d.ts +0 -1
  357. package/text_splitter.js +0 -1
  358. package/tools/chain.cjs +0 -1
  359. package/tools/chain.d.cts +0 -1
  360. package/tools/chain.d.ts +0 -1
  361. package/tools/chain.js +0 -1
  362. package/tools/render.cjs +0 -1
  363. package/tools/render.d.cts +0 -1
  364. package/tools/render.d.ts +0 -1
  365. package/tools/render.js +0 -1
  366. package/tools/retriever.cjs +0 -1
  367. package/tools/retriever.d.cts +0 -1
  368. package/tools/retriever.d.ts +0 -1
  369. package/tools/retriever.js +0 -1
  370. package/tools/sql.cjs +0 -1
  371. package/tools/sql.d.cts +0 -1
  372. package/tools/sql.d.ts +0 -1
  373. package/tools/sql.js +0 -1
  374. package/tools/webbrowser.cjs +0 -1
  375. package/tools/webbrowser.d.cts +0 -1
  376. package/tools/webbrowser.d.ts +0 -1
  377. package/tools/webbrowser.js +0 -1
  378. package/tools.cjs +0 -1
  379. package/tools.d.cts +0 -1
  380. package/tools.d.ts +0 -1
  381. package/tools.js +0 -1
  382. package/util/document.cjs +0 -1
  383. package/util/document.d.cts +0 -1
  384. package/util/document.d.ts +0 -1
  385. package/util/document.js +0 -1
  386. package/util/math.cjs +0 -1
  387. package/util/math.d.cts +0 -1
  388. package/util/math.d.ts +0 -1
  389. package/util/math.js +0 -1
  390. package/util/time.cjs +0 -1
  391. package/util/time.d.cts +0 -1
  392. package/util/time.d.ts +0 -1
  393. package/util/time.js +0 -1
  394. package/vectorstores/memory.cjs +0 -1
  395. package/vectorstores/memory.d.cts +0 -1
  396. package/vectorstores/memory.d.ts +0 -1
  397. package/vectorstores/memory.js +0 -1
@@ -51,12 +51,12 @@ declare class ChatAgentOutputParser extends AgentActionOutputParser {
51
51
  * @returns An object that satisfies the AgentFinish interface or an object with the tool, toolInput, and log.
52
52
  */
53
53
  parse(text: string): Promise<{
54
- tool?: undefined;
55
- toolInput?: undefined;
56
54
  returnValues: {
57
55
  output: string;
58
56
  };
59
57
  log: string;
58
+ tool?: undefined;
59
+ toolInput?: undefined;
60
60
  } | {
61
61
  returnValues?: undefined;
62
62
  tool: any;
@@ -1 +1 @@
1
- {"version":3,"file":"outputParser.d.cts","names":["AgentActionOutputParser","FINAL_ANSWER_ACTION","ChatAgentOutputParser","Promise"],"sources":["../../../src/agents/chat/outputParser.d.ts"],"sourcesContent":["import { AgentActionOutputParser } from \"../types.js\";\nexport declare const FINAL_ANSWER_ACTION = \"Final Answer:\";\n/**\n * A class that extends the AgentActionOutputParser to parse the output of\n * the ChatAgent in LangChain. It checks if the output text contains the\n * final answer action or a JSON response, and parses it accordingly.\n * @example\n * ```typescript\n * const prompt = ChatPromptTemplate.fromMessages([\n * [\n * \"ai\",\n * `{PREFIX}\n * {FORMAT_INSTRUCTIONS}\n * {SUFFIX}`,\n * ],\n * [\"human\", \"Question: {input}\"],\n * ]);\n * const runnableAgent = RunnableSequence.from([\n * {\n * input: (i: { input: string; steps: AgentStep[] }) => i.input,\n * agent_scratchpad: (i: { input: string; steps: AgentStep[] }) =>\n * formatLogToString(i.steps),\n * },\n * prompt,\n * new OpenAI({ temperature: 0 }),\n * new ChatAgentOutputParser(),\n * ]);\n *\n * const executor = AgentExecutor.fromAgentAndTools({\n * agent: runnableAgent,\n * tools: [new SerpAPI(), new Calculator()],\n * });\n *\n * const result = await executor.invoke({\n * input:\n * \"Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?\",\n * });\n * ```\n */\nexport declare class ChatAgentOutputParser extends AgentActionOutputParser {\n lc_namespace: string[];\n /**\n * Parses the output text from the MRKL chain into an agent action or\n * agent finish. If the text contains the final answer action or does not\n * contain an action, it returns an AgentFinish with the output and log.\n * If the text contains a JSON response, it returns the tool, toolInput,\n * and log.\n * @param text The output text from the MRKL chain.\n * @returns An object that satisfies the AgentFinish interface or an object with the tool, toolInput, and log.\n */\n parse(text: string): Promise<{\n tool?: undefined;\n toolInput?: undefined;\n returnValues: {\n output: string;\n };\n log: string;\n } | {\n returnValues?: undefined;\n tool: any;\n toolInput: any;\n log: string;\n }>;\n /**\n * Returns the format instructions used in the output parser for the\n * ChatAgent class.\n * @returns The format instructions as a string.\n */\n getFormatInstructions(): string;\n}\n//# sourceMappingURL=outputParser.d.ts.map"],"mappings":";;;;;AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAqBE,qBAAAA,SAA8BF,uBAAuB;;;;;;;;;;;uBAWjDG"}
1
+ {"version":3,"file":"outputParser.d.cts","names":["AgentActionOutputParser","FINAL_ANSWER_ACTION","ChatAgentOutputParser","Promise"],"sources":["../../../src/agents/chat/outputParser.d.ts"],"sourcesContent":["import { AgentActionOutputParser } from \"../types.js\";\nexport declare const FINAL_ANSWER_ACTION = \"Final Answer:\";\n/**\n * A class that extends the AgentActionOutputParser to parse the output of\n * the ChatAgent in LangChain. It checks if the output text contains the\n * final answer action or a JSON response, and parses it accordingly.\n * @example\n * ```typescript\n * const prompt = ChatPromptTemplate.fromMessages([\n * [\n * \"ai\",\n * `{PREFIX}\n * {FORMAT_INSTRUCTIONS}\n * {SUFFIX}`,\n * ],\n * [\"human\", \"Question: {input}\"],\n * ]);\n * const runnableAgent = RunnableSequence.from([\n * {\n * input: (i: { input: string; steps: AgentStep[] }) => i.input,\n * agent_scratchpad: (i: { input: string; steps: AgentStep[] }) =>\n * formatLogToString(i.steps),\n * },\n * prompt,\n * new OpenAI({ temperature: 0 }),\n * new ChatAgentOutputParser(),\n * ]);\n *\n * const executor = AgentExecutor.fromAgentAndTools({\n * agent: runnableAgent,\n * tools: [new SerpAPI(), new Calculator()],\n * });\n *\n * const result = await executor.invoke({\n * input:\n * \"Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?\",\n * });\n * ```\n */\nexport declare class ChatAgentOutputParser extends AgentActionOutputParser {\n lc_namespace: string[];\n /**\n * Parses the output text from the MRKL chain into an agent action or\n * agent finish. If the text contains the final answer action or does not\n * contain an action, it returns an AgentFinish with the output and log.\n * If the text contains a JSON response, it returns the tool, toolInput,\n * and log.\n * @param text The output text from the MRKL chain.\n * @returns An object that satisfies the AgentFinish interface or an object with the tool, toolInput, and log.\n */\n parse(text: string): Promise<{\n returnValues: {\n output: string;\n };\n log: string;\n tool?: undefined;\n toolInput?: undefined;\n } | {\n returnValues?: undefined;\n tool: any;\n toolInput: any;\n log: string;\n }>;\n /**\n * Returns the format instructions used in the output parser for the\n * ChatAgent class.\n * @returns The format instructions as a string.\n */\n getFormatInstructions(): string;\n}\n//# sourceMappingURL=outputParser.d.ts.map"],"mappings":";;;;;AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAqBE,qBAAAA,SAA8BF,uBAAuB;;;;;;;;;;;uBAWjDG"}
@@ -1,7 +1,7 @@
1
1
  import { ToolsAgentStep } from "../tool_calling/output_parser.cjs";
2
2
  import { AgentRunnableSequence } from "../agent.cjs";
3
3
  import { OpenAIToolsAgentOutputParser } from "./output_parser.cjs";
4
- import * as _langchain_core_agents3 from "@langchain/core/agents";
4
+ import * as _langchain_core_agents0 from "@langchain/core/agents";
5
5
  import { ChatPromptTemplate } from "@langchain/core/prompts";
6
6
  import { ToolDefinition } from "@langchain/core/language_models/base";
7
7
  import { StructuredToolInterface } from "@langchain/core/tools";
@@ -94,7 +94,7 @@ declare function createOpenAIToolsAgent({
94
94
  streamRunnable
95
95
  }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{
96
96
  steps: ToolsAgentStep[];
97
- }, _langchain_core_agents3.AgentFinish | _langchain_core_agents3.AgentAction[]>>;
97
+ }, _langchain_core_agents0.AgentFinish | _langchain_core_agents0.AgentAction[]>>;
98
98
  //#endregion
99
99
  export { CreateOpenAIToolsAgentParams, createOpenAIToolsAgent };
100
100
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents3","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[] | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAMjBP;;;;;EAIgBG,GAAAA,EAJ9BJ,aAI8BI,CAJhBH,wBAIgBG,GAAAA;IAE3BF,KAAAA,CAAAA,EALIH,uBAKJG,EAAAA,GALgCC,YAAAA,CAAaM,kBAK7CP,EAAAA,GAAAA,GAAAA,EAAAA;EAAkB,CAAA,CAAA;EA+DNQ;EAAyBC,KAAAA,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAKC;EAAOC,MAAAA,EA/DjDX,kBA+DiDW;EAAQC;;;;EAEtBC,cAAAA,CAAAA,EAAAA,OAAoCE;CAF2CV;;AAAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGG,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAcS,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
1
+ {"version":3,"file":"index.d.cts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents0","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[] | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAMjBP;;;;;EAIgBG,GAAAA,EAJ9BJ,aAI8BI,CAJhBH,wBAIgBG,GAAAA;IAE3BF,KAAAA,CAAAA,EALIH,uBAKJG,EAAAA,GALgCC,YAAAA,CAAaM,kBAK7CP,EAAAA,GAAAA,GAAAA,EAAAA;EAAkB,CAAA,CAAA;EA+DNQ;EAAyBC,KAAAA,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAKC;EAAOC,MAAAA,EA/DjDX,kBA+DiDW;EAAQC;;;;EAEtBC,cAAAA,CAAAA,EAAAA,OAAoCE;CAF2CV;;AAAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGG,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAcS,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
@@ -6,7 +6,7 @@ import { StructuredToolInterface } from "@langchain/core/tools";
6
6
  import { ToolDefinition } from "@langchain/core/language_models/base";
7
7
  import { OpenAIClient } from "@langchain/openai";
8
8
  import { BaseChatModel, BaseChatModelCallOptions } from "@langchain/core/language_models/chat_models";
9
- import * as _langchain_core_agents1 from "@langchain/core/agents";
9
+ import * as _langchain_core_agents3 from "@langchain/core/agents";
10
10
 
11
11
  //#region src/agents/openai_tools/index.d.ts
12
12
  /**
@@ -94,7 +94,7 @@ declare function createOpenAIToolsAgent({
94
94
  streamRunnable
95
95
  }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{
96
96
  steps: ToolsAgentStep[];
97
- }, _langchain_core_agents1.AgentFinish | _langchain_core_agents1.AgentAction[]>>;
97
+ }, _langchain_core_agents3.AgentFinish | _langchain_core_agents3.AgentAction[]>>;
98
98
  //#endregion
99
99
  export { CreateOpenAIToolsAgentParams, createOpenAIToolsAgent };
100
100
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents1","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[] | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAMjBP;;;;;EAIgBG,GAAAA,EAJ9BJ,aAI8BI,CAJhBH,wBAIgBG,GAAAA;IAE3BF,KAAAA,CAAAA,EALIH,uBAKJG,EAAAA,GALgCC,YAAAA,CAAaM,kBAK7CP,EAAAA,GAAAA,GAAAA,EAAAA;EAAkB,CAAA,CAAA;EA+DNQ;EAAyBC,KAAAA,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAKC;EAAOC,MAAAA,EA/DjDX,kBA+DiDW;EAAQC;;;;EAEtBC,cAAAA,CAAAA,EAAAA,OAAoCE;CAF2CV;;AAAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGG,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAcS,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
1
+ {"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseChatModel","BaseChatModelCallOptions","ChatPromptTemplate","OpenAIClient","ToolDefinition","OpenAIToolsAgentOutputParser","ToolsAgentStep","AgentRunnableSequence","CreateOpenAIToolsAgentParams","ChatCompletionTool","createOpenAIToolsAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents3","AgentFinish","AgentAction","Promise"],"sources":["../../../src/agents/openai_tools/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { BaseChatModel, BaseChatModelCallOptions } from \"@langchain/core/language_models/chat_models\";\nimport { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { OpenAIClient } from \"@langchain/openai\";\nimport { ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { OpenAIToolsAgentOutputParser, type ToolsAgentStep } from \"./output_parser.js\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nexport { OpenAIToolsAgentOutputParser, type ToolsAgentStep };\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateOpenAIToolsAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: BaseChatModel<BaseChatModelCallOptions & {\n tools?: StructuredToolInterface[] | OpenAIClient.ChatCompletionTool[] | any[];\n }>;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses OpenAI-style tool calling.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createOpenAIToolsAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/openai-tools-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/openai-tools-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createOpenAIToolsAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createOpenAIToolsAgent({ llm, tools, prompt, streamRunnable }: CreateOpenAIToolsAgentParams): Promise<AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAWYS,KAAAA,4BAAAA,GAA4B;EAMjBP;;;;;EAIgBG,GAAAA,EAJ9BJ,aAI8BI,CAJhBH,wBAIgBG,GAAAA;IAE3BF,KAAAA,CAAAA,EALIH,uBAKJG,EAAAA,GALgCC,YAAAA,CAAaM,kBAK7CP,EAAAA,GAAAA,GAAAA,EAAAA;EAAkB,CAAA,CAAA;EA+DNQ;EAAyBC,KAAAA,EAjEtCZ,uBAiEsCY,EAAAA,GAjEVP,cAiEUO,EAAAA;EAAKC;EAAOC,MAAAA,EA/DjDX,kBA+DiDW;EAAQC;;;;EAEtBC,cAAAA,CAAAA,EAAAA,OAAoCE;CAF2CV;;AAAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAArGG,sBAAAA;;;;;GAA+DF,+BAA+BU,QAAQX;SACnHD;GAAcS,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
@@ -1,5 +1,5 @@
1
1
  import { AgentRunnableSequence } from "../agent.cjs";
2
- import * as _langchain_core_agents0 from "@langchain/core/agents";
2
+ import * as _langchain_core_agents5 from "@langchain/core/agents";
3
3
  import { AgentStep } from "@langchain/core/agents";
4
4
  import { BasePromptTemplate } from "@langchain/core/prompts";
5
5
  import { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
@@ -75,7 +75,7 @@ declare function createReactAgent({
75
75
  streamRunnable
76
76
  }: CreateReactAgentParams): Promise<AgentRunnableSequence<{
77
77
  steps: AgentStep[];
78
- }, _langchain_core_agents0.AgentAction | _langchain_core_agents0.AgentFinish>>;
78
+ }, _langchain_core_agents5.AgentAction | _langchain_core_agents5.AgentFinish>>;
79
79
  //#endregion
80
80
  export { CreateReactAgentParams, createReactAgent };
81
81
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["ToolInterface","BasePromptTemplate","BaseLanguageModelInterface","AgentStep","AgentRunnableSequence","CreateReactAgentParams","createReactAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents0","AgentAction","AgentFinish","Promise"],"sources":["../../../src/agents/react/index.d.ts"],"sourcesContent":["import type { ToolInterface } from \"@langchain/core/tools\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { AgentRunnableSequence } from \"../agent.js\";\n/**\n * Params used by the createXmlAgent function.\n */\nexport type CreateReactAgentParams = {\n /** LLM to use for the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: ToolInterface[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses ReAct prompting.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createReactAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { PromptTemplate } from \"@langchain/core/prompts\";\n *\n * import { OpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/react\n * const prompt = await pull<PromptTemplate>(\"hwchase17/react\");\n *\n * const llm = new OpenAI({\n * temperature: 0,\n * });\n *\n * const agent = await createReactAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n * ```\n */\nexport declare function createReactAgent({ llm, tools, prompt, streamRunnable }: CreateReactAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;AAQYK,KAAAA,sBAAAA,GAAsB;EAEzBH;EAEEF,GAAAA,EAFFE,0BAEEF;EAKCC;EAAkB,KAAA,EALnBD,aAKmB,EAAA;EAkDNM;;;;EAAuCI,MAAAA,EAlDnDT,kBAkDmDS;EAAkBL;;;;EAAiCD,cAAAA,CAAAA,EAAAA,OAAAA;CAARU;AAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAzFR,gBAAAA;;;;;GAAyDD,yBAAyBS,QAAQV;SACvGD;GAASQ,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
1
+ {"version":3,"file":"index.d.cts","names":["ToolInterface","BasePromptTemplate","BaseLanguageModelInterface","AgentStep","AgentRunnableSequence","CreateReactAgentParams","createReactAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents5","AgentAction","AgentFinish","Promise"],"sources":["../../../src/agents/react/index.d.ts"],"sourcesContent":["import type { ToolInterface } from \"@langchain/core/tools\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { AgentRunnableSequence } from \"../agent.js\";\n/**\n * Params used by the createXmlAgent function.\n */\nexport type CreateReactAgentParams = {\n /** LLM to use for the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: ToolInterface[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses ReAct prompting.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createReactAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { PromptTemplate } from \"@langchain/core/prompts\";\n *\n * import { OpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/react\n * const prompt = await pull<PromptTemplate>(\"hwchase17/react\");\n *\n * const llm = new OpenAI({\n * temperature: 0,\n * });\n *\n * const agent = await createReactAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n * ```\n */\nexport declare function createReactAgent({ llm, tools, prompt, streamRunnable }: CreateReactAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;AAQYK,KAAAA,sBAAAA,GAAsB;EAEzBH;EAEEF,GAAAA,EAFFE,0BAEEF;EAKCC;EAAkB,KAAA,EALnBD,aAKmB,EAAA;EAkDNM;;;;EAAuCI,MAAAA,EAlDnDT,kBAkDmDS;EAAkBL;;;;EAAiCD,cAAAA,CAAAA,EAAAA,OAAAA;CAARU;AAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAzFR,gBAAAA;;;;;GAAyDD,yBAAyBS,QAAQV;SACvGD;GAASQ,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
@@ -2,7 +2,7 @@ import { AgentInput } from "../types.cjs";
2
2
  import { Agent, AgentArgs, AgentRunnableSequence, OutputParserArgs } from "../agent.cjs";
3
3
  import { Optional } from "../../types/type-utils.cjs";
4
4
  import { StructuredChatOutputParserWithRetries } from "./outputParser.cjs";
5
- import * as _langchain_core_agents1 from "@langchain/core/agents";
5
+ import * as _langchain_core_agents3 from "@langchain/core/agents";
6
6
  import { AgentStep } from "@langchain/core/agents";
7
7
  import { BaseMessagePromptTemplate, BasePromptTemplate, ChatPromptTemplate } from "@langchain/core/prompts";
8
8
  import { BaseLanguageModelInterface, ToolDefinition } from "@langchain/core/language_models/base";
@@ -176,7 +176,7 @@ declare function createStructuredChatAgent({
176
176
  streamRunnable
177
177
  }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{
178
178
  steps: AgentStep[];
179
- }, _langchain_core_agents1.AgentAction | _langchain_core_agents1.AgentFinish>>;
179
+ }, _langchain_core_agents3.AgentAction | _langchain_core_agents3.AgentFinish>>;
180
180
  //#endregion
181
181
  export { CreateStructuredChatAgentParams, StructuredChatAgent, StructuredChatAgentInput, StructuredChatCreatePromptArgs, createStructuredChatAgent };
182
182
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["StructuredToolInterface","BaseLanguageModelInterface","ToolDefinition","BasePromptTemplate","BaseMessagePromptTemplate","ChatPromptTemplate","AgentStep","Optional","Agent","AgentArgs","AgentRunnableSequence","OutputParserArgs","AgentInput","StructuredChatOutputParserWithRetries","StructuredChatCreatePromptArgs","StructuredChatAgentInput","StructuredChatAgent","Promise","CreateStructuredChatAgentParams","createStructuredChatAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents1","AgentAction","AgentFinish"],"sources":["../../../src/agents/structured_chat/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { type BaseLanguageModelInterface, type ToolDefinition } from \"@langchain/core/language_models/base\";\nimport type { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessagePromptTemplate, ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { Optional } from \"../../types/type-utils.js\";\nimport { Agent, AgentArgs, AgentRunnableSequence, OutputParserArgs } from \"../agent.js\";\nimport { AgentInput } from \"../types.js\";\nimport { StructuredChatOutputParserWithRetries } from \"./outputParser.js\";\n/**\n * Interface for arguments used to create a prompt for a\n * StructuredChatAgent.\n */\nexport interface StructuredChatCreatePromptArgs {\n /** String to put after the list of tools. */\n suffix?: string;\n /** String to put before the list of tools. */\n prefix?: string;\n /** String to use directly as the human message template. */\n humanMessageTemplate?: string;\n /** List of input variables the final prompt will expect. */\n inputVariables?: string[];\n /** List of historical prompts from memory. */\n memoryPrompts?: BaseMessagePromptTemplate[];\n}\n/**\n * Type for input data for creating a StructuredChatAgent, with the\n * 'outputParser' property made optional.\n */\nexport type StructuredChatAgentInput = Optional<AgentInput, \"outputParser\">;\n/**\n * Agent that interoperates with Structured Tools using React logic.\n * @augments Agent\n */\nexport declare class StructuredChatAgent extends Agent {\n static lc_name(): string;\n lc_namespace: string[];\n constructor(input: StructuredChatAgentInput);\n _agentType(): \"structured-chat-zero-shot-react-description\";\n observationPrefix(): string;\n llmPrefix(): string;\n _stop(): string[];\n /**\n * Validates that all provided tools have a description. Throws an error\n * if any tool lacks a description.\n * @param tools Array of StructuredTool instances to validate.\n */\n static validateTools(tools: StructuredToolInterface[]): void;\n /**\n * Returns a default output parser for the StructuredChatAgent. If an LLM\n * is provided, it creates an output parser with retry logic from the LLM.\n * @param fields Optional fields to customize the output parser. Can include an LLM and a list of tool names.\n * @returns An instance of StructuredChatOutputParserWithRetries.\n */\n static getDefaultOutputParser(fields?: OutputParserArgs & {\n toolNames: string[];\n }): StructuredChatOutputParserWithRetries;\n /**\n * Constructs the agent's scratchpad from a list of steps. If the agent's\n * scratchpad is not empty, it prepends a message indicating that the\n * agent has not seen any previous work.\n * @param steps Array of AgentStep instances to construct the scratchpad from.\n * @returns A Promise that resolves to a string representing the agent's scratchpad.\n */\n constructScratchPad(steps: AgentStep[]): Promise<string>;\n /**\n * Creates a string representation of the schemas of the provided tools.\n * @param tools Array of StructuredTool instances to create the schemas string from.\n * @returns A string representing the schemas of the provided tools.\n */\n static createToolSchemasString(tools: StructuredToolInterface[]): string;\n /**\n * Create prompt in the style of the agent.\n *\n * @param tools - List of tools the agent will have access to, used to format the prompt.\n * @param args - Arguments to create the prompt with.\n * @param args.suffix - String to put after the list of tools.\n * @param args.prefix - String to put before the list of tools.\n * @param args.inputVariables List of input variables the final prompt will expect.\n * @param args.memoryPrompts List of historical prompts from memory.\n */\n static createPrompt(tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs): ChatPromptTemplate<any, any>;\n /**\n * Creates a StructuredChatAgent from an LLM and a list of tools.\n * Validates the tools, creates a prompt, and sets up an LLM chain for the\n * agent.\n * @param llm BaseLanguageModel instance to create the agent from.\n * @param tools Array of StructuredTool instances to create the agent from.\n * @param args Optional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.\n * @returns A new instance of StructuredChatAgent.\n */\n static fromLLMAndTools(llm: BaseLanguageModelInterface, tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs & AgentArgs): StructuredChatAgent;\n}\n/**\n * Params used by the createStructuredChatAgent function.\n */\nexport type CreateStructuredChatAgentParams = {\n /** LLM to use as the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: (StructuredToolInterface | ToolDefinition)[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent aimed at supporting tools with multiple inputs.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createStructuredChatAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/structured-chat-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/structured-chat-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createStructuredChatAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createStructuredChatAgent({ llm, tools, prompt, streamRunnable }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAaA;AAgBA;AAKqBgB,UArBJF,8BAAAA,CAqBuB;EAGjBC;EAUSf,MAAAA,CAAAA,EAAAA,MAAAA;EAOWW;EAEnCE,MAAAA,CAAAA,EAAAA,MAAAA;EAQuBP;EAAcW,oBAAAA,CAAAA,EAAAA,MAAAA;EAMHjB;EAWXA,cAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkCc;EAAiCT,aAAAA,CAAAA,EA1D9ED,yBA0D8EC,EAAAA;;;;;;AA/CjDG,KALrCO,wBAAAA,GAA2BR,QAKUC,CALDI,UAKCJ,EAAAA,cAAAA,CAAAA;AAAK;AA8DtD;;;AAIsCN,cAlEjBc,mBAAAA,SAA4BR,KAAAA,CAkEXN;EAK1BC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAkB,YAAA,EAAA,MAAA,EAAA;EA+DNgB,WAAAA,CAAAA,KAAAA,EAnIDJ,wBAmI0B;EAAGK,UAAAA,CAAAA,CAAAA,EAAAA,6CAAAA;EAAKC,iBAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAOC,SAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAQC,KAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkBL;;;;;EAAkCD,OAAAA,aAAAA,CAAAA,KAAAA,EAzH5FjB,uBAyH4FiB,EAAAA,CAAAA,EAAAA,IAAAA;EAAO;;;;;;yCAlHxFN;;MAEnCE;;;;;;;;6BAQuBP,cAAcW;;;;;;wCAMHjB;;;;;;;;;;;6BAWXA,kCAAkCc,iCAAiCT;;;;;;;;;;8BAUlEJ,mCAAmCD,kCAAkCc,iCAAiCL,YAAYO;;;;;KAKtIE,+BAAAA;;OAEHjB;;UAEGD,0BAA0BE;;;;;UAK1BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DYgB,yBAAAA;;;;;GAAkED,kCAAkCD,QAAQP;SACzHJ;GAASkB,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
1
+ {"version":3,"file":"index.d.cts","names":["StructuredToolInterface","BaseLanguageModelInterface","ToolDefinition","BasePromptTemplate","BaseMessagePromptTemplate","ChatPromptTemplate","AgentStep","Optional","Agent","AgentArgs","AgentRunnableSequence","OutputParserArgs","AgentInput","StructuredChatOutputParserWithRetries","StructuredChatCreatePromptArgs","StructuredChatAgentInput","StructuredChatAgent","Promise","CreateStructuredChatAgentParams","createStructuredChatAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents3","AgentAction","AgentFinish"],"sources":["../../../src/agents/structured_chat/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { type BaseLanguageModelInterface, type ToolDefinition } from \"@langchain/core/language_models/base\";\nimport type { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessagePromptTemplate, ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { Optional } from \"../../types/type-utils.js\";\nimport { Agent, AgentArgs, AgentRunnableSequence, OutputParserArgs } from \"../agent.js\";\nimport { AgentInput } from \"../types.js\";\nimport { StructuredChatOutputParserWithRetries } from \"./outputParser.js\";\n/**\n * Interface for arguments used to create a prompt for a\n * StructuredChatAgent.\n */\nexport interface StructuredChatCreatePromptArgs {\n /** String to put after the list of tools. */\n suffix?: string;\n /** String to put before the list of tools. */\n prefix?: string;\n /** String to use directly as the human message template. */\n humanMessageTemplate?: string;\n /** List of input variables the final prompt will expect. */\n inputVariables?: string[];\n /** List of historical prompts from memory. */\n memoryPrompts?: BaseMessagePromptTemplate[];\n}\n/**\n * Type for input data for creating a StructuredChatAgent, with the\n * 'outputParser' property made optional.\n */\nexport type StructuredChatAgentInput = Optional<AgentInput, \"outputParser\">;\n/**\n * Agent that interoperates with Structured Tools using React logic.\n * @augments Agent\n */\nexport declare class StructuredChatAgent extends Agent {\n static lc_name(): string;\n lc_namespace: string[];\n constructor(input: StructuredChatAgentInput);\n _agentType(): \"structured-chat-zero-shot-react-description\";\n observationPrefix(): string;\n llmPrefix(): string;\n _stop(): string[];\n /**\n * Validates that all provided tools have a description. Throws an error\n * if any tool lacks a description.\n * @param tools Array of StructuredTool instances to validate.\n */\n static validateTools(tools: StructuredToolInterface[]): void;\n /**\n * Returns a default output parser for the StructuredChatAgent. If an LLM\n * is provided, it creates an output parser with retry logic from the LLM.\n * @param fields Optional fields to customize the output parser. Can include an LLM and a list of tool names.\n * @returns An instance of StructuredChatOutputParserWithRetries.\n */\n static getDefaultOutputParser(fields?: OutputParserArgs & {\n toolNames: string[];\n }): StructuredChatOutputParserWithRetries;\n /**\n * Constructs the agent's scratchpad from a list of steps. If the agent's\n * scratchpad is not empty, it prepends a message indicating that the\n * agent has not seen any previous work.\n * @param steps Array of AgentStep instances to construct the scratchpad from.\n * @returns A Promise that resolves to a string representing the agent's scratchpad.\n */\n constructScratchPad(steps: AgentStep[]): Promise<string>;\n /**\n * Creates a string representation of the schemas of the provided tools.\n * @param tools Array of StructuredTool instances to create the schemas string from.\n * @returns A string representing the schemas of the provided tools.\n */\n static createToolSchemasString(tools: StructuredToolInterface[]): string;\n /**\n * Create prompt in the style of the agent.\n *\n * @param tools - List of tools the agent will have access to, used to format the prompt.\n * @param args - Arguments to create the prompt with.\n * @param args.suffix - String to put after the list of tools.\n * @param args.prefix - String to put before the list of tools.\n * @param args.inputVariables List of input variables the final prompt will expect.\n * @param args.memoryPrompts List of historical prompts from memory.\n */\n static createPrompt(tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs): ChatPromptTemplate<any, any>;\n /**\n * Creates a StructuredChatAgent from an LLM and a list of tools.\n * Validates the tools, creates a prompt, and sets up an LLM chain for the\n * agent.\n * @param llm BaseLanguageModel instance to create the agent from.\n * @param tools Array of StructuredTool instances to create the agent from.\n * @param args Optional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.\n * @returns A new instance of StructuredChatAgent.\n */\n static fromLLMAndTools(llm: BaseLanguageModelInterface, tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs & AgentArgs): StructuredChatAgent;\n}\n/**\n * Params used by the createStructuredChatAgent function.\n */\nexport type CreateStructuredChatAgentParams = {\n /** LLM to use as the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: (StructuredToolInterface | ToolDefinition)[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent aimed at supporting tools with multiple inputs.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createStructuredChatAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/structured-chat-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/structured-chat-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createStructuredChatAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createStructuredChatAgent({ llm, tools, prompt, streamRunnable }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAaA;AAgBA;AAKqBgB,UArBJF,8BAAAA,CAqBuB;EAGjBC;EAUSf,MAAAA,CAAAA,EAAAA,MAAAA;EAOWW;EAEnCE,MAAAA,CAAAA,EAAAA,MAAAA;EAQuBP;EAAcW,oBAAAA,CAAAA,EAAAA,MAAAA;EAMHjB;EAWXA,cAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkCc;EAAiCT,aAAAA,CAAAA,EA1D9ED,yBA0D8EC,EAAAA;;;;;;AA/CjDG,KALrCO,wBAAAA,GAA2BR,QAKUC,CALDI,UAKCJ,EAAAA,cAAAA,CAAAA;AAAK;AA8DtD;;;AAIsCN,cAlEjBc,mBAAAA,SAA4BR,KAAAA,CAkEXN;EAK1BC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAkB,YAAA,EAAA,MAAA,EAAA;EA+DNgB,WAAAA,CAAAA,KAAAA,EAnIDJ,wBAmI0B;EAAGK,UAAAA,CAAAA,CAAAA,EAAAA,6CAAAA;EAAKC,iBAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAOC,SAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAQC,KAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkBL;;;;;EAAkCD,OAAAA,aAAAA,CAAAA,KAAAA,EAzH5FjB,uBAyH4FiB,EAAAA,CAAAA,EAAAA,IAAAA;EAAO;;;;;;yCAlHxFN;;MAEnCE;;;;;;;;6BAQuBP,cAAcW;;;;;;wCAMHjB;;;;;;;;;;;6BAWXA,kCAAkCc,iCAAiCT;;;;;;;;;;8BAUlEJ,mCAAmCD,kCAAkCc,iCAAiCL,YAAYO;;;;;KAKtIE,+BAAAA;;OAEHjB;;UAEGD,0BAA0BE;;;;;UAK1BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DYgB,yBAAAA;;;;;GAAkED,kCAAkCD,QAAQP;SACzHJ;GAASkB,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
@@ -5,7 +5,7 @@ import { StructuredChatOutputParserWithRetries } from "./outputParser.js";
5
5
  import { BaseMessagePromptTemplate, BasePromptTemplate, ChatPromptTemplate } from "@langchain/core/prompts";
6
6
  import { StructuredToolInterface } from "@langchain/core/tools";
7
7
  import { BaseLanguageModelInterface, ToolDefinition } from "@langchain/core/language_models/base";
8
- import * as _langchain_core_agents5 from "@langchain/core/agents";
8
+ import * as _langchain_core_agents1 from "@langchain/core/agents";
9
9
  import { AgentStep } from "@langchain/core/agents";
10
10
 
11
11
  //#region src/agents/structured_chat/index.d.ts
@@ -176,7 +176,7 @@ declare function createStructuredChatAgent({
176
176
  streamRunnable
177
177
  }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{
178
178
  steps: AgentStep[];
179
- }, _langchain_core_agents5.AgentAction | _langchain_core_agents5.AgentFinish>>;
179
+ }, _langchain_core_agents1.AgentAction | _langchain_core_agents1.AgentFinish>>;
180
180
  //#endregion
181
181
  export { CreateStructuredChatAgentParams, StructuredChatAgent, StructuredChatAgentInput, StructuredChatCreatePromptArgs, createStructuredChatAgent };
182
182
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseLanguageModelInterface","ToolDefinition","BasePromptTemplate","BaseMessagePromptTemplate","ChatPromptTemplate","AgentStep","Optional","Agent","AgentArgs","AgentRunnableSequence","OutputParserArgs","AgentInput","StructuredChatOutputParserWithRetries","StructuredChatCreatePromptArgs","StructuredChatAgentInput","StructuredChatAgent","Promise","CreateStructuredChatAgentParams","createStructuredChatAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents5","AgentAction","AgentFinish"],"sources":["../../../src/agents/structured_chat/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { type BaseLanguageModelInterface, type ToolDefinition } from \"@langchain/core/language_models/base\";\nimport type { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessagePromptTemplate, ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { Optional } from \"../../types/type-utils.js\";\nimport { Agent, AgentArgs, AgentRunnableSequence, OutputParserArgs } from \"../agent.js\";\nimport { AgentInput } from \"../types.js\";\nimport { StructuredChatOutputParserWithRetries } from \"./outputParser.js\";\n/**\n * Interface for arguments used to create a prompt for a\n * StructuredChatAgent.\n */\nexport interface StructuredChatCreatePromptArgs {\n /** String to put after the list of tools. */\n suffix?: string;\n /** String to put before the list of tools. */\n prefix?: string;\n /** String to use directly as the human message template. */\n humanMessageTemplate?: string;\n /** List of input variables the final prompt will expect. */\n inputVariables?: string[];\n /** List of historical prompts from memory. */\n memoryPrompts?: BaseMessagePromptTemplate[];\n}\n/**\n * Type for input data for creating a StructuredChatAgent, with the\n * 'outputParser' property made optional.\n */\nexport type StructuredChatAgentInput = Optional<AgentInput, \"outputParser\">;\n/**\n * Agent that interoperates with Structured Tools using React logic.\n * @augments Agent\n */\nexport declare class StructuredChatAgent extends Agent {\n static lc_name(): string;\n lc_namespace: string[];\n constructor(input: StructuredChatAgentInput);\n _agentType(): \"structured-chat-zero-shot-react-description\";\n observationPrefix(): string;\n llmPrefix(): string;\n _stop(): string[];\n /**\n * Validates that all provided tools have a description. Throws an error\n * if any tool lacks a description.\n * @param tools Array of StructuredTool instances to validate.\n */\n static validateTools(tools: StructuredToolInterface[]): void;\n /**\n * Returns a default output parser for the StructuredChatAgent. If an LLM\n * is provided, it creates an output parser with retry logic from the LLM.\n * @param fields Optional fields to customize the output parser. Can include an LLM and a list of tool names.\n * @returns An instance of StructuredChatOutputParserWithRetries.\n */\n static getDefaultOutputParser(fields?: OutputParserArgs & {\n toolNames: string[];\n }): StructuredChatOutputParserWithRetries;\n /**\n * Constructs the agent's scratchpad from a list of steps. If the agent's\n * scratchpad is not empty, it prepends a message indicating that the\n * agent has not seen any previous work.\n * @param steps Array of AgentStep instances to construct the scratchpad from.\n * @returns A Promise that resolves to a string representing the agent's scratchpad.\n */\n constructScratchPad(steps: AgentStep[]): Promise<string>;\n /**\n * Creates a string representation of the schemas of the provided tools.\n * @param tools Array of StructuredTool instances to create the schemas string from.\n * @returns A string representing the schemas of the provided tools.\n */\n static createToolSchemasString(tools: StructuredToolInterface[]): string;\n /**\n * Create prompt in the style of the agent.\n *\n * @param tools - List of tools the agent will have access to, used to format the prompt.\n * @param args - Arguments to create the prompt with.\n * @param args.suffix - String to put after the list of tools.\n * @param args.prefix - String to put before the list of tools.\n * @param args.inputVariables List of input variables the final prompt will expect.\n * @param args.memoryPrompts List of historical prompts from memory.\n */\n static createPrompt(tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs): ChatPromptTemplate<any, any>;\n /**\n * Creates a StructuredChatAgent from an LLM and a list of tools.\n * Validates the tools, creates a prompt, and sets up an LLM chain for the\n * agent.\n * @param llm BaseLanguageModel instance to create the agent from.\n * @param tools Array of StructuredTool instances to create the agent from.\n * @param args Optional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.\n * @returns A new instance of StructuredChatAgent.\n */\n static fromLLMAndTools(llm: BaseLanguageModelInterface, tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs & AgentArgs): StructuredChatAgent;\n}\n/**\n * Params used by the createStructuredChatAgent function.\n */\nexport type CreateStructuredChatAgentParams = {\n /** LLM to use as the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: (StructuredToolInterface | ToolDefinition)[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent aimed at supporting tools with multiple inputs.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createStructuredChatAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/structured-chat-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/structured-chat-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createStructuredChatAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createStructuredChatAgent({ llm, tools, prompt, streamRunnable }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAaA;AAgBA;AAKqBgB,UArBJF,8BAAAA,CAqBuB;EAGjBC;EAUSf,MAAAA,CAAAA,EAAAA,MAAAA;EAOWW;EAEnCE,MAAAA,CAAAA,EAAAA,MAAAA;EAQuBP;EAAcW,oBAAAA,CAAAA,EAAAA,MAAAA;EAMHjB;EAWXA,cAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkCc;EAAiCT,aAAAA,CAAAA,EA1D9ED,yBA0D8EC,EAAAA;;;;;;AA/CjDG,KALrCO,wBAAAA,GAA2BR,QAKUC,CALDI,UAKCJ,EAAAA,cAAAA,CAAAA;AAAK;AA8DtD;;;AAIsCN,cAlEjBc,mBAAAA,SAA4BR,KAAAA,CAkEXN;EAK1BC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAkB,YAAA,EAAA,MAAA,EAAA;EA+DNgB,WAAAA,CAAAA,KAAAA,EAnIDJ,wBAmI0B;EAAGK,UAAAA,CAAAA,CAAAA,EAAAA,6CAAAA;EAAKC,iBAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAOC,SAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAQC,KAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkBL;;;;;EAAkCD,OAAAA,aAAAA,CAAAA,KAAAA,EAzH5FjB,uBAyH4FiB,EAAAA,CAAAA,EAAAA,IAAAA;EAAO;;;;;;yCAlHxFN;;MAEnCE;;;;;;;;6BAQuBP,cAAcW;;;;;;wCAMHjB;;;;;;;;;;;6BAWXA,kCAAkCc,iCAAiCT;;;;;;;;;;8BAUlEJ,mCAAmCD,kCAAkCc,iCAAiCL,YAAYO;;;;;KAKtIE,+BAAAA;;OAEHjB;;UAEGD,0BAA0BE;;;;;UAK1BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DYgB,yBAAAA;;;;;GAAkED,kCAAkCD,QAAQP;SACzHJ;GAASkB,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
1
+ {"version":3,"file":"index.d.ts","names":["StructuredToolInterface","BaseLanguageModelInterface","ToolDefinition","BasePromptTemplate","BaseMessagePromptTemplate","ChatPromptTemplate","AgentStep","Optional","Agent","AgentArgs","AgentRunnableSequence","OutputParserArgs","AgentInput","StructuredChatOutputParserWithRetries","StructuredChatCreatePromptArgs","StructuredChatAgentInput","StructuredChatAgent","Promise","CreateStructuredChatAgentParams","createStructuredChatAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents1","AgentAction","AgentFinish"],"sources":["../../../src/agents/structured_chat/index.d.ts"],"sourcesContent":["import type { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { type BaseLanguageModelInterface, type ToolDefinition } from \"@langchain/core/language_models/base\";\nimport type { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessagePromptTemplate, ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { AgentStep } from \"@langchain/core/agents\";\nimport { Optional } from \"../../types/type-utils.js\";\nimport { Agent, AgentArgs, AgentRunnableSequence, OutputParserArgs } from \"../agent.js\";\nimport { AgentInput } from \"../types.js\";\nimport { StructuredChatOutputParserWithRetries } from \"./outputParser.js\";\n/**\n * Interface for arguments used to create a prompt for a\n * StructuredChatAgent.\n */\nexport interface StructuredChatCreatePromptArgs {\n /** String to put after the list of tools. */\n suffix?: string;\n /** String to put before the list of tools. */\n prefix?: string;\n /** String to use directly as the human message template. */\n humanMessageTemplate?: string;\n /** List of input variables the final prompt will expect. */\n inputVariables?: string[];\n /** List of historical prompts from memory. */\n memoryPrompts?: BaseMessagePromptTemplate[];\n}\n/**\n * Type for input data for creating a StructuredChatAgent, with the\n * 'outputParser' property made optional.\n */\nexport type StructuredChatAgentInput = Optional<AgentInput, \"outputParser\">;\n/**\n * Agent that interoperates with Structured Tools using React logic.\n * @augments Agent\n */\nexport declare class StructuredChatAgent extends Agent {\n static lc_name(): string;\n lc_namespace: string[];\n constructor(input: StructuredChatAgentInput);\n _agentType(): \"structured-chat-zero-shot-react-description\";\n observationPrefix(): string;\n llmPrefix(): string;\n _stop(): string[];\n /**\n * Validates that all provided tools have a description. Throws an error\n * if any tool lacks a description.\n * @param tools Array of StructuredTool instances to validate.\n */\n static validateTools(tools: StructuredToolInterface[]): void;\n /**\n * Returns a default output parser for the StructuredChatAgent. If an LLM\n * is provided, it creates an output parser with retry logic from the LLM.\n * @param fields Optional fields to customize the output parser. Can include an LLM and a list of tool names.\n * @returns An instance of StructuredChatOutputParserWithRetries.\n */\n static getDefaultOutputParser(fields?: OutputParserArgs & {\n toolNames: string[];\n }): StructuredChatOutputParserWithRetries;\n /**\n * Constructs the agent's scratchpad from a list of steps. If the agent's\n * scratchpad is not empty, it prepends a message indicating that the\n * agent has not seen any previous work.\n * @param steps Array of AgentStep instances to construct the scratchpad from.\n * @returns A Promise that resolves to a string representing the agent's scratchpad.\n */\n constructScratchPad(steps: AgentStep[]): Promise<string>;\n /**\n * Creates a string representation of the schemas of the provided tools.\n * @param tools Array of StructuredTool instances to create the schemas string from.\n * @returns A string representing the schemas of the provided tools.\n */\n static createToolSchemasString(tools: StructuredToolInterface[]): string;\n /**\n * Create prompt in the style of the agent.\n *\n * @param tools - List of tools the agent will have access to, used to format the prompt.\n * @param args - Arguments to create the prompt with.\n * @param args.suffix - String to put after the list of tools.\n * @param args.prefix - String to put before the list of tools.\n * @param args.inputVariables List of input variables the final prompt will expect.\n * @param args.memoryPrompts List of historical prompts from memory.\n */\n static createPrompt(tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs): ChatPromptTemplate<any, any>;\n /**\n * Creates a StructuredChatAgent from an LLM and a list of tools.\n * Validates the tools, creates a prompt, and sets up an LLM chain for the\n * agent.\n * @param llm BaseLanguageModel instance to create the agent from.\n * @param tools Array of StructuredTool instances to create the agent from.\n * @param args Optional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.\n * @returns A new instance of StructuredChatAgent.\n */\n static fromLLMAndTools(llm: BaseLanguageModelInterface, tools: StructuredToolInterface[], args?: StructuredChatCreatePromptArgs & AgentArgs): StructuredChatAgent;\n}\n/**\n * Params used by the createStructuredChatAgent function.\n */\nexport type CreateStructuredChatAgentParams = {\n /** LLM to use as the agent. */\n llm: BaseLanguageModelInterface;\n /** Tools this agent has access to. */\n tools: (StructuredToolInterface | ToolDefinition)[];\n /**\n * The prompt to use. Must have input keys for\n * `tools`, `tool_names`, and `agent_scratchpad`.\n */\n prompt: BasePromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent aimed at supporting tools with multiple inputs.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n *\n * @example\n * ```typescript\n * import { AgentExecutor, createStructuredChatAgent } from \"langchain/agents\";\n * import { pull } from \"langchain/hub\";\n * import type { ChatPromptTemplate } from \"@langchain/core/prompts\";\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * import { ChatOpenAI } from \"@langchain/openai\";\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * // Get the prompt to use - you can modify this!\n * // If you want to see the prompt in full, you can at:\n * // https://smith.langchain.com/hub/hwchase17/structured-chat-agent\n * const prompt = await pull<ChatPromptTemplate>(\n * \"hwchase17/structured-chat-agent\"\n * );\n *\n * const llm = new ChatOpenAI({\n * temperature: 0,\n * model: \"gpt-3.5-turbo-1106\",\n * });\n *\n * const agent = await createStructuredChatAgent({\n * llm,\n * tools,\n * prompt,\n * });\n *\n * const agentExecutor = new AgentExecutor({\n * agent,\n * tools,\n * });\n *\n * const result = await agentExecutor.invoke({\n * input: \"what is LangChain?\",\n * });\n *\n * // With chat history\n * const result2 = await agentExecutor.invoke({\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage(\"hi! my name is cob\"),\n * new AIMessage(\"Hello Cob! How can I assist you today?\"),\n * ],\n * });\n * ```\n */\nexport declare function createStructuredChatAgent({ llm, tools, prompt, streamRunnable }: CreateStructuredChatAgentParams): Promise<AgentRunnableSequence<{\n steps: AgentStep[];\n}, import(\"@langchain/core/agents\").AgentAction | import(\"@langchain/core/agents\").AgentFinish>>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAaA;AAgBA;AAKqBgB,UArBJF,8BAAAA,CAqBuB;EAGjBC;EAUSf,MAAAA,CAAAA,EAAAA,MAAAA;EAOWW;EAEnCE,MAAAA,CAAAA,EAAAA,MAAAA;EAQuBP;EAAcW,oBAAAA,CAAAA,EAAAA,MAAAA;EAMHjB;EAWXA,cAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkCc;EAAiCT,aAAAA,CAAAA,EA1D9ED,yBA0D8EC,EAAAA;;;;;;AA/CjDG,KALrCO,wBAAAA,GAA2BR,QAKUC,CALDI,UAKCJ,EAAAA,cAAAA,CAAAA;AAAK;AA8DtD;;;AAIsCN,cAlEjBc,mBAAAA,SAA4BR,KAAAA,CAkEXN;EAK1BC,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAkB,YAAA,EAAA,MAAA,EAAA;EA+DNgB,WAAAA,CAAAA,KAAAA,EAnIDJ,wBAmI0B;EAAGK,UAAAA,CAAAA,CAAAA,EAAAA,6CAAAA;EAAKC,iBAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAOC,SAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAQC,KAAAA,CAAAA,CAAAA,EAAAA,MAAAA,EAAAA;EAAkBL;;;;;EAAkCD,OAAAA,aAAAA,CAAAA,KAAAA,EAzH5FjB,uBAyH4FiB,EAAAA,CAAAA,EAAAA,IAAAA;EAAO;;;;;;yCAlHxFN;;MAEnCE;;;;;;;;6BAQuBP,cAAcW;;;;;;wCAMHjB;;;;;;;;;;;6BAWXA,kCAAkCc,iCAAiCT;;;;;;;;;;8BAUlEJ,mCAAmCD,kCAAkCc,iCAAiCL,YAAYO;;;;;KAKtIE,+BAAAA;;OAEHjB;;UAEGD,0BAA0BE;;;;;UAK1BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DYgB,yBAAAA;;;;;GAAkED,kCAAkCD,QAAQP;SACzHJ;GAASkB,uBAAAA,CACgBC,WAAAA,GAAWD,uBAAAA,CAAoCE"}
@@ -1,6 +1,6 @@
1
1
  import { ToolsAgentStep } from "./output_parser.cjs";
2
2
  import { AgentRunnableSequence } from "../agent.cjs";
3
- import * as _langchain_core_agents5 from "@langchain/core/agents";
3
+ import * as _langchain_core_agents1 from "@langchain/core/agents";
4
4
  import { ChatPromptTemplate } from "@langchain/core/prompts";
5
5
  import { LanguageModelLike, ToolDefinition } from "@langchain/core/language_models/base";
6
6
  import { StructuredToolInterface } from "@langchain/core/tools";
@@ -83,7 +83,7 @@ declare function createToolCallingAgent({
83
83
  streamRunnable
84
84
  }: CreateToolCallingAgentParams): AgentRunnableSequence<{
85
85
  steps: ToolsAgentStep[];
86
- }, _langchain_core_agents5.AgentFinish | _langchain_core_agents5.AgentAction[]>;
86
+ }, _langchain_core_agents1.AgentFinish | _langchain_core_agents1.AgentAction[]>;
87
87
  //#endregion
88
88
  export { CreateToolCallingAgentParams, createToolCallingAgent };
89
89
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["ChatPromptTemplate","StructuredToolInterface","LanguageModelLike","ToolDefinition","AgentRunnableSequence","ToolsAgentStep","CreateToolCallingAgentParams","createToolCallingAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents5","AgentFinish","AgentAction"],"sources":["../../../src/agents/tool_calling/index.d.ts"],"sourcesContent":["import { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { LanguageModelLike, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nimport { ToolsAgentStep } from \"./output_parser.js\";\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateToolCallingAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: LanguageModelLike;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses tools.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n * @example\n * ```typescript\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n * import { ChatPromptTemplate, MessagesPlaceholder } from \"@langchain/core/prompts\";\n * import { AgentExecutor, createToolCallingAgent } from \"langchain/agents\";\n *\n * const prompt = ChatPromptTemplate.fromMessages(\n * [\n * [\"system\", \"You are a helpful assistant\"],\n * [\"placeholder\", \"{chat_history}\"],\n * [\"human\", \"{input}\"],\n * [\"placeholder\", \"{agent_scratchpad}\"],\n * ]\n * );\n *\n *\n * const llm = new ChatAnthropic({\n * modelName: \"claude-3-opus-20240229\",\n * temperature: 0,\n * });\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * const agent = createToolCallingAgent({ llm, tools, prompt });\n *\n * const agentExecutor = new AgentExecutor({ agent, tools });\n *\n * const result = await agentExecutor.invoke({input: \"what is LangChain?\"});\n *\n * // Using with chat history\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * const result2 = await agentExecutor.invoke(\n * {\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage({content: \"hi! my name is bob\"}),\n * new AIMessage({content: \"Hello Bob! How can I assist you today?\"}),\n * ],\n * }\n * );\n * ```\n */\nexport declare function createToolCallingAgent({ llm, tools, prompt, streamRunnable }: CreateToolCallingAgentParams): AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;AAQYM,KAAAA,4BAAAA,GAA4B;EAM/BJ;;;;AAIqB;EAyDNK,GAAAA,EA7DfL,iBA6DeK;EAAyBC;EAAKC,KAAAA,EA3D3CR,uBA2D2CQ,EAAAA,GA3DfN,cA2DeM,EAAAA;EAAOC;EAAQC,MAAAA,EAzDzDX,kBAyDyDW;EAAkBL;;;;EAA+BF,cAAAA,CAAAA,EAAAA,OAAAA;AAAqB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnHG,sBAAAA;;;;;GAA+DD,+BAA+BF;SAC3GC;GAAcO,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
1
+ {"version":3,"file":"index.d.cts","names":["ChatPromptTemplate","StructuredToolInterface","LanguageModelLike","ToolDefinition","AgentRunnableSequence","ToolsAgentStep","CreateToolCallingAgentParams","createToolCallingAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents1","AgentFinish","AgentAction"],"sources":["../../../src/agents/tool_calling/index.d.ts"],"sourcesContent":["import { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { LanguageModelLike, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nimport { ToolsAgentStep } from \"./output_parser.js\";\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateToolCallingAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: LanguageModelLike;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses tools.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n * @example\n * ```typescript\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n * import { ChatPromptTemplate, MessagesPlaceholder } from \"@langchain/core/prompts\";\n * import { AgentExecutor, createToolCallingAgent } from \"langchain/agents\";\n *\n * const prompt = ChatPromptTemplate.fromMessages(\n * [\n * [\"system\", \"You are a helpful assistant\"],\n * [\"placeholder\", \"{chat_history}\"],\n * [\"human\", \"{input}\"],\n * [\"placeholder\", \"{agent_scratchpad}\"],\n * ]\n * );\n *\n *\n * const llm = new ChatAnthropic({\n * modelName: \"claude-3-opus-20240229\",\n * temperature: 0,\n * });\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * const agent = createToolCallingAgent({ llm, tools, prompt });\n *\n * const agentExecutor = new AgentExecutor({ agent, tools });\n *\n * const result = await agentExecutor.invoke({input: \"what is LangChain?\"});\n *\n * // Using with chat history\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * const result2 = await agentExecutor.invoke(\n * {\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage({content: \"hi! my name is bob\"}),\n * new AIMessage({content: \"Hello Bob! How can I assist you today?\"}),\n * ],\n * }\n * );\n * ```\n */\nexport declare function createToolCallingAgent({ llm, tools, prompt, streamRunnable }: CreateToolCallingAgentParams): AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;AAQYM,KAAAA,4BAAAA,GAA4B;EAM/BJ;;;;AAIqB;EAyDNK,GAAAA,EA7DfL,iBA6DeK;EAAyBC;EAAKC,KAAAA,EA3D3CR,uBA2D2CQ,EAAAA,GA3DfN,cA2DeM,EAAAA;EAAOC;EAAQC,MAAAA,EAzDzDX,kBAyDyDW;EAAkBL;;;;EAA+BF,cAAAA,CAAAA,EAAAA,OAAAA;AAAqB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnHG,sBAAAA;;;;;GAA+DD,+BAA+BF;SAC3GC;GAAcO,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
@@ -3,7 +3,7 @@ import { AgentRunnableSequence } from "../agent.js";
3
3
  import { ChatPromptTemplate } from "@langchain/core/prompts";
4
4
  import { StructuredToolInterface } from "@langchain/core/tools";
5
5
  import { LanguageModelLike, ToolDefinition } from "@langchain/core/language_models/base";
6
- import * as _langchain_core_agents3 from "@langchain/core/agents";
6
+ import * as _langchain_core_agents5 from "@langchain/core/agents";
7
7
 
8
8
  //#region src/agents/tool_calling/index.d.ts
9
9
  /**
@@ -83,7 +83,7 @@ declare function createToolCallingAgent({
83
83
  streamRunnable
84
84
  }: CreateToolCallingAgentParams): AgentRunnableSequence<{
85
85
  steps: ToolsAgentStep[];
86
- }, _langchain_core_agents3.AgentFinish | _langchain_core_agents3.AgentAction[]>;
86
+ }, _langchain_core_agents5.AgentFinish | _langchain_core_agents5.AgentAction[]>;
87
87
  //#endregion
88
88
  export { CreateToolCallingAgentParams, createToolCallingAgent };
89
89
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["ChatPromptTemplate","StructuredToolInterface","LanguageModelLike","ToolDefinition","AgentRunnableSequence","ToolsAgentStep","CreateToolCallingAgentParams","createToolCallingAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents3","AgentFinish","AgentAction"],"sources":["../../../src/agents/tool_calling/index.d.ts"],"sourcesContent":["import { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { LanguageModelLike, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nimport { ToolsAgentStep } from \"./output_parser.js\";\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateToolCallingAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: LanguageModelLike;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses tools.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n * @example\n * ```typescript\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n * import { ChatPromptTemplate, MessagesPlaceholder } from \"@langchain/core/prompts\";\n * import { AgentExecutor, createToolCallingAgent } from \"langchain/agents\";\n *\n * const prompt = ChatPromptTemplate.fromMessages(\n * [\n * [\"system\", \"You are a helpful assistant\"],\n * [\"placeholder\", \"{chat_history}\"],\n * [\"human\", \"{input}\"],\n * [\"placeholder\", \"{agent_scratchpad}\"],\n * ]\n * );\n *\n *\n * const llm = new ChatAnthropic({\n * modelName: \"claude-3-opus-20240229\",\n * temperature: 0,\n * });\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * const agent = createToolCallingAgent({ llm, tools, prompt });\n *\n * const agentExecutor = new AgentExecutor({ agent, tools });\n *\n * const result = await agentExecutor.invoke({input: \"what is LangChain?\"});\n *\n * // Using with chat history\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * const result2 = await agentExecutor.invoke(\n * {\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage({content: \"hi! my name is bob\"}),\n * new AIMessage({content: \"Hello Bob! How can I assist you today?\"}),\n * ],\n * }\n * );\n * ```\n */\nexport declare function createToolCallingAgent({ llm, tools, prompt, streamRunnable }: CreateToolCallingAgentParams): AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;AAQYM,KAAAA,4BAAAA,GAA4B;EAM/BJ;;;;AAIqB;EAyDNK,GAAAA,EA7DfL,iBA6DeK;EAAyBC;EAAKC,KAAAA,EA3D3CR,uBA2D2CQ,EAAAA,GA3DfN,cA2DeM,EAAAA;EAAOC;EAAQC,MAAAA,EAzDzDX,kBAyDyDW;EAAkBL;;;;EAA+BF,cAAAA,CAAAA,EAAAA,OAAAA;AAAqB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnHG,sBAAAA;;;;;GAA+DD,+BAA+BF;SAC3GC;GAAcO,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
1
+ {"version":3,"file":"index.d.ts","names":["ChatPromptTemplate","StructuredToolInterface","LanguageModelLike","ToolDefinition","AgentRunnableSequence","ToolsAgentStep","CreateToolCallingAgentParams","createToolCallingAgent","llm","tools","prompt","streamRunnable","_langchain_core_agents5","AgentFinish","AgentAction"],"sources":["../../../src/agents/tool_calling/index.d.ts"],"sourcesContent":["import { ChatPromptTemplate } from \"@langchain/core/prompts\";\nimport { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { LanguageModelLike, ToolDefinition } from \"@langchain/core/language_models/base\";\nimport { AgentRunnableSequence } from \"../agent.js\";\nimport { ToolsAgentStep } from \"./output_parser.js\";\n/**\n * Params used by the createOpenAIToolsAgent function.\n */\nexport type CreateToolCallingAgentParams = {\n /**\n * LLM to use as the agent. Should work with OpenAI tool calling,\n * so must either be an OpenAI model that supports that or a wrapper of\n * a different model that adds in equivalent support.\n */\n llm: LanguageModelLike;\n /** Tools this agent has access to. */\n tools: StructuredToolInterface[] | ToolDefinition[];\n /** The prompt to use, must have an input key of `agent_scratchpad`. */\n prompt: ChatPromptTemplate;\n /**\n * Whether to invoke the underlying model in streaming mode,\n * allowing streaming of intermediate steps. Defaults to true.\n */\n streamRunnable?: boolean;\n};\n/**\n * Create an agent that uses tools.\n * @param params Params required to create the agent. Includes an LLM, tools, and prompt.\n * @returns A runnable sequence representing an agent. It takes as input all the same input\n * variables as the prompt passed in does. It returns as output either an\n * AgentAction or AgentFinish.\n * @example\n * ```typescript\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n * import { ChatPromptTemplate, MessagesPlaceholder } from \"@langchain/core/prompts\";\n * import { AgentExecutor, createToolCallingAgent } from \"langchain/agents\";\n *\n * const prompt = ChatPromptTemplate.fromMessages(\n * [\n * [\"system\", \"You are a helpful assistant\"],\n * [\"placeholder\", \"{chat_history}\"],\n * [\"human\", \"{input}\"],\n * [\"placeholder\", \"{agent_scratchpad}\"],\n * ]\n * );\n *\n *\n * const llm = new ChatAnthropic({\n * modelName: \"claude-3-opus-20240229\",\n * temperature: 0,\n * });\n *\n * // Define the tools the agent will have access to.\n * const tools = [...];\n *\n * const agent = createToolCallingAgent({ llm, tools, prompt });\n *\n * const agentExecutor = new AgentExecutor({ agent, tools });\n *\n * const result = await agentExecutor.invoke({input: \"what is LangChain?\"});\n *\n * // Using with chat history\n * import { AIMessage, HumanMessage } from \"@langchain/core/messages\";\n *\n * const result2 = await agentExecutor.invoke(\n * {\n * input: \"what's my name?\",\n * chat_history: [\n * new HumanMessage({content: \"hi! my name is bob\"}),\n * new AIMessage({content: \"Hello Bob! How can I assist you today?\"}),\n * ],\n * }\n * );\n * ```\n */\nexport declare function createToolCallingAgent({ llm, tools, prompt, streamRunnable }: CreateToolCallingAgentParams): AgentRunnableSequence<{\n steps: ToolsAgentStep[];\n}, import(\"@langchain/core/agents\").AgentFinish | import(\"@langchain/core/agents\").AgentAction[]>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;;;;;AAQYM,KAAAA,4BAAAA,GAA4B;EAM/BJ;;;;AAIqB;EAyDNK,GAAAA,EA7DfL,iBA6DeK;EAAyBC;EAAKC,KAAAA,EA3D3CR,uBA2D2CQ,EAAAA,GA3DfN,cA2DeM,EAAAA;EAAOC;EAAQC,MAAAA,EAzDzDX,kBAyDyDW;EAAkBL;;;;EAA+BF,cAAAA,CAAAA,EAAAA,OAAAA;AAAqB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnHG,sBAAAA;;;;;GAA+DD,+BAA+BF;SAC3GC;GAAcO,uBAAAA,CACWC,WAAAA,GAAWD,uBAAAA,CAAoCE,WAAAA"}
@@ -1,5 +1,5 @@
1
1
  import { BaseChatMemory, BaseChatMemoryInput } from "../../../memory/chat_memory.cjs";
2
- import * as _langchain_core_messages0 from "@langchain/core/messages";
2
+ import * as _langchain_core_messages2 from "@langchain/core/messages";
3
3
  import { InputValues, MemoryVariables, OutputValues } from "@langchain/core/memory";
4
4
  import { ChatOpenAI } from "@langchain/openai";
5
5
 
@@ -37,7 +37,7 @@ declare class OpenAIAgentTokenBufferMemory extends BaseChatMemory {
37
37
  * Retrieves the messages from the chat history.
38
38
  * @returns Promise that resolves with the messages from the chat history.
39
39
  */
40
- getMessages(): Promise<_langchain_core_messages0.BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[]>;
40
+ getMessages(): Promise<_langchain_core_messages2.BaseMessage<_langchain_core_messages2.MessageStructure<_langchain_core_messages2.MessageToolSet>, _langchain_core_messages2.MessageType>[]>;
41
41
  /**
42
42
  * Loads memory variables from the input values.
43
43
  * @param _values Input values.
@@ -1 +1 @@
1
- {"version":3,"file":"token_buffer_memory.d.cts","names":["ChatOpenAI","InputValues","MemoryVariables","OutputValues","BaseChatMemory","BaseChatMemoryInput","OpenAIAgentTokenBufferMemoryFields","OpenAIAgentTokenBufferMemory","_langchain_core_messages0","MessageToolSet","MessageStructure","MessageType","BaseMessage","Promise"],"sources":["../../../../src/agents/toolkits/conversational_retrieval/token_buffer_memory.d.ts"],"sourcesContent":["import { ChatOpenAI } from \"@langchain/openai\";\nimport { InputValues, MemoryVariables, OutputValues } from \"@langchain/core/memory\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"../../../memory/chat_memory.js\";\n/**\n * Type definition for the fields required to initialize an instance of\n * OpenAIAgentTokenBufferMemory.\n */\nexport type OpenAIAgentTokenBufferMemoryFields = BaseChatMemoryInput & {\n llm: ChatOpenAI;\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n maxTokenLimit?: number;\n returnMessages?: boolean;\n outputKey?: string;\n intermediateStepsKey?: string;\n};\n/**\n * Memory used to save agent output and intermediate steps.\n */\nexport declare class OpenAIAgentTokenBufferMemory extends BaseChatMemory {\n humanPrefix: string;\n aiPrefix: string;\n llm: ChatOpenAI;\n memoryKey: string;\n maxTokenLimit: number;\n returnMessages: boolean;\n outputKey: string;\n intermediateStepsKey: string;\n constructor(fields: OpenAIAgentTokenBufferMemoryFields);\n get memoryKeys(): string[];\n /**\n * Retrieves the messages from the chat history.\n * @returns Promise that resolves with the messages from the chat history.\n */\n getMessages(): Promise<import(\"@langchain/core/messages\").BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[]>;\n /**\n * Loads memory variables from the input values.\n * @param _values Input values.\n * @returns Promise that resolves with the loaded memory variables.\n */\n loadMemoryVariables(_values: InputValues): Promise<MemoryVariables>;\n /**\n * Saves the context of the chat, including user input, AI output, and\n * intermediate steps. Prunes the chat history if the total token count\n * exceeds the maximum limit.\n * @param inputValues Input values.\n * @param outputValues Output values.\n * @returns Promise that resolves when the context has been saved.\n */\n saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>;\n}\n//# sourceMappingURL=token_buffer_memory.d.ts.map"],"mappings":";;;;;;;;;;AAOA;AAaqBO,KAbTD,kCAAAA,GAAqCD,mBAaA,GAAA;EAGxCL,GAAAA,EAfAA,UAeAA;EAMeM,WAAAA,CAAAA,EAAAA,MAAAA;EAAkCE,QAAAA,CAAAA,EAAAA,MAAAA;EAMqHA,SAAAA,CAAAA,EAAAA,MAAAA;EAAlDA,aAAAA,CAAAA,EAAAA,MAAAA;EAAmGA,cAAAA,CAAAA,EAAAA,OAAlKI;EAA3CC,SAAAA,CAAAA,EAAAA,MAAAA;EAMcZ,oBAAAA,CAAAA,EAAAA,MAAAA;CAAsBC;;;;AASgBW,cA9BlDN,4BAAAA,SAAqCH,cAAAA,CA8BaS;EA9BbT,WAAAA,EAAAA,MAAAA;EAAc,QAAA,EAAA,MAAA;OAG/DJ;;;;;;sBAMeM;;;;;;iBAMLO,QAA6ML,yBAAAA,CAAlKI,YAAiHJ,yBAAAA,CAAlEE,iBANnDF,yBAAAA,CAMuGC,cAAAA,GAApCD,yBAAAA,CAAwFG,WAAAA;;;;;;+BAMpLV,cAAcY,QAAQX;;;;;;;;;2BAS1BD,2BAA2BE,eAAeU"}
1
+ {"version":3,"file":"token_buffer_memory.d.cts","names":["ChatOpenAI","InputValues","MemoryVariables","OutputValues","BaseChatMemory","BaseChatMemoryInput","OpenAIAgentTokenBufferMemoryFields","OpenAIAgentTokenBufferMemory","_langchain_core_messages2","MessageToolSet","MessageStructure","MessageType","BaseMessage","Promise"],"sources":["../../../../src/agents/toolkits/conversational_retrieval/token_buffer_memory.d.ts"],"sourcesContent":["import { ChatOpenAI } from \"@langchain/openai\";\nimport { InputValues, MemoryVariables, OutputValues } from \"@langchain/core/memory\";\nimport { BaseChatMemory, BaseChatMemoryInput } from \"../../../memory/chat_memory.js\";\n/**\n * Type definition for the fields required to initialize an instance of\n * OpenAIAgentTokenBufferMemory.\n */\nexport type OpenAIAgentTokenBufferMemoryFields = BaseChatMemoryInput & {\n llm: ChatOpenAI;\n humanPrefix?: string;\n aiPrefix?: string;\n memoryKey?: string;\n maxTokenLimit?: number;\n returnMessages?: boolean;\n outputKey?: string;\n intermediateStepsKey?: string;\n};\n/**\n * Memory used to save agent output and intermediate steps.\n */\nexport declare class OpenAIAgentTokenBufferMemory extends BaseChatMemory {\n humanPrefix: string;\n aiPrefix: string;\n llm: ChatOpenAI;\n memoryKey: string;\n maxTokenLimit: number;\n returnMessages: boolean;\n outputKey: string;\n intermediateStepsKey: string;\n constructor(fields: OpenAIAgentTokenBufferMemoryFields);\n get memoryKeys(): string[];\n /**\n * Retrieves the messages from the chat history.\n * @returns Promise that resolves with the messages from the chat history.\n */\n getMessages(): Promise<import(\"@langchain/core/messages\").BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[]>;\n /**\n * Loads memory variables from the input values.\n * @param _values Input values.\n * @returns Promise that resolves with the loaded memory variables.\n */\n loadMemoryVariables(_values: InputValues): Promise<MemoryVariables>;\n /**\n * Saves the context of the chat, including user input, AI output, and\n * intermediate steps. Prunes the chat history if the total token count\n * exceeds the maximum limit.\n * @param inputValues Input values.\n * @param outputValues Output values.\n * @returns Promise that resolves when the context has been saved.\n */\n saveContext(inputValues: InputValues, outputValues: OutputValues): Promise<void>;\n}\n//# sourceMappingURL=token_buffer_memory.d.ts.map"],"mappings":";;;;;;;;;;AAOA;AAaqBO,KAbTD,kCAAAA,GAAqCD,mBAaA,GAAA;EAGxCL,GAAAA,EAfAA,UAeAA;EAMeM,WAAAA,CAAAA,EAAAA,MAAAA;EAAkCE,QAAAA,CAAAA,EAAAA,MAAAA;EAMqHA,SAAAA,CAAAA,EAAAA,MAAAA;EAAlDA,aAAAA,CAAAA,EAAAA,MAAAA;EAAmGA,cAAAA,CAAAA,EAAAA,OAAlKI;EAA3CC,SAAAA,CAAAA,EAAAA,MAAAA;EAMcZ,oBAAAA,CAAAA,EAAAA,MAAAA;CAAsBC;;;;AASgBW,cA9BlDN,4BAAAA,SAAqCH,cAAAA,CA8BaS;EA9BbT,WAAAA,EAAAA,MAAAA;EAAc,QAAA,EAAA,MAAA;OAG/DJ;;;;;;sBAMeM;;;;;;iBAMLO,QAA6ML,yBAAAA,CAAlKI,YAAiHJ,yBAAAA,CAAlEE,iBANnDF,yBAAAA,CAMuGC,cAAAA,GAApCD,yBAAAA,CAAwFG,WAAAA;;;;;;+BAMpLV,cAAcY,QAAQX;;;;;;;;;2BAS1BD,2BAA2BE,eAAeU"}
@@ -1,5 +1,5 @@
1
1
  import { ObjectTool } from "./schema.cjs";
2
- import * as _langchain_core_messages3 from "@langchain/core/messages";
2
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
3
3
  import { BaseMessage } from "@langchain/core/messages";
4
4
  import { PartialValues } from "@langchain/core/utils/types";
5
5
  import { BaseChatPromptTemplate, SerializedBasePromptTemplate } from "@langchain/core/prompts";
@@ -54,7 +54,7 @@ declare class AutoGPTPrompt extends BaseChatPromptTemplate implements AutoGPTPro
54
54
  memory: VectorStoreRetrieverInterface;
55
55
  messages: BaseMessage[];
56
56
  user_input: string;
57
- }): Promise<BaseMessage<_langchain_core_messages3.MessageStructure<_langchain_core_messages3.MessageToolSet>, _langchain_core_messages3.MessageType>[]>;
57
+ }): Promise<BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[]>;
58
58
  /**
59
59
  * This method is not implemented in the AutoGPTPrompt class and will
60
60
  * throw an error if called.
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.cts","names":["VectorStoreRetrieverInterface","BaseChatPromptTemplate","SerializedBasePromptTemplate","BaseMessage","PartialValues","ObjectTool","AutoGPTPromptInput","Promise","AutoGPTPrompt","goals","memory","previousMessages","user_input","_langchain_core_messages3","MessageToolSet","MessageStructure","MessageType"],"sources":["../../../src/experimental/autogpt/prompt.d.ts"],"sourcesContent":["import type { VectorStoreRetrieverInterface } from \"@langchain/core/vectorstores\";\nimport { BaseChatPromptTemplate, SerializedBasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { PartialValues } from \"@langchain/core/utils/types\";\nimport { ObjectTool } from \"./schema.js\";\n/**\n * Interface for the input parameters of the AutoGPTPrompt class.\n */\nexport interface AutoGPTPromptInput {\n aiName: string;\n aiRole: string;\n tools: ObjectTool[];\n tokenCounter: (text: string) => Promise<number>;\n sendTokenLimit?: number;\n}\n/**\n * Class used to generate prompts for the AutoGPT model. It takes into\n * account the AI's name, role, tools, token counter, and send token\n * limit. The class also handles the formatting of messages and the\n * construction of the full prompt.\n */\nexport declare class AutoGPTPrompt extends BaseChatPromptTemplate implements AutoGPTPromptInput {\n aiName: string;\n aiRole: string;\n tools: ObjectTool[];\n tokenCounter: (text: string) => Promise<number>;\n sendTokenLimit: number;\n constructor(fields: AutoGPTPromptInput);\n _getPromptType(): \"autogpt\";\n /**\n * Constructs the full prompt based on the provided goals.\n * @param goals An array of goals.\n * @returns The full prompt as a string.\n */\n constructFullPrompt(goals: string[]): string;\n /**\n * Formats the messages based on the provided parameters.\n * @param goals An array of goals.\n * @param memory A VectorStoreRetriever instance.\n * @param messages An array of previous messages.\n * @param user_input The user's input.\n * @returns An array of formatted messages.\n */\n formatMessages({ goals, memory, messages: previousMessages, user_input }: {\n goals: string[];\n memory: VectorStoreRetrieverInterface;\n messages: BaseMessage[];\n user_input: string;\n }): Promise<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[]>;\n /**\n * This method is not implemented in the AutoGPTPrompt class and will\n * throw an error if called.\n * @param _values Partial values.\n * @returns Throws an error.\n */\n partial(_values: PartialValues): Promise<BaseChatPromptTemplate>;\n serialize(): SerializedBasePromptTemplate;\n}\n//# sourceMappingURL=prompt.d.ts.map"],"mappings":";;;;;;;;;;;AAQiBM,UAAAA,kBAAAA,CAAkB;EAadE,MAAAA,EAAAA,MAAAA;EAGVH,MAAAA,EAAAA,MAAAA;EACyBE,KAAAA,EAdzBF,UAcyBE,EAAAA;EAEZD,YAAAA,EAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,GAfYC,OAeZD,CAAAA,MAAAA,CAAAA;EAgBHG,cAAAA,CAAAA,EAAAA,MAAAA;;;;;;;;AAK0DI,cA3B1DL,aAAAA,SAAsBP,sBAAAA,YAAkCK,kBA2B0FU,CAAAA;EAAvJb,MAAAA,EAAAA,MAAAA;EAARI,MAAAA,EAAAA,MAAAA;EAOaH,KAAAA,EA/BVC,UA+BUD,EAAAA;EAAwBH,YAAAA,EAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,GA9BTM,OA8BSN,CAAAA,MAAAA,CAAAA;EAARM,cAAAA,EAAAA,MAAAA;EACpBL,WAAAA,CAAAA,MAAAA,EA7BOI,kBA6BPJ;EAnC0BD,cAAAA,CAAAA,CAAAA,EAAAA,SAAAA;EAAkCK;AAAkB;;;;;;;;;;;;;;;;cAsBjDK;;;;YAE9BX;cACEG;;MAEVI,QAAQJ,YAAiHU,yBAAAA,CAAlEE,iBAFlCF,yBAAAA,CAEsFC,cAAAA,GAApCD,yBAAAA,CAAwFG,WAAAA;;;;;;;mBAOlJZ,gBAAgBG,QAAQN;eAC5BC"}
1
+ {"version":3,"file":"prompt.d.cts","names":["VectorStoreRetrieverInterface","BaseChatPromptTemplate","SerializedBasePromptTemplate","BaseMessage","PartialValues","ObjectTool","AutoGPTPromptInput","Promise","AutoGPTPrompt","goals","memory","previousMessages","user_input","_langchain_core_messages0","MessageToolSet","MessageStructure","MessageType"],"sources":["../../../src/experimental/autogpt/prompt.d.ts"],"sourcesContent":["import type { VectorStoreRetrieverInterface } from \"@langchain/core/vectorstores\";\nimport { BaseChatPromptTemplate, SerializedBasePromptTemplate } from \"@langchain/core/prompts\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { PartialValues } from \"@langchain/core/utils/types\";\nimport { ObjectTool } from \"./schema.js\";\n/**\n * Interface for the input parameters of the AutoGPTPrompt class.\n */\nexport interface AutoGPTPromptInput {\n aiName: string;\n aiRole: string;\n tools: ObjectTool[];\n tokenCounter: (text: string) => Promise<number>;\n sendTokenLimit?: number;\n}\n/**\n * Class used to generate prompts for the AutoGPT model. It takes into\n * account the AI's name, role, tools, token counter, and send token\n * limit. The class also handles the formatting of messages and the\n * construction of the full prompt.\n */\nexport declare class AutoGPTPrompt extends BaseChatPromptTemplate implements AutoGPTPromptInput {\n aiName: string;\n aiRole: string;\n tools: ObjectTool[];\n tokenCounter: (text: string) => Promise<number>;\n sendTokenLimit: number;\n constructor(fields: AutoGPTPromptInput);\n _getPromptType(): \"autogpt\";\n /**\n * Constructs the full prompt based on the provided goals.\n * @param goals An array of goals.\n * @returns The full prompt as a string.\n */\n constructFullPrompt(goals: string[]): string;\n /**\n * Formats the messages based on the provided parameters.\n * @param goals An array of goals.\n * @param memory A VectorStoreRetriever instance.\n * @param messages An array of previous messages.\n * @param user_input The user's input.\n * @returns An array of formatted messages.\n */\n formatMessages({ goals, memory, messages: previousMessages, user_input }: {\n goals: string[];\n memory: VectorStoreRetrieverInterface;\n messages: BaseMessage[];\n user_input: string;\n }): Promise<BaseMessage<import(\"@langchain/core/messages\").MessageStructure<import(\"@langchain/core/messages\").MessageToolSet>, import(\"@langchain/core/messages\").MessageType>[]>;\n /**\n * This method is not implemented in the AutoGPTPrompt class and will\n * throw an error if called.\n * @param _values Partial values.\n * @returns Throws an error.\n */\n partial(_values: PartialValues): Promise<BaseChatPromptTemplate>;\n serialize(): SerializedBasePromptTemplate;\n}\n//# sourceMappingURL=prompt.d.ts.map"],"mappings":";;;;;;;;;;;AAQiBM,UAAAA,kBAAAA,CAAkB;EAadE,MAAAA,EAAAA,MAAAA;EAGVH,MAAAA,EAAAA,MAAAA;EACyBE,KAAAA,EAdzBF,UAcyBE,EAAAA;EAEZD,YAAAA,EAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,GAfYC,OAeZD,CAAAA,MAAAA,CAAAA;EAgBHG,cAAAA,CAAAA,EAAAA,MAAAA;;;;;;;;AAK0DI,cA3B1DL,aAAAA,SAAsBP,sBAAAA,YAAkCK,kBA2B0FU,CAAAA;EAAvJb,MAAAA,EAAAA,MAAAA;EAARI,MAAAA,EAAAA,MAAAA;EAOaH,KAAAA,EA/BVC,UA+BUD,EAAAA;EAAwBH,YAAAA,EAAAA,CAAAA,IAAAA,EAAAA,MAAAA,EAAAA,GA9BTM,OA8BSN,CAAAA,MAAAA,CAAAA;EAARM,cAAAA,EAAAA,MAAAA;EACpBL,WAAAA,CAAAA,MAAAA,EA7BOI,kBA6BPJ;EAnC0BD,cAAAA,CAAAA,CAAAA,EAAAA,SAAAA;EAAkCK;AAAkB;;;;;;;;;;;;;;;;cAsBjDK;;;;YAE9BX;cACEG;;MAEVI,QAAQJ,YAAiHU,yBAAAA,CAAlEE,iBAFlCF,yBAAAA,CAEsFC,cAAAA,GAApCD,yBAAAA,CAAwFG,WAAAA;;;;;;;mBAOlJZ,gBAAgBG,QAAQN;eAC5BC"}
@@ -1 +1 @@
1
- {"version":3,"file":"custom_format.d.cts","names":["InputValues","ParsedFStringNode","PromptTemplate","PromptTemplateInput","TypedPromptInputValues","CustomFormatPromptTemplateInput","RunInput","Omit","CustomFormatPromptTemplate","PartialVariableName","Record","customParser","Symbol","Promise"],"sources":["../../../src/experimental/prompts/custom_format.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { type ParsedFStringNode, PromptTemplate, type PromptTemplateInput, TypedPromptInputValues } from \"@langchain/core/prompts\";\nexport type CustomFormatPromptTemplateInput<RunInput extends InputValues> = Omit<PromptTemplateInput<RunInput, string>, \"templateFormat\"> & {\n customParser: (template: string) => ParsedFStringNode[];\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n};\nexport declare class CustomFormatPromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends PromptTemplate<RunInput, PartialVariableName> {\n static lc_name(): string;\n lc_serializable: boolean;\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n constructor(input: CustomFormatPromptTemplateInput<RunInput>);\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, { customParser, ...rest }: Omit<CustomFormatPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n /**\n * Formats the prompt template with the provided values.\n * @param values The values to be used to format the prompt template.\n * @returns A promise that resolves to a string which is the formatted prompt.\n */\n format(values: TypedPromptInputValues<RunInput>): Promise<string>;\n}\n//# sourceMappingURL=custom_format.d.ts.map"],"mappings":";;;;KAEYK,iDAAiDL,eAAeO,KAAKJ,oBAAoBG;sCAC7DL;EAD5BI,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAA+B,EAAA,cAAAC,EAAA,MAAA,EAAA,EAAA,GAAA,OAAA;EAAkBN,QAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,EAGpBA,WAHoBA,EAAAA,GAAAA,MAAAA;CAAwCM;AAApBH,cAK5DK,0BAL4DL,CAAAA,iBAKhBH,WALgBG,GAAAA,GAAAA,EAAAA,4BAAAA,MAAAA,GAAAA,GAAAA,CAAAA,SAKqDD,cALrDC,CAKoEG,QALpEH,EAK8EM,mBAL9EN,CAAAA,CAAAA;EAALI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACpCN,eAAAA,EAAAA,OAAAA;EAECD,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,cAAAA,EAAAA,MAAAA,EAAAA,EAAAA,GAAAA,OAAAA;EAAW,QAAA,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAMXA,WANW,EAAA,GAAA,MAAA;EAE/BQ,WAAAA,CAAAA,KAAAA,EAKEH,+BALwBI,CAKQH,QALRG,CAAAA;EAAkBT;;;EAIxBA,OAAAA,YAAAA,CAAAA,iBAKAA,WALAA,GAKcU,MALdV,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA;IAAAA,YAAAA;IAAAA,GAAAA;EAAAA,CAAAA,EAKgFO,IALhFP,CAKqFK,+BALrFL,CAKqHM,QALrHN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,CAAAA,CAAAA,EAKiKQ,0BALjKR,CAK4LM,QAL5LN,SAK6MY,MAL7MZ,GAAAA,KAAAA,GAK8NM,QAL9NN,EAAAA,GAAAA,CAAAA;EACcM;;;;;EAIuGA,MAAAA,CAAAA,MAAAA,EAM3IF,sBAN2IE,CAMpHA,QANoHA,CAAAA,CAAAA,EAMxGO,OANwGP,CAAAA,MAAAA,CAAAA"}
1
+ {"version":3,"file":"custom_format.d.cts","names":["InputValues","ParsedFStringNode","PromptTemplate","PromptTemplateInput","TypedPromptInputValues","CustomFormatPromptTemplateInput","RunInput","Omit","CustomFormatPromptTemplate","PartialVariableName","Record","customParser","Symbol","Promise"],"sources":["../../../src/experimental/prompts/custom_format.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { type ParsedFStringNode, PromptTemplate, type PromptTemplateInput, TypedPromptInputValues } from \"@langchain/core/prompts\";\nexport type CustomFormatPromptTemplateInput<RunInput extends InputValues> = Omit<PromptTemplateInput<RunInput, string>, \"templateFormat\"> & {\n customParser: (template: string) => ParsedFStringNode[];\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n};\nexport declare class CustomFormatPromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends PromptTemplate<RunInput, PartialVariableName> {\n static lc_name(): string;\n lc_serializable: boolean;\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n constructor(input: CustomFormatPromptTemplateInput<RunInput>);\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, { customParser, ...rest }: Omit<CustomFormatPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n /**\n * Formats the prompt template with the provided values.\n * @param values The values to be used to format the prompt template.\n * @returns A promise that resolves to a string which is the formatted prompt.\n */\n format(values: TypedPromptInputValues<RunInput>): Promise<string>;\n}\n//# sourceMappingURL=custom_format.d.ts.map"],"mappings":";;;;KAEYK,iDAAiDL,eAAeO,KAAKJ,oBAAoBG;sCAC7DL;EAD5BI,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAA+B,EAAAC,cAAA,EAAA,MAAA,EAAA,EAAA,GAAA,OAAA;EAAkBN,QAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,EAGpBA,WAHoBA,EAAAA,GAAAA,MAAAA;CAAwCM;AAApBH,cAK5DK,0BAL4DL,CAAAA,iBAKhBH,WALgBG,GAAAA,GAAAA,EAAAA,4BAAAA,MAAAA,GAAAA,GAAAA,CAAAA,SAKqDD,cALrDC,CAKoEG,QALpEH,EAK8EM,mBAL9EN,CAAAA,CAAAA;EAALI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACpCN,eAAAA,EAAAA,OAAAA;EAECD,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,cAAAA,EAAAA,MAAAA,EAAAA,EAAAA,GAAAA,OAAAA;EAAW,QAAA,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAMXA,WANW,EAAA,GAAA,MAAA;EAE/BQ,WAAAA,CAAAA,KAAAA,EAKEH,+BALwBI,CAKQH,QALRG,CAAAA;EAAkBT;;;EAIxBA,OAAAA,YAAAA,CAAAA,iBAKAA,WALAA,GAKcU,MALdV,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA;IAAAA,YAAAA;IAAAA,GAAAA;EAAAA,CAAAA,EAKgFO,IALhFP,CAKqFK,+BALrFL,CAKqHM,QALrHN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,CAAAA,CAAAA,EAKiKQ,0BALjKR,CAK4LM,QAL5LN,SAK6MY,MAL7MZ,GAAAA,KAAAA,GAK8NM,QAL9NN,EAAAA,GAAAA,CAAAA;EACcM;;;;;EAIuGA,MAAAA,CAAAA,MAAAA,EAM3IF,sBAN2IE,CAMpHA,QANoHA,CAAAA,CAAAA,EAMxGO,OANwGP,CAAAA,MAAAA,CAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"custom_format.d.ts","names":["InputValues","ParsedFStringNode","PromptTemplate","PromptTemplateInput","TypedPromptInputValues","CustomFormatPromptTemplateInput","RunInput","Omit","CustomFormatPromptTemplate","PartialVariableName","Record","customParser","Symbol","Promise"],"sources":["../../../src/experimental/prompts/custom_format.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { type ParsedFStringNode, PromptTemplate, type PromptTemplateInput, TypedPromptInputValues } from \"@langchain/core/prompts\";\nexport type CustomFormatPromptTemplateInput<RunInput extends InputValues> = Omit<PromptTemplateInput<RunInput, string>, \"templateFormat\"> & {\n customParser: (template: string) => ParsedFStringNode[];\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n};\nexport declare class CustomFormatPromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends PromptTemplate<RunInput, PartialVariableName> {\n static lc_name(): string;\n lc_serializable: boolean;\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n constructor(input: CustomFormatPromptTemplateInput<RunInput>);\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, { customParser, ...rest }: Omit<CustomFormatPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n /**\n * Formats the prompt template with the provided values.\n * @param values The values to be used to format the prompt template.\n * @returns A promise that resolves to a string which is the formatted prompt.\n */\n format(values: TypedPromptInputValues<RunInput>): Promise<string>;\n}\n//# sourceMappingURL=custom_format.d.ts.map"],"mappings":";;;;KAEYK,iDAAiDL,eAAeO,KAAKJ,oBAAoBG;sCAC7DL;EAD5BI,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAA+B,EAAA,cAAAC,EAAA,MAAA,EAAA,EAAA,GAAA,OAAA;EAAkBN,QAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,EAGpBA,WAHoBA,EAAAA,GAAAA,MAAAA;CAAwCM;AAApBH,cAK5DK,0BAL4DL,CAAAA,iBAKhBH,WALgBG,GAAAA,GAAAA,EAAAA,4BAAAA,MAAAA,GAAAA,GAAAA,CAAAA,SAKqDD,cALrDC,CAKoEG,QALpEH,EAK8EM,mBAL9EN,CAAAA,CAAAA;EAALI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACpCN,eAAAA,EAAAA,OAAAA;EAECD,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,cAAAA,EAAAA,MAAAA,EAAAA,EAAAA,GAAAA,OAAAA;EAAW,QAAA,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAMXA,WANW,EAAA,GAAA,MAAA;EAE/BQ,WAAAA,CAAAA,KAAAA,EAKEH,+BALwBI,CAKQH,QALRG,CAAAA;EAAkBT;;;EAIxBA,OAAAA,YAAAA,CAAAA,iBAKAA,WALAA,GAKcU,MALdV,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA;IAAAA,YAAAA;IAAAA,GAAAA;EAAAA,CAAAA,EAKgFO,IALhFP,CAKqFK,+BALrFL,CAKqHM,QALrHN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,CAAAA,CAAAA,EAKiKQ,0BALjKR,CAK4LM,QAL5LN,SAK6MY,MAL7MZ,GAAAA,KAAAA,GAK8NM,QAL9NN,EAAAA,GAAAA,CAAAA;EACcM;;;;;EAIuGA,MAAAA,CAAAA,MAAAA,EAM3IF,sBAN2IE,CAMpHA,QANoHA,CAAAA,CAAAA,EAMxGO,OANwGP,CAAAA,MAAAA,CAAAA"}
1
+ {"version":3,"file":"custom_format.d.ts","names":["InputValues","ParsedFStringNode","PromptTemplate","PromptTemplateInput","TypedPromptInputValues","CustomFormatPromptTemplateInput","RunInput","Omit","CustomFormatPromptTemplate","PartialVariableName","Record","customParser","Symbol","Promise"],"sources":["../../../src/experimental/prompts/custom_format.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { type ParsedFStringNode, PromptTemplate, type PromptTemplateInput, TypedPromptInputValues } from \"@langchain/core/prompts\";\nexport type CustomFormatPromptTemplateInput<RunInput extends InputValues> = Omit<PromptTemplateInput<RunInput, string>, \"templateFormat\"> & {\n customParser: (template: string) => ParsedFStringNode[];\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n};\nexport declare class CustomFormatPromptTemplate<RunInput extends InputValues = any, PartialVariableName extends string = any> extends PromptTemplate<RunInput, PartialVariableName> {\n static lc_name(): string;\n lc_serializable: boolean;\n templateValidator?: (template: string, inputVariables: string[]) => boolean;\n renderer: (template: string, values: InputValues) => string;\n constructor(input: CustomFormatPromptTemplateInput<RunInput>);\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, { customParser, ...rest }: Omit<CustomFormatPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n /**\n * Formats the prompt template with the provided values.\n * @param values The values to be used to format the prompt template.\n * @returns A promise that resolves to a string which is the formatted prompt.\n */\n format(values: TypedPromptInputValues<RunInput>): Promise<string>;\n}\n//# sourceMappingURL=custom_format.d.ts.map"],"mappings":";;;;KAEYK,iDAAiDL,eAAeO,KAAKJ,oBAAoBG;sCAC7DL;EAD5BI,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAA+B,EAAAC,cAAA,EAAA,MAAA,EAAA,EAAA,GAAA,OAAA;EAAkBN,QAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,EAGpBA,WAHoBA,EAAAA,GAAAA,MAAAA;CAAwCM;AAApBH,cAK5DK,0BAL4DL,CAAAA,iBAKhBH,WALgBG,GAAAA,GAAAA,EAAAA,4BAAAA,MAAAA,GAAAA,GAAAA,CAAAA,SAKqDD,cALrDC,CAKoEG,QALpEH,EAK8EM,mBAL9EN,CAAAA,CAAAA;EAALI,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EACpCN,eAAAA,EAAAA,OAAAA;EAECD,iBAAAA,CAAAA,EAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,cAAAA,EAAAA,MAAAA,EAAAA,EAAAA,GAAAA,OAAAA;EAAW,QAAA,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAMXA,WANW,EAAA,GAAA,MAAA;EAE/BQ,WAAAA,CAAAA,KAAAA,EAKEH,+BALwBI,CAKQH,QALRG,CAAAA;EAAkBT;;;EAIxBA,OAAAA,YAAAA,CAAAA,iBAKAA,WALAA,GAKcU,MALdV,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA;IAAAA,YAAAA;IAAAA,GAAAA;EAAAA,CAAAA,EAKgFO,IALhFP,CAKqFK,+BALrFL,CAKqHM,QALrHN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,CAAAA,CAAAA,EAKiKQ,0BALjKR,CAK4LM,QAL5LN,SAK6MY,MAL7MZ,GAAAA,KAAAA,GAK8NM,QAL9NN,EAAAA,GAAAA,CAAAA;EACcM;;;;;EAIuGA,MAAAA,CAAAA,MAAAA,EAM3IF,sBAN2IE,CAMpHA,QANoHA,CAAAA,CAAAA,EAMxGO,OANwGP,CAAAA,MAAAA,CAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"handlebars.d.cts","names":["InputValues","CustomFormatPromptTemplate","CustomFormatPromptTemplateInput","parseHandlebars","_langchain_core_prompts0","ParsedTemplateNode","interpolateHandlebars","HandlebarsPromptTemplateInput","RunInput","HandlebarsPromptTemplate","Record","Omit","Symbol"],"sources":["../../../src/experimental/prompts/handlebars.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { CustomFormatPromptTemplate, CustomFormatPromptTemplateInput } from \"./custom_format.js\";\nexport declare const parseHandlebars: (template: string) => import(\"@langchain/core/prompts\").ParsedTemplateNode[];\nexport declare const interpolateHandlebars: (template: string, values: InputValues) => string;\nexport type HandlebarsPromptTemplateInput<RunInput extends InputValues> = CustomFormatPromptTemplateInput<RunInput>;\nexport declare class HandlebarsPromptTemplate<RunInput extends InputValues = any> extends CustomFormatPromptTemplate<RunInput> {\n static lc_name(): string;\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, params?: Omit<HandlebarsPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\" | \"customParser\" | \"templateValidator\" | \"renderer\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n}\n//# sourceMappingURL=handlebars.d.ts.map"],"mappings":";;;;;cAEqBG,uCAA6FC,wBAAAA,CAApBC,kBAAkB;cAC3FC,kDAAkDN;KAC3DO,+CAA+CP,eAAeE,gCAAgCM;AAFrFL,cAGAM,wBAH6FL,CAAAA,iBAGnDJ,WAH+BK,GAAAA,GAAkB,CAAA,SAGtBJ,0BAHsB,CAGKO,QAHL,CAAA,CAAA;EAC3FF,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAwE;EACjFC;;;EAA8DL,OAAAA,YAAAA,CAAAA,iBAMjCF,WANiCE,GAMnBQ,MANmBR,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,CAAAA,EAM6BS,IAN7BT,CAMkCK,6BANlCL,CAMgEM,QANhEN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,GAAAA,cAAAA,GAAAA,mBAAAA,GAAAA,UAAAA,CAAAA,CAAAA,EAMgKD,0BANhKC,CAM2LM,QAN3LN,SAM4MU,MAN5MV,GAAAA,KAAAA,GAM6NM,QAN7NN,EAAAA,GAAAA,CAAAA;AAA+B"}
1
+ {"version":3,"file":"handlebars.d.cts","names":["InputValues","CustomFormatPromptTemplate","CustomFormatPromptTemplateInput","parseHandlebars","_langchain_core_prompts0","ParsedTemplateNode","interpolateHandlebars","HandlebarsPromptTemplateInput","RunInput","HandlebarsPromptTemplate","Record","Omit","Symbol"],"sources":["../../../src/experimental/prompts/handlebars.d.ts"],"sourcesContent":["import type { InputValues } from \"@langchain/core/utils/types\";\nimport { CustomFormatPromptTemplate, CustomFormatPromptTemplateInput } from \"./custom_format.js\";\nexport declare const parseHandlebars: (template: string) => import(\"@langchain/core/prompts\").ParsedTemplateNode[];\nexport declare const interpolateHandlebars: (template: string, values: InputValues) => string;\nexport type HandlebarsPromptTemplateInput<RunInput extends InputValues> = CustomFormatPromptTemplateInput<RunInput>;\nexport declare class HandlebarsPromptTemplate<RunInput extends InputValues = any> extends CustomFormatPromptTemplate<RunInput> {\n static lc_name(): string;\n /**\n * Load prompt template from a template\n */\n static fromTemplate<RunInput extends InputValues = Record<string, any>>(template: string, params?: Omit<HandlebarsPromptTemplateInput<RunInput>, \"template\" | \"inputVariables\" | \"customParser\" | \"templateValidator\" | \"renderer\">): CustomFormatPromptTemplate<RunInput extends Symbol ? never : RunInput, any>;\n}\n//# sourceMappingURL=handlebars.d.ts.map"],"mappings":";;;;;cAEqBG,uCAA6FC,wBAAAA,CAApBC,kBAAkB;cAC3FC,kDAAkDN;KAC3DO,+CAA+CP,eAAeE,gCAAgCM;AAFrFL,cAGAM,wBAH6FL,CAAAA,iBAGnDJ,WAH+BK,GAAkB,GAAA,CAAA,SAGtBJ,0BAHsB,CAGKO,QAHL,CAAA,CAAA;EAC3FF,OAAAA,OAAAA,CAAAA,CAAAA,EAAAA,MAAwE;EACjFC;;;EAA8DL,OAAAA,YAAAA,CAAAA,iBAMjCF,WANiCE,GAMnBQ,MANmBR,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,MAAAA,CAAAA,EAM6BS,IAN7BT,CAMkCK,6BANlCL,CAMgEM,QANhEN,CAAAA,EAAAA,UAAAA,GAAAA,gBAAAA,GAAAA,cAAAA,GAAAA,mBAAAA,GAAAA,UAAAA,CAAAA,CAAAA,EAMgKD,0BANhKC,CAM2LM,QAN3LN,SAM4MU,MAN5MV,GAAAA,KAAAA,GAM6NM,QAN7NN,EAAAA,GAAAA,CAAAA;AAA+B"}
@@ -1 +1 @@
1
- {"version":3,"file":"hyde.d.cts","names":["BaseLanguageModelInterface","Document","BasePromptTemplate","VectorStore","VectorStoreRetriever","VectorStoreRetrieverInput","CallbackManagerForRetrieverRun","PromptKey","HydeRetrieverOptions","V","HydeRetriever","Promise","getPromptTemplateFromKey"],"sources":["../../src/retrievers/hyde.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { Document } from \"@langchain/core/documents\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { VectorStore, VectorStoreRetriever, VectorStoreRetrieverInput } from \"@langchain/core/vectorstores\";\nimport { CallbackManagerForRetrieverRun } from \"@langchain/core/callbacks/manager\";\n/**\n * A string that corresponds to a specific prompt template.\n */\nexport type PromptKey = \"websearch\" | \"scifact\" | \"arguana\" | \"trec-covid\" | \"fiqa\" | \"dbpedia-entity\" | \"trec-news\" | \"mr-tydi\";\n/**\n * Options for the HydeRetriever class, which includes a BaseLanguageModel\n * instance, a VectorStore instance, and an optional promptTemplate which\n * can either be a BasePromptTemplate instance or a PromptKey.\n */\nexport type HydeRetrieverOptions<V extends VectorStore> = VectorStoreRetrieverInput<V> & {\n llm: BaseLanguageModelInterface;\n promptTemplate?: BasePromptTemplate | PromptKey;\n};\n/**\n * A class for retrieving relevant documents based on a given query. It\n * extends the VectorStoreRetriever class and uses a BaseLanguageModel to\n * generate a hypothetical answer to the query, which is then used to\n * retrieve relevant documents.\n * @example\n * ```typescript\n * const retriever = new HydeRetriever({\n * vectorStore: new MemoryVectorStore(new OpenAIEmbeddings()),\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * k: 1,\n * });\n * await vectorStore.addDocuments(\n * [\n * \"My name is John.\",\n * \"My name is Bob.\",\n * \"My favourite food is pizza.\",\n * \"My favourite food is pasta.\",\n * ].map((pageContent) => new Document({ pageContent })),\n * );\n * const results = await retriever.invoke(\n * \"What is my favourite food?\",\n * );\n * ```\n */\nexport declare class HydeRetriever<V extends VectorStore = VectorStore> extends VectorStoreRetriever<V> {\n static lc_name(): string;\n get lc_namespace(): string[];\n llm: BaseLanguageModelInterface;\n promptTemplate?: BasePromptTemplate;\n constructor(fields: HydeRetrieverOptions<V>);\n _getRelevantDocuments(query: string, runManager?: CallbackManagerForRetrieverRun): Promise<Document[]>;\n}\n/**\n * Returns a BasePromptTemplate instance based on a given PromptKey.\n */\nexport declare function getPromptTemplateFromKey(key: PromptKey): BasePromptTemplate;\n//# sourceMappingURL=hyde.d.ts.map"],"mappings":";;;;;;;;;;AAQA;AAMYQ,KANAD,SAAAA,GAMAC,WAAoBC,GAAAA,SAAA,GAAA,SAAA,GAAA,YAAA,GAAA,MAAA,GAAA,gBAAA,GAAA,WAAA,GAAA,SAAA;;;;;;AAEUF,KAF9BC,oBAE8BD,CAAAA,UAFCJ,WAEDI,CAAAA,GAFgBF,yBAEhBE,CAF0CE,CAE1CF,CAAAA,GAAAA;EAAS,GAAA,EAD1CP,0BAC0C;EA2B9BU,cAAAA,CAAAA,EA3BAR,kBA2Ba,GA3BQK,SA2BR;CAAWJ;;;;;;;;;;;AAAuD;AAWpG;;;;;;;;;;;;;;cAXqBO,wBAAwBP,cAAcA,qBAAqBC,qBAAqBK;;;OAG5FT;mBACYE;sBACGM,qBAAqBC;oDACSH,iCAAiCK,QAAQV;;;;;iBAKvEW,wBAAAA,MAA8BL,YAAYL"}
1
+ {"version":3,"file":"hyde.d.cts","names":["BaseLanguageModelInterface","Document","BasePromptTemplate","VectorStore","VectorStoreRetriever","VectorStoreRetrieverInput","CallbackManagerForRetrieverRun","PromptKey","HydeRetrieverOptions","V","HydeRetriever","Promise","getPromptTemplateFromKey"],"sources":["../../src/retrievers/hyde.d.ts"],"sourcesContent":["import type { BaseLanguageModelInterface } from \"@langchain/core/language_models/base\";\nimport { Document } from \"@langchain/core/documents\";\nimport { BasePromptTemplate } from \"@langchain/core/prompts\";\nimport { VectorStore, VectorStoreRetriever, VectorStoreRetrieverInput } from \"@langchain/core/vectorstores\";\nimport { CallbackManagerForRetrieverRun } from \"@langchain/core/callbacks/manager\";\n/**\n * A string that corresponds to a specific prompt template.\n */\nexport type PromptKey = \"websearch\" | \"scifact\" | \"arguana\" | \"trec-covid\" | \"fiqa\" | \"dbpedia-entity\" | \"trec-news\" | \"mr-tydi\";\n/**\n * Options for the HydeRetriever class, which includes a BaseLanguageModel\n * instance, a VectorStore instance, and an optional promptTemplate which\n * can either be a BasePromptTemplate instance or a PromptKey.\n */\nexport type HydeRetrieverOptions<V extends VectorStore> = VectorStoreRetrieverInput<V> & {\n llm: BaseLanguageModelInterface;\n promptTemplate?: BasePromptTemplate | PromptKey;\n};\n/**\n * A class for retrieving relevant documents based on a given query. It\n * extends the VectorStoreRetriever class and uses a BaseLanguageModel to\n * generate a hypothetical answer to the query, which is then used to\n * retrieve relevant documents.\n * @example\n * ```typescript\n * const retriever = new HydeRetriever({\n * vectorStore: new MemoryVectorStore(new OpenAIEmbeddings()),\n * llm: new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n * k: 1,\n * });\n * await vectorStore.addDocuments(\n * [\n * \"My name is John.\",\n * \"My name is Bob.\",\n * \"My favourite food is pizza.\",\n * \"My favourite food is pasta.\",\n * ].map((pageContent) => new Document({ pageContent })),\n * );\n * const results = await retriever.invoke(\n * \"What is my favourite food?\",\n * );\n * ```\n */\nexport declare class HydeRetriever<V extends VectorStore = VectorStore> extends VectorStoreRetriever<V> {\n static lc_name(): string;\n get lc_namespace(): string[];\n llm: BaseLanguageModelInterface;\n promptTemplate?: BasePromptTemplate;\n constructor(fields: HydeRetrieverOptions<V>);\n _getRelevantDocuments(query: string, runManager?: CallbackManagerForRetrieverRun): Promise<Document[]>;\n}\n/**\n * Returns a BasePromptTemplate instance based on a given PromptKey.\n */\nexport declare function getPromptTemplateFromKey(key: PromptKey): BasePromptTemplate;\n//# sourceMappingURL=hyde.d.ts.map"],"mappings":";;;;;;;;;;AAQA;AAMYQ,KANAD,SAAAA,GAMAC,WAAoBC,GAAA,SAAA,GAAA,SAAA,GAAA,YAAA,GAAA,MAAA,GAAA,gBAAA,GAAA,WAAA,GAAA,SAAA;;;;;;AAEUF,KAF9BC,oBAE8BD,CAAAA,UAFCJ,WAEDI,CAAAA,GAFgBF,yBAEhBE,CAF0CE,CAE1CF,CAAAA,GAAAA;EAAS,GAAA,EAD1CP,0BAC0C;EA2B9BU,cAAAA,CAAAA,EA3BAR,kBA2Ba,GA3BQK,SA2BR;CAAWJ;;;;;;;;;;;AAAuD;AAWpG;;;;;;;;;;;;;;cAXqBO,wBAAwBP,cAAcA,qBAAqBC,qBAAqBK;;;OAG5FT;mBACYE;sBACGM,qBAAqBC;oDACSH,iCAAiCK,QAAQV;;;;;iBAKvEW,wBAAAA,MAA8BL,YAAYL"}