@langchain/langgraph 1.0.7 → 1.0.12

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 (383) hide show
  1. package/package.json +7 -7
  2. package/CHANGELOG.md +0 -286
  3. package/dist/_virtual/rolldown_runtime.cjs +0 -25
  4. package/dist/channels/any_value.cjs +0 -46
  5. package/dist/channels/any_value.cjs.map +0 -1
  6. package/dist/channels/any_value.d.cts +0 -24
  7. package/dist/channels/any_value.d.cts.map +0 -1
  8. package/dist/channels/any_value.d.ts +0 -24
  9. package/dist/channels/any_value.d.ts.map +0 -1
  10. package/dist/channels/any_value.js +0 -46
  11. package/dist/channels/any_value.js.map +0 -1
  12. package/dist/channels/base.cjs +0 -102
  13. package/dist/channels/base.cjs.map +0 -1
  14. package/dist/channels/base.d.cts +0 -79
  15. package/dist/channels/base.d.cts.map +0 -1
  16. package/dist/channels/base.d.ts +0 -79
  17. package/dist/channels/base.d.ts.map +0 -1
  18. package/dist/channels/base.js +0 -97
  19. package/dist/channels/base.js.map +0 -1
  20. package/dist/channels/binop.cjs +0 -49
  21. package/dist/channels/binop.cjs.map +0 -1
  22. package/dist/channels/binop.d.cts +0 -22
  23. package/dist/channels/binop.d.cts.map +0 -1
  24. package/dist/channels/binop.d.ts +0 -22
  25. package/dist/channels/binop.d.ts.map +0 -1
  26. package/dist/channels/binop.js +0 -49
  27. package/dist/channels/binop.js.map +0 -1
  28. package/dist/channels/dynamic_barrier_value.cjs +0 -76
  29. package/dist/channels/dynamic_barrier_value.cjs.map +0 -1
  30. package/dist/channels/dynamic_barrier_value.d.cts +0 -42
  31. package/dist/channels/dynamic_barrier_value.d.cts.map +0 -1
  32. package/dist/channels/dynamic_barrier_value.d.ts +0 -42
  33. package/dist/channels/dynamic_barrier_value.d.ts.map +0 -1
  34. package/dist/channels/dynamic_barrier_value.js +0 -76
  35. package/dist/channels/dynamic_barrier_value.js.map +0 -1
  36. package/dist/channels/ephemeral_value.cjs +0 -46
  37. package/dist/channels/ephemeral_value.cjs.map +0 -1
  38. package/dist/channels/ephemeral_value.d.cts +0 -22
  39. package/dist/channels/ephemeral_value.d.cts.map +0 -1
  40. package/dist/channels/ephemeral_value.d.ts +0 -22
  41. package/dist/channels/ephemeral_value.d.ts.map +0 -1
  42. package/dist/channels/ephemeral_value.js +0 -46
  43. package/dist/channels/ephemeral_value.js.map +0 -1
  44. package/dist/channels/index.cjs +0 -21
  45. package/dist/channels/index.d.cts +0 -9
  46. package/dist/channels/index.d.ts +0 -9
  47. package/dist/channels/index.js +0 -10
  48. package/dist/channels/last_value.cjs +0 -98
  49. package/dist/channels/last_value.cjs.map +0 -1
  50. package/dist/channels/last_value.d.cts +0 -44
  51. package/dist/channels/last_value.d.cts.map +0 -1
  52. package/dist/channels/last_value.d.ts +0 -44
  53. package/dist/channels/last_value.d.ts.map +0 -1
  54. package/dist/channels/last_value.js +0 -97
  55. package/dist/channels/last_value.js.map +0 -1
  56. package/dist/channels/named_barrier_value.cjs +0 -118
  57. package/dist/channels/named_barrier_value.cjs.map +0 -1
  58. package/dist/channels/named_barrier_value.d.cts +0 -46
  59. package/dist/channels/named_barrier_value.d.cts.map +0 -1
  60. package/dist/channels/named_barrier_value.d.ts +0 -46
  61. package/dist/channels/named_barrier_value.d.ts.map +0 -1
  62. package/dist/channels/named_barrier_value.js +0 -116
  63. package/dist/channels/named_barrier_value.js.map +0 -1
  64. package/dist/channels/topic.cjs +0 -65
  65. package/dist/channels/topic.cjs.map +0 -1
  66. package/dist/channels/topic.d.cts +0 -32
  67. package/dist/channels/topic.d.cts.map +0 -1
  68. package/dist/channels/topic.d.ts +0 -32
  69. package/dist/channels/topic.d.ts.map +0 -1
  70. package/dist/channels/topic.js +0 -65
  71. package/dist/channels/topic.js.map +0 -1
  72. package/dist/constants.cjs +0 -406
  73. package/dist/constants.cjs.map +0 -1
  74. package/dist/constants.d.cts +0 -285
  75. package/dist/constants.d.cts.map +0 -1
  76. package/dist/constants.d.ts +0 -285
  77. package/dist/constants.d.ts.map +0 -1
  78. package/dist/constants.js +0 -362
  79. package/dist/constants.js.map +0 -1
  80. package/dist/errors.cjs +0 -163
  81. package/dist/errors.cjs.map +0 -1
  82. package/dist/errors.d.cts +0 -81
  83. package/dist/errors.d.cts.map +0 -1
  84. package/dist/errors.d.ts +0 -81
  85. package/dist/errors.d.ts.map +0 -1
  86. package/dist/errors.js +0 -146
  87. package/dist/errors.js.map +0 -1
  88. package/dist/func/index.cjs +0 -301
  89. package/dist/func/index.cjs.map +0 -1
  90. package/dist/func/index.d.cts +0 -293
  91. package/dist/func/index.d.cts.map +0 -1
  92. package/dist/func/index.d.ts +0 -293
  93. package/dist/func/index.d.ts.map +0 -1
  94. package/dist/func/index.js +0 -298
  95. package/dist/func/index.js.map +0 -1
  96. package/dist/func/types.d.cts +0 -64
  97. package/dist/func/types.d.cts.map +0 -1
  98. package/dist/func/types.d.ts +0 -64
  99. package/dist/func/types.d.ts.map +0 -1
  100. package/dist/graph/annotation.cjs +0 -101
  101. package/dist/graph/annotation.cjs.map +0 -1
  102. package/dist/graph/annotation.d.cts +0 -116
  103. package/dist/graph/annotation.d.cts.map +0 -1
  104. package/dist/graph/annotation.d.ts +0 -116
  105. package/dist/graph/annotation.d.ts.map +0 -1
  106. package/dist/graph/annotation.js +0 -99
  107. package/dist/graph/annotation.js.map +0 -1
  108. package/dist/graph/graph.cjs +0 -423
  109. package/dist/graph/graph.cjs.map +0 -1
  110. package/dist/graph/graph.d.cts +0 -132
  111. package/dist/graph/graph.d.cts.map +0 -1
  112. package/dist/graph/graph.d.ts +0 -132
  113. package/dist/graph/graph.d.ts.map +0 -1
  114. package/dist/graph/graph.js +0 -420
  115. package/dist/graph/graph.js.map +0 -1
  116. package/dist/graph/index.cjs +0 -5
  117. package/dist/graph/index.js +0 -7
  118. package/dist/graph/message.cjs +0 -99
  119. package/dist/graph/message.cjs.map +0 -1
  120. package/dist/graph/message.d.cts +0 -40
  121. package/dist/graph/message.d.cts.map +0 -1
  122. package/dist/graph/message.d.ts +0 -40
  123. package/dist/graph/message.d.ts.map +0 -1
  124. package/dist/graph/message.js +0 -95
  125. package/dist/graph/message.js.map +0 -1
  126. package/dist/graph/messages_annotation.cjs +0 -110
  127. package/dist/graph/messages_annotation.cjs.map +0 -1
  128. package/dist/graph/messages_annotation.d.cts +0 -112
  129. package/dist/graph/messages_annotation.d.cts.map +0 -1
  130. package/dist/graph/messages_annotation.d.ts +0 -112
  131. package/dist/graph/messages_annotation.d.ts.map +0 -1
  132. package/dist/graph/messages_annotation.js +0 -107
  133. package/dist/graph/messages_annotation.js.map +0 -1
  134. package/dist/graph/state.cjs +0 -501
  135. package/dist/graph/state.cjs.map +0 -1
  136. package/dist/graph/state.d.cts +0 -236
  137. package/dist/graph/state.d.cts.map +0 -1
  138. package/dist/graph/state.d.ts +0 -236
  139. package/dist/graph/state.d.ts.map +0 -1
  140. package/dist/graph/state.js +0 -499
  141. package/dist/graph/state.js.map +0 -1
  142. package/dist/graph/zod/index.cjs +0 -10
  143. package/dist/graph/zod/index.d.cts +0 -3
  144. package/dist/graph/zod/index.d.ts +0 -3
  145. package/dist/graph/zod/index.js +0 -5
  146. package/dist/graph/zod/meta.cjs +0 -145
  147. package/dist/graph/zod/meta.cjs.map +0 -1
  148. package/dist/graph/zod/meta.d.cts +0 -116
  149. package/dist/graph/zod/meta.d.cts.map +0 -1
  150. package/dist/graph/zod/meta.d.ts +0 -116
  151. package/dist/graph/zod/meta.d.ts.map +0 -1
  152. package/dist/graph/zod/meta.js +0 -141
  153. package/dist/graph/zod/meta.js.map +0 -1
  154. package/dist/graph/zod/plugin.cjs +0 -41
  155. package/dist/graph/zod/plugin.cjs.map +0 -1
  156. package/dist/graph/zod/plugin.js +0 -41
  157. package/dist/graph/zod/plugin.js.map +0 -1
  158. package/dist/graph/zod/schema.cjs +0 -99
  159. package/dist/graph/zod/schema.cjs.map +0 -1
  160. package/dist/graph/zod/schema.d.cts +0 -38
  161. package/dist/graph/zod/schema.d.cts.map +0 -1
  162. package/dist/graph/zod/schema.d.ts +0 -38
  163. package/dist/graph/zod/schema.d.ts.map +0 -1
  164. package/dist/graph/zod/schema.js +0 -94
  165. package/dist/graph/zod/schema.js.map +0 -1
  166. package/dist/graph/zod/zod-registry.cjs +0 -43
  167. package/dist/graph/zod/zod-registry.cjs.map +0 -1
  168. package/dist/graph/zod/zod-registry.d.cts +0 -51
  169. package/dist/graph/zod/zod-registry.d.cts.map +0 -1
  170. package/dist/graph/zod/zod-registry.d.ts +0 -51
  171. package/dist/graph/zod/zod-registry.d.ts.map +0 -1
  172. package/dist/graph/zod/zod-registry.js +0 -41
  173. package/dist/graph/zod/zod-registry.js.map +0 -1
  174. package/dist/hash.cjs +0 -271
  175. package/dist/hash.cjs.map +0 -1
  176. package/dist/hash.js +0 -269
  177. package/dist/hash.js.map +0 -1
  178. package/dist/index.cjs +0 -112
  179. package/dist/index.cjs.map +0 -1
  180. package/dist/index.d.cts +0 -26
  181. package/dist/index.d.ts +0 -26
  182. package/dist/index.js +0 -22
  183. package/dist/index.js.map +0 -1
  184. package/dist/interrupt.cjs +0 -82
  185. package/dist/interrupt.cjs.map +0 -1
  186. package/dist/interrupt.d.cts +0 -58
  187. package/dist/interrupt.d.cts.map +0 -1
  188. package/dist/interrupt.d.ts +0 -58
  189. package/dist/interrupt.d.ts.map +0 -1
  190. package/dist/interrupt.js +0 -81
  191. package/dist/interrupt.js.map +0 -1
  192. package/dist/prebuilt/agentName.cjs +0 -153
  193. package/dist/prebuilt/agentName.cjs.map +0 -1
  194. package/dist/prebuilt/agentName.d.cts +0 -42
  195. package/dist/prebuilt/agentName.d.cts.map +0 -1
  196. package/dist/prebuilt/agentName.d.ts +0 -42
  197. package/dist/prebuilt/agentName.d.ts.map +0 -1
  198. package/dist/prebuilt/agentName.js +0 -152
  199. package/dist/prebuilt/agentName.js.map +0 -1
  200. package/dist/prebuilt/agent_executor.cjs +0 -44
  201. package/dist/prebuilt/agent_executor.cjs.map +0 -1
  202. package/dist/prebuilt/agent_executor.d.cts +0 -58
  203. package/dist/prebuilt/agent_executor.d.cts.map +0 -1
  204. package/dist/prebuilt/agent_executor.d.ts +0 -58
  205. package/dist/prebuilt/agent_executor.d.ts.map +0 -1
  206. package/dist/prebuilt/agent_executor.js +0 -44
  207. package/dist/prebuilt/agent_executor.js.map +0 -1
  208. package/dist/prebuilt/chat_agent_executor.cjs +0 -68
  209. package/dist/prebuilt/chat_agent_executor.cjs.map +0 -1
  210. package/dist/prebuilt/chat_agent_executor.d.cts +0 -23
  211. package/dist/prebuilt/chat_agent_executor.d.cts.map +0 -1
  212. package/dist/prebuilt/chat_agent_executor.d.ts +0 -23
  213. package/dist/prebuilt/chat_agent_executor.d.ts.map +0 -1
  214. package/dist/prebuilt/chat_agent_executor.js +0 -67
  215. package/dist/prebuilt/chat_agent_executor.js.map +0 -1
  216. package/dist/prebuilt/index.cjs +0 -15
  217. package/dist/prebuilt/index.d.cts +0 -8
  218. package/dist/prebuilt/index.d.ts +0 -8
  219. package/dist/prebuilt/index.js +0 -8
  220. package/dist/prebuilt/interrupt.d.cts +0 -61
  221. package/dist/prebuilt/interrupt.d.cts.map +0 -1
  222. package/dist/prebuilt/interrupt.d.ts +0 -61
  223. package/dist/prebuilt/interrupt.d.ts.map +0 -1
  224. package/dist/prebuilt/react_agent_executor.cjs +0 -344
  225. package/dist/prebuilt/react_agent_executor.cjs.map +0 -1
  226. package/dist/prebuilt/react_agent_executor.d.cts +0 -230
  227. package/dist/prebuilt/react_agent_executor.d.cts.map +0 -1
  228. package/dist/prebuilt/react_agent_executor.d.ts +0 -230
  229. package/dist/prebuilt/react_agent_executor.d.ts.map +0 -1
  230. package/dist/prebuilt/react_agent_executor.js +0 -342
  231. package/dist/prebuilt/react_agent_executor.js.map +0 -1
  232. package/dist/prebuilt/tool_executor.cjs +0 -48
  233. package/dist/prebuilt/tool_executor.cjs.map +0 -1
  234. package/dist/prebuilt/tool_executor.d.cts +0 -42
  235. package/dist/prebuilt/tool_executor.d.cts.map +0 -1
  236. package/dist/prebuilt/tool_executor.d.ts +0 -42
  237. package/dist/prebuilt/tool_executor.d.ts.map +0 -1
  238. package/dist/prebuilt/tool_executor.js +0 -47
  239. package/dist/prebuilt/tool_executor.js.map +0 -1
  240. package/dist/prebuilt/tool_node.cjs +0 -248
  241. package/dist/prebuilt/tool_node.cjs.map +0 -1
  242. package/dist/prebuilt/tool_node.d.cts +0 -182
  243. package/dist/prebuilt/tool_node.d.cts.map +0 -1
  244. package/dist/prebuilt/tool_node.d.ts +0 -182
  245. package/dist/prebuilt/tool_node.d.ts.map +0 -1
  246. package/dist/prebuilt/tool_node.js +0 -246
  247. package/dist/prebuilt/tool_node.js.map +0 -1
  248. package/dist/pregel/algo.cjs +0 -573
  249. package/dist/pregel/algo.cjs.map +0 -1
  250. package/dist/pregel/algo.d.cts +0 -13
  251. package/dist/pregel/algo.d.cts.map +0 -1
  252. package/dist/pregel/algo.d.ts +0 -13
  253. package/dist/pregel/algo.d.ts.map +0 -1
  254. package/dist/pregel/algo.js +0 -567
  255. package/dist/pregel/algo.js.map +0 -1
  256. package/dist/pregel/call.cjs +0 -53
  257. package/dist/pregel/call.cjs.map +0 -1
  258. package/dist/pregel/call.js +0 -50
  259. package/dist/pregel/call.js.map +0 -1
  260. package/dist/pregel/debug.cjs +0 -175
  261. package/dist/pregel/debug.cjs.map +0 -1
  262. package/dist/pregel/debug.js +0 -169
  263. package/dist/pregel/debug.js.map +0 -1
  264. package/dist/pregel/index.cjs +0 -1170
  265. package/dist/pregel/index.cjs.map +0 -1
  266. package/dist/pregel/index.d.cts +0 -546
  267. package/dist/pregel/index.d.cts.map +0 -1
  268. package/dist/pregel/index.d.ts +0 -546
  269. package/dist/pregel/index.d.ts.map +0 -1
  270. package/dist/pregel/index.js +0 -1168
  271. package/dist/pregel/index.js.map +0 -1
  272. package/dist/pregel/io.cjs +0 -140
  273. package/dist/pregel/io.cjs.map +0 -1
  274. package/dist/pregel/io.js +0 -135
  275. package/dist/pregel/io.js.map +0 -1
  276. package/dist/pregel/loop.cjs +0 -548
  277. package/dist/pregel/loop.cjs.map +0 -1
  278. package/dist/pregel/loop.js +0 -547
  279. package/dist/pregel/loop.js.map +0 -1
  280. package/dist/pregel/messages.cjs +0 -108
  281. package/dist/pregel/messages.cjs.map +0 -1
  282. package/dist/pregel/messages.js +0 -107
  283. package/dist/pregel/messages.js.map +0 -1
  284. package/dist/pregel/read.cjs +0 -152
  285. package/dist/pregel/read.cjs.map +0 -1
  286. package/dist/pregel/read.d.cts +0 -51
  287. package/dist/pregel/read.d.cts.map +0 -1
  288. package/dist/pregel/read.d.ts +0 -51
  289. package/dist/pregel/read.d.ts.map +0 -1
  290. package/dist/pregel/read.js +0 -150
  291. package/dist/pregel/read.js.map +0 -1
  292. package/dist/pregel/remote.cjs +0 -349
  293. package/dist/pregel/remote.cjs.map +0 -1
  294. package/dist/pregel/remote.d.cts +0 -123
  295. package/dist/pregel/remote.d.cts.map +0 -1
  296. package/dist/pregel/remote.d.ts +0 -123
  297. package/dist/pregel/remote.d.ts.map +0 -1
  298. package/dist/pregel/remote.js +0 -348
  299. package/dist/pregel/remote.js.map +0 -1
  300. package/dist/pregel/retry.cjs +0 -92
  301. package/dist/pregel/retry.cjs.map +0 -1
  302. package/dist/pregel/retry.js +0 -92
  303. package/dist/pregel/retry.js.map +0 -1
  304. package/dist/pregel/runnable_types.d.cts +0 -49
  305. package/dist/pregel/runnable_types.d.cts.map +0 -1
  306. package/dist/pregel/runnable_types.d.ts +0 -49
  307. package/dist/pregel/runnable_types.d.ts.map +0 -1
  308. package/dist/pregel/runner.cjs +0 -228
  309. package/dist/pregel/runner.cjs.map +0 -1
  310. package/dist/pregel/runner.js +0 -228
  311. package/dist/pregel/runner.js.map +0 -1
  312. package/dist/pregel/stream.cjs +0 -199
  313. package/dist/pregel/stream.cjs.map +0 -1
  314. package/dist/pregel/stream.js +0 -196
  315. package/dist/pregel/stream.js.map +0 -1
  316. package/dist/pregel/types.cjs +0 -27
  317. package/dist/pregel/types.cjs.map +0 -1
  318. package/dist/pregel/types.d.cts +0 -453
  319. package/dist/pregel/types.d.cts.map +0 -1
  320. package/dist/pregel/types.d.ts +0 -453
  321. package/dist/pregel/types.d.ts.map +0 -1
  322. package/dist/pregel/types.js +0 -25
  323. package/dist/pregel/types.js.map +0 -1
  324. package/dist/pregel/utils/config.cjs +0 -122
  325. package/dist/pregel/utils/config.cjs.map +0 -1
  326. package/dist/pregel/utils/config.d.cts +0 -36
  327. package/dist/pregel/utils/config.d.cts.map +0 -1
  328. package/dist/pregel/utils/config.d.ts +0 -36
  329. package/dist/pregel/utils/config.d.ts.map +0 -1
  330. package/dist/pregel/utils/config.js +0 -115
  331. package/dist/pregel/utils/config.js.map +0 -1
  332. package/dist/pregel/utils/index.cjs +0 -103
  333. package/dist/pregel/utils/index.cjs.map +0 -1
  334. package/dist/pregel/utils/index.d.cts +0 -51
  335. package/dist/pregel/utils/index.d.cts.map +0 -1
  336. package/dist/pregel/utils/index.d.ts +0 -51
  337. package/dist/pregel/utils/index.d.ts.map +0 -1
  338. package/dist/pregel/utils/index.js +0 -97
  339. package/dist/pregel/utils/index.js.map +0 -1
  340. package/dist/pregel/utils/subgraph.cjs +0 -19
  341. package/dist/pregel/utils/subgraph.cjs.map +0 -1
  342. package/dist/pregel/utils/subgraph.js +0 -17
  343. package/dist/pregel/utils/subgraph.js.map +0 -1
  344. package/dist/pregel/validate.cjs +0 -45
  345. package/dist/pregel/validate.cjs.map +0 -1
  346. package/dist/pregel/validate.js +0 -44
  347. package/dist/pregel/validate.js.map +0 -1
  348. package/dist/pregel/write.cjs +0 -97
  349. package/dist/pregel/write.cjs.map +0 -1
  350. package/dist/pregel/write.d.cts +0 -35
  351. package/dist/pregel/write.d.cts.map +0 -1
  352. package/dist/pregel/write.d.ts +0 -35
  353. package/dist/pregel/write.d.ts.map +0 -1
  354. package/dist/pregel/write.js +0 -95
  355. package/dist/pregel/write.js.map +0 -1
  356. package/dist/remote.cjs +0 -3
  357. package/dist/remote.d.cts +0 -2
  358. package/dist/remote.d.ts +0 -2
  359. package/dist/remote.js +0 -3
  360. package/dist/setup/async_local_storage.cjs +0 -12
  361. package/dist/setup/async_local_storage.cjs.map +0 -1
  362. package/dist/setup/async_local_storage.js +0 -11
  363. package/dist/setup/async_local_storage.js.map +0 -1
  364. package/dist/utils.cjs +0 -88
  365. package/dist/utils.cjs.map +0 -1
  366. package/dist/utils.d.cts +0 -32
  367. package/dist/utils.d.cts.map +0 -1
  368. package/dist/utils.d.ts +0 -32
  369. package/dist/utils.d.ts.map +0 -1
  370. package/dist/utils.js +0 -81
  371. package/dist/utils.js.map +0 -1
  372. package/dist/web.cjs +0 -96
  373. package/dist/web.d.cts +0 -23
  374. package/dist/web.d.ts +0 -23
  375. package/dist/web.js +0 -15
  376. package/dist/writer.cjs +0 -15
  377. package/dist/writer.cjs.map +0 -1
  378. package/dist/writer.d.cts +0 -7
  379. package/dist/writer.d.cts.map +0 -1
  380. package/dist/writer.d.ts +0 -7
  381. package/dist/writer.d.ts.map +0 -1
  382. package/dist/writer.js +0 -14
  383. package/dist/writer.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_executor.d.ts","names":["___web_js0","AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","_langchain_core_messages1","MessageStructure","MessageType","StateDefinition","Partial","CompiledStateGraph"],"sources":["../../src/prebuilt/agent_executor.d.ts"],"sourcesContent":["import { AgentAction, AgentFinish } from \"@langchain/core/agents\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { Tool } from \"@langchain/core/tools\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport type { BaseChannel } from \"../channels/base.js\";\ninterface Step {\n action: AgentAction | AgentFinish;\n observation: unknown;\n}\n/** @ignore */\nexport interface AgentExecutorState {\n agentOutcome?: AgentAction | AgentFinish;\n steps: Array<Step>;\n input: string;\n chatHistory?: BaseMessage[];\n}\n/** @ignore */\nexport declare function createAgentExecutor({ agentRunnable, tools }: {\n agentRunnable: Runnable;\n tools: Array<Tool> | ToolExecutor;\n}): import(\"../web.js\").CompiledStateGraph<{\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps: Step[];\n input: string;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, \"__start__\" | \"action\" | \"agent\", {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}, unknown, unknown>;\nexport {};\n"],"mappings":";;;;;;;;;;;UAMUQ,IAAAA;UACEP,cAAcC;;;;AADhBM,UAKOC,kBAAAA,CALH;EAAA,YAAA,CAAA,EAMKR,WANL,GAMmBC,WANnB;OACFD,EAMDS,KANCT,CAMKO,IANLP,CAAAA;OAAcC,EAAAA,MAAAA;gBAQRC;AAJlB;;AACmBF,iBAMKU,mBAAAA,CANLV;EAAAA,aAAAA;EAAAA;CAAAA,EAAAA;eAAcC,EAOdE,QAPcF;OAChBM,EAONE,KAPMF,CAOAH,IAPAG,CAAAA,GAOQF,YAPRE;sBAANE,CAAAA;cAEOP,CAAAA,EAOCF,WAPDE,GAOeD,WAPfC,GAAAA,SAAAA;SAQPK;EALaG,KAAAA,EAAAA,MAAAA;EAAmB,WAAA,CAAA,EAOzBR,WAPyB,CAK5BW,yBAAAA,CAEkDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAP3E,EAAA,GAAA,SAAA;;cAAkBH,CAAAA,EAS1CZ,WAT0CY,GAS5BX,WAT4BW,GAAAA,SAAAA;OAC1CT,CAAAA,EASPI,IATOJ,EAAAA,GAAAA,SAAAA;OACFC,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;aAANK,CAAAA,EAUOP,WAVPO,CAQKI,yBAAAA,CAEiDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAV3GN,EAAAA,GAAAA,SAAAA;cAAcJ,GAAAA,QAAAA,GAAAA,OAAAA,EAAAA;cAENL,CAAAA,EAUAM,WAVAN,CAUYA,WAVZA,GAU0BC,WAV1BD,GAAAA,SAAAA,EAUmDA,WAVnDA,GAUiEC,WAVjED,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;OAAcC,EAWtBK,WAXsBL,CAWVM,IAXUN,EAAAA,EAWFM,IAXEN,EAAAA,EAAAA,OAAAA,CAAAA;OACtBM,EAWAD,WAXAC,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA;aAAIM,CAAAA,EAYGP,WAZHO,CAYeX,WAVmCY,CAS3CD,yBAAAA,CACuDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAVjED,EAAAA,GAAAA,SAAAA,EAU6FZ,WAV7FY,CAUxBD,yBAAAA,CAAoKC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAVjMD,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;;cAA/CZ,CAAAA,EAYCI,WAZDJ,CAYaF,WAZbE,GAY2BD,WAZ3BC,GAAAA,SAAAA,EAYoDF,WAZpDE,GAYkED,WAZlEC,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;OAECF,EAWRM,WAXQN,CAWIO,IAXJP,EAAAA,EAWYO,IAXZP,EAAAA,EAAAA,OAAAA,CAAAA;OAAcC,EAYtBK,WAZsBL,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA;aACrBM,CAAAA,EAYMD,WAZNC,CAYkBL,WAZlBK,CAWUM,yBAAAA,CACuDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAZtHR,EAAAA,GAAAA,SAAAA,EAYkJL,WAZlJK,CAY6BM,yBAAAA,CAAoKC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAZtPR,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;oBAEqDO;QAAgBD,EAYrEI,OAZqEJ,CAY7DL,kBAZkGO,CAAAA;OAApGb,EAAAA;IAEaF,YAAAA,EAAAA,GAAAA;;UAAuCA,EAAAA,OAAAA,CAAAA"}
@@ -1,44 +0,0 @@
1
- import { END, START } from "../constants.js";
2
- import { StateGraph } from "../graph/state.js";
3
- import { ToolExecutor } from "./tool_executor.js";
4
-
5
- //#region src/prebuilt/agent_executor.ts
6
- /** @ignore */
7
- function createAgentExecutor({ agentRunnable, tools }) {
8
- let toolExecutor;
9
- if (!Array.isArray(tools)) toolExecutor = tools;
10
- else toolExecutor = new ToolExecutor({ tools });
11
- const shouldContinue = (data) => {
12
- if (data.agentOutcome && "returnValues" in data.agentOutcome) return "end";
13
- return "continue";
14
- };
15
- const runAgent = async (data, config) => {
16
- const agentOutcome = await agentRunnable.invoke(data, config);
17
- return { agentOutcome };
18
- };
19
- const executeTools = async (data, config) => {
20
- const agentAction = data.agentOutcome;
21
- if (!agentAction || "returnValues" in agentAction) throw new Error("Agent has not been run yet");
22
- const output = await toolExecutor.invoke(agentAction, config);
23
- return { steps: [{
24
- action: agentAction,
25
- observation: output
26
- }] };
27
- };
28
- const workflow = new StateGraph({ channels: {
29
- input: null,
30
- agentOutcome: null,
31
- steps: {
32
- reducer: (x, y) => x.concat(y),
33
- default: () => []
34
- }
35
- } }).addNode("agent", runAgent).addNode("action", executeTools).addEdge(START, "agent").addConditionalEdges("agent", shouldContinue, {
36
- continue: "action",
37
- end: END
38
- }).addEdge("action", "agent");
39
- return workflow.compile();
40
- }
41
-
42
- //#endregion
43
- export { createAgentExecutor };
44
- //# sourceMappingURL=agent_executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent_executor.js","names":["toolExecutor: ToolExecutor"],"sources":["../../src/prebuilt/agent_executor.ts"],"sourcesContent":["import { AgentAction, AgentFinish } from \"@langchain/core/agents\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable, type RunnableConfig } from \"@langchain/core/runnables\";\nimport { Tool } from \"@langchain/core/tools\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport { StateGraph } from \"../graph/state.js\";\nimport { END, START } from \"../constants.js\";\nimport type { BaseChannel } from \"../channels/base.js\";\n\ninterface Step {\n action: AgentAction | AgentFinish;\n observation: unknown;\n}\n\n/** @ignore */\nexport interface AgentExecutorState {\n agentOutcome?: AgentAction | AgentFinish;\n steps: Array<Step>;\n input: string;\n chatHistory?: BaseMessage[];\n}\n\n/** @ignore */\nexport function createAgentExecutor({\n agentRunnable,\n tools,\n}: {\n agentRunnable: Runnable;\n tools: Array<Tool> | ToolExecutor;\n}) {\n let toolExecutor: ToolExecutor;\n if (!Array.isArray(tools)) {\n toolExecutor = tools;\n } else {\n toolExecutor = new ToolExecutor({\n tools,\n });\n }\n\n // Define logic that will be used to determine which conditional edge to go down\n const shouldContinue = (data: AgentExecutorState) => {\n if (data.agentOutcome && \"returnValues\" in data.agentOutcome) {\n return \"end\";\n }\n return \"continue\";\n };\n\n const runAgent = async (\n data: AgentExecutorState,\n config?: RunnableConfig\n ) => {\n const agentOutcome = await agentRunnable.invoke(data, config);\n return {\n agentOutcome,\n };\n };\n\n const executeTools = async (\n data: AgentExecutorState,\n config?: RunnableConfig\n ): Promise<Partial<AgentExecutorState>> => {\n const agentAction = data.agentOutcome;\n if (!agentAction || \"returnValues\" in agentAction) {\n throw new Error(\"Agent has not been run yet\");\n }\n const output = await toolExecutor.invoke(agentAction, config);\n return {\n steps: [{ action: agentAction, observation: output }],\n };\n };\n\n // Define a new graph\n const workflow = new StateGraph<{\n [K in keyof AgentExecutorState]: BaseChannel<\n AgentExecutorState[K],\n AgentExecutorState[K]\n >;\n }>({\n channels: {\n input: null,\n agentOutcome: null,\n steps: {\n reducer: (x: Step[], y: Step[]) => x.concat(y),\n default: () => [] as Step[],\n },\n },\n })\n // Define the two nodes we will cycle between\n .addNode(\"agent\", runAgent)\n .addNode(\"action\", executeTools)\n // Set the entrypoint as `agent`\n // This means that this node is the first one called\n .addEdge(START, \"agent\")\n // We now add a conditional edge\n .addConditionalEdges(\n // First, we define the start node. We use `agent`.\n // This means these are the edges taken after the `agent` node is called.\n \"agent\",\n // Next, we pass in the function that will determine which node is called next.\n shouldContinue,\n // Finally we pass in a mapping.\n // The keys are strings, and the values are other nodes.\n // END is a special node marking that the graph should finish.\n // What will happen is we will call `should_continue`, and then the output of that\n // will be matched against the keys in this mapping.\n // Based on which one it matches, that node will then be called.\n {\n // If `tools`, then we call the tool node.\n continue: \"action\",\n // Otherwise we finish.\n end: END,\n }\n )\n // We now add a normal edge from `tools` to `agent`.\n // This means that after `tools` is called, `agent` node is called next.\n .addEdge(\"action\", \"agent\");\n\n return workflow.compile();\n}\n"],"mappings":";;;;;;AAuBA,SAAgB,oBAAoB,EAClC,eACA,SAIC;CACD,IAAIA;AACJ,KAAI,CAAC,MAAM,QAAQ,OACjB,gBAAe;KAEf,gBAAe,IAAI,aAAa,EAC9B;CAKJ,MAAM,kBAAkB,SAA6B;AACnD,MAAI,KAAK,gBAAgB,kBAAkB,KAAK,aAC9C,QAAO;AAET,SAAO;;CAGT,MAAM,WAAW,OACf,MACA,WACG;EACH,MAAM,eAAe,MAAM,cAAc,OAAO,MAAM;AACtD,SAAO,EACL;;CAIJ,MAAM,eAAe,OACnB,MACA,WACyC;EACzC,MAAM,cAAc,KAAK;AACzB,MAAI,CAAC,eAAe,kBAAkB,YACpC,OAAM,IAAI,MAAM;EAElB,MAAM,SAAS,MAAM,aAAa,OAAO,aAAa;AACtD,SAAO,EACL,OAAO,CAAC;GAAE,QAAQ;GAAa,aAAa;;;CAKhD,MAAM,WAAW,IAAI,WAKlB,EACD,UAAU;EACR,OAAO;EACP,cAAc;EACd,OAAO;GACL,UAAU,GAAW,MAAc,EAAE,OAAO;GAC5C,eAAe;;MAKlB,QAAQ,SAAS,UACjB,QAAQ,UAAU,cAGlB,QAAQ,OAAO,SAEf,oBAGC,SAEA,gBAOA;EAEE,UAAU;EAEV,KAAK;IAKR,QAAQ,UAAU;AAErB,QAAO,SAAS"}
@@ -1,68 +0,0 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_constants = require('../constants.cjs');
3
- const require_state = require('../graph/state.cjs');
4
- const require_tool_executor = require('./tool_executor.cjs');
5
- const __langchain_core_runnables = require_rolldown_runtime.__toESM(require("@langchain/core/runnables"));
6
- const __langchain_core_messages = require_rolldown_runtime.__toESM(require("@langchain/core/messages"));
7
- const __langchain_core_utils_function_calling = require_rolldown_runtime.__toESM(require("@langchain/core/utils/function_calling"));
8
-
9
- //#region src/prebuilt/chat_agent_executor.ts
10
- /** @deprecated Use {@link createReactAgent} instead with tool calling. */
11
- function createFunctionCallingExecutor({ model, tools }) {
12
- let toolExecutor;
13
- let toolClasses;
14
- if (!Array.isArray(tools)) {
15
- toolExecutor = tools;
16
- toolClasses = tools.tools;
17
- } else {
18
- toolExecutor = new require_tool_executor.ToolExecutor({ tools });
19
- toolClasses = tools;
20
- }
21
- if (!("bind" in model) || typeof model.bind !== "function") throw new Error("Model must be bindable");
22
- const toolsAsOpenAIFunctions = toolClasses.map((tool) => (0, __langchain_core_utils_function_calling.convertToOpenAIFunction)(tool));
23
- const newModel = model.bind({ functions: toolsAsOpenAIFunctions });
24
- const shouldContinue = (state) => {
25
- const { messages } = state;
26
- const lastMessage = messages[messages.length - 1];
27
- if (!("function_call" in lastMessage.additional_kwargs) || !lastMessage.additional_kwargs.function_call) return "end";
28
- return "continue";
29
- };
30
- const callModel = async (state, config) => {
31
- const { messages } = state;
32
- const response = await newModel.invoke(messages, config);
33
- return { messages: [response] };
34
- };
35
- const _getAction = (state) => {
36
- const { messages } = state;
37
- const lastMessage = messages[messages.length - 1];
38
- if (!lastMessage) throw new Error("No messages found.");
39
- if (!lastMessage.additional_kwargs.function_call) throw new Error("No function call found in message.");
40
- return {
41
- tool: lastMessage.additional_kwargs.function_call.name,
42
- toolInput: JSON.stringify(lastMessage.additional_kwargs.function_call.arguments),
43
- log: ""
44
- };
45
- };
46
- const callTool = async (state, config) => {
47
- const action = _getAction(state);
48
- const response = await toolExecutor.invoke(action, config);
49
- const functionMessage = new __langchain_core_messages.FunctionMessage({
50
- content: response,
51
- name: action.tool
52
- });
53
- return { messages: [functionMessage] };
54
- };
55
- const schema = { messages: {
56
- value: (x, y) => x.concat(y),
57
- default: () => []
58
- } };
59
- const workflow = new require_state.StateGraph({ channels: schema }).addNode("agent", new __langchain_core_runnables.RunnableLambda({ func: callModel })).addNode("action", new __langchain_core_runnables.RunnableLambda({ func: callTool })).addEdge(require_constants.START, "agent").addConditionalEdges("agent", shouldContinue, {
60
- continue: "action",
61
- end: require_constants.END
62
- }).addEdge("action", "agent");
63
- return workflow.compile();
64
- }
65
-
66
- //#endregion
67
- exports.createFunctionCallingExecutor = createFunctionCallingExecutor;
68
- //# sourceMappingURL=chat_agent_executor.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat_agent_executor.cjs","names":["toolExecutor: ToolExecutor","toolClasses: Array<StructuredToolInterface | RunnableToolLike>","ToolExecutor","FunctionMessage","schema: StateGraphArgs<FunctionCallingExecutorState>[\"channels\"]","StateGraph","RunnableLambda","START","END"],"sources":["../../src/prebuilt/chat_agent_executor.ts"],"sourcesContent":["import { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { convertToOpenAIFunction } from \"@langchain/core/utils/function_calling\";\nimport { AgentAction } from \"@langchain/core/agents\";\nimport { FunctionMessage, BaseMessage } from \"@langchain/core/messages\";\nimport {\n type RunnableConfig,\n RunnableLambda,\n RunnableToolLike,\n} from \"@langchain/core/runnables\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport {\n CompiledStateGraph,\n StateGraph,\n StateGraphArgs,\n} from \"../graph/state.js\";\nimport { END, START } from \"../constants.js\";\n\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport type FunctionCallingExecutorState = { messages: Array<BaseMessage> };\n\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport function createFunctionCallingExecutor<Model extends object>({\n model,\n tools,\n}: {\n model: Model;\n tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;\n}): CompiledStateGraph<\n FunctionCallingExecutorState,\n Partial<FunctionCallingExecutorState>,\n typeof START | \"agent\" | \"action\"\n> {\n let toolExecutor: ToolExecutor;\n let toolClasses: Array<StructuredToolInterface | RunnableToolLike>;\n if (!Array.isArray(tools)) {\n toolExecutor = tools;\n toolClasses = tools.tools;\n } else {\n toolExecutor = new ToolExecutor({\n tools,\n });\n toolClasses = tools;\n }\n\n if (!(\"bind\" in model) || typeof model.bind !== \"function\") {\n throw new Error(\"Model must be bindable\");\n }\n const toolsAsOpenAIFunctions = toolClasses.map((tool) =>\n convertToOpenAIFunction(tool)\n );\n const newModel = model.bind({\n functions: toolsAsOpenAIFunctions,\n });\n\n // Define the function that determines whether to continue or not\n const shouldContinue = (state: FunctionCallingExecutorState) => {\n const { messages } = state;\n const lastMessage = messages[messages.length - 1];\n // If there is no function call, then we finish\n if (\n !(\"function_call\" in lastMessage.additional_kwargs) ||\n !lastMessage.additional_kwargs.function_call\n ) {\n return \"end\";\n }\n // Otherwise if there is, we continue\n return \"continue\";\n };\n\n // Define the function that calls the model\n const callModel = async (\n state: FunctionCallingExecutorState,\n config?: RunnableConfig\n ) => {\n const { messages } = state;\n const response = await newModel.invoke(messages, config);\n // We return a list, because this will get added to the existing list\n return {\n messages: [response],\n };\n };\n\n // Define the function to execute tools\n const _getAction = (state: FunctionCallingExecutorState): AgentAction => {\n const { messages } = state;\n // Based on the continue condition\n // we know the last message involves a function call\n const lastMessage = messages[messages.length - 1];\n if (!lastMessage) {\n throw new Error(\"No messages found.\");\n }\n if (!lastMessage.additional_kwargs.function_call) {\n throw new Error(\"No function call found in message.\");\n }\n // We construct an AgentAction from the function_call\n return {\n tool: lastMessage.additional_kwargs.function_call.name,\n toolInput: JSON.stringify(\n lastMessage.additional_kwargs.function_call.arguments\n ),\n log: \"\",\n };\n };\n\n const callTool = async (\n state: FunctionCallingExecutorState,\n config?: RunnableConfig\n ) => {\n const action = _getAction(state);\n // We call the tool_executor and get back a response\n const response = await toolExecutor.invoke(action, config);\n // We use the response to create a FunctionMessage\n const functionMessage = new FunctionMessage({\n content: response,\n name: action.tool,\n });\n // We return a list, because this will get added to the existing list\n return { messages: [functionMessage] };\n };\n\n // We create the AgentState that we will pass around\n // This simply involves a list of messages\n // We want steps to return messages to append to the list\n // So we annotate the messages attribute with operator.add\n const schema: StateGraphArgs<FunctionCallingExecutorState>[\"channels\"] = {\n messages: {\n value: (x: BaseMessage[], y: BaseMessage[]) => x.concat(y),\n default: () => [],\n },\n };\n\n // Define a new graph\n const workflow = new StateGraph<FunctionCallingExecutorState>({\n channels: schema,\n })\n // Define the two nodes we will cycle between\n .addNode(\"agent\", new RunnableLambda({ func: callModel }))\n .addNode(\"action\", new RunnableLambda({ func: callTool }))\n // Set the entrypoint as `agent`\n // This means that this node is the first one called\n .addEdge(START, \"agent\")\n // We now add a conditional edge\n .addConditionalEdges(\n // First, we define the start node. We use `agent`.\n // This means these are the edges taken after the `agent` node is called.\n \"agent\",\n // Next, we pass in the function that will determine which node is called next.\n shouldContinue,\n // Finally we pass in a mapping.\n // The keys are strings, and the values are other nodes.\n // END is a special node marking that the graph should finish.\n // What will happen is we will call `should_continue`, and then the output of that\n // will be matched against the keys in this mapping.\n // Based on which one it matches, that node will then be called.\n {\n // If `tools`, then we call the tool node.\n continue: \"action\",\n // Otherwise we finish.\n end: END,\n }\n )\n // We now add a normal edge from `tools` to `agent`.\n // This means that after `tools` is called, `agent` node is called next.\n .addEdge(\"action\", \"agent\");\n\n // Finally, we compile it!\n // This compiles it into a LangChain Runnable,\n // meaning you can use it as you would any other runnable\n return workflow.compile();\n}\n"],"mappings":";;;;;;;;;;AAqBA,SAAgB,8BAAoD,EAClE,OACA,SAQA;CACA,IAAIA;CACJ,IAAIC;AACJ,KAAI,CAAC,MAAM,QAAQ,QAAQ;AACzB,iBAAe;AACf,gBAAc,MAAM;QACf;AACL,iBAAe,IAAIC,mCAAa,EAC9B;AAEF,gBAAc;;AAGhB,KAAI,EAAE,UAAU,UAAU,OAAO,MAAM,SAAS,WAC9C,OAAM,IAAI,MAAM;CAElB,MAAM,yBAAyB,YAAY,KAAK,8EACtB;CAE1B,MAAM,WAAW,MAAM,KAAK,EAC1B,WAAW;CAIb,MAAM,kBAAkB,UAAwC;EAC9D,MAAM,EAAE,aAAa;EACrB,MAAM,cAAc,SAAS,SAAS,SAAS;AAE/C,MACE,EAAE,mBAAmB,YAAY,sBACjC,CAAC,YAAY,kBAAkB,cAE/B,QAAO;AAGT,SAAO;;CAIT,MAAM,YAAY,OAChB,OACA,WACG;EACH,MAAM,EAAE,aAAa;EACrB,MAAM,WAAW,MAAM,SAAS,OAAO,UAAU;AAEjD,SAAO,EACL,UAAU,CAAC;;CAKf,MAAM,cAAc,UAAqD;EACvE,MAAM,EAAE,aAAa;EAGrB,MAAM,cAAc,SAAS,SAAS,SAAS;AAC/C,MAAI,CAAC,YACH,OAAM,IAAI,MAAM;AAElB,MAAI,CAAC,YAAY,kBAAkB,cACjC,OAAM,IAAI,MAAM;AAGlB,SAAO;GACL,MAAM,YAAY,kBAAkB,cAAc;GAClD,WAAW,KAAK,UACd,YAAY,kBAAkB,cAAc;GAE9C,KAAK;;;CAIT,MAAM,WAAW,OACf,OACA,WACG;EACH,MAAM,SAAS,WAAW;EAE1B,MAAM,WAAW,MAAM,aAAa,OAAO,QAAQ;EAEnD,MAAM,kBAAkB,IAAIC,0CAAgB;GAC1C,SAAS;GACT,MAAM,OAAO;;AAGf,SAAO,EAAE,UAAU,CAAC;;CAOtB,MAAMC,SAAmE,EACvE,UAAU;EACR,QAAQ,GAAkB,MAAqB,EAAE,OAAO;EACxD,eAAe;;CAKnB,MAAM,WAAW,IAAIC,yBAAyC,EAC5D,UAAU,UAGT,QAAQ,SAAS,IAAIC,0CAAe,EAAE,MAAM,cAC5C,QAAQ,UAAU,IAAIA,0CAAe,EAAE,MAAM,aAG7C,QAAQC,yBAAO,SAEf,oBAGC,SAEA,gBAOA;EAEE,UAAU;EAEV,KAAKC;IAKR,QAAQ,UAAU;AAKrB,QAAO,SAAS"}
@@ -1,23 +0,0 @@
1
- import { START } from "../constants.cjs";
2
- import { CompiledStateGraph } from "../graph/state.cjs";
3
- import { ToolExecutor } from "./tool_executor.cjs";
4
- import { RunnableToolLike } from "@langchain/core/runnables";
5
- import { BaseMessage } from "@langchain/core/messages";
6
- import { StructuredToolInterface } from "@langchain/core/tools";
7
-
8
- //#region src/prebuilt/chat_agent_executor.d.ts
9
- /** @deprecated Use {@link createReactAgent} instead with tool calling. */
10
- type FunctionCallingExecutorState = {
11
- messages: Array<BaseMessage>;
12
- };
13
- /** @deprecated Use {@link createReactAgent} instead with tool calling. */
14
- declare function createFunctionCallingExecutor<Model extends object>({
15
- model,
16
- tools
17
- }: {
18
- model: Model;
19
- tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;
20
- }): CompiledStateGraph<FunctionCallingExecutorState, Partial<FunctionCallingExecutorState>, typeof START | "agent" | "action">;
21
- //#endregion
22
- export { FunctionCallingExecutorState, createFunctionCallingExecutor };
23
- //# sourceMappingURL=chat_agent_executor.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat_agent_executor.d.cts","names":["StructuredToolInterface","BaseMessage","RunnableToolLike","ToolExecutor","CompiledStateGraph","START","FunctionCallingExecutorState","Array","createFunctionCallingExecutor","model","tools","Model","Partial"],"sources":["../../src/prebuilt/chat_agent_executor.d.ts"],"sourcesContent":["import { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { RunnableToolLike } from \"@langchain/core/runnables\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport { CompiledStateGraph } from \"../graph/state.js\";\nimport { START } from \"../constants.js\";\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport type FunctionCallingExecutorState = {\n messages: Array<BaseMessage>;\n};\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport declare function createFunctionCallingExecutor<Model extends object>({ model, tools }: {\n model: Model;\n tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;\n}): CompiledStateGraph<FunctionCallingExecutorState, Partial<FunctionCallingExecutorState>, typeof START | \"agent\" | \"action\">;\n"],"mappings":";;;;;;;;;KAOYM,4BAAAA;EAAAA,QAAAA,EACEC,KADFD,CACQL,WADRK,CAAAA;CAA4B;;AAC1BC,iBAGUC,6BAHVD,CAAAA,cAAAA,MAAAA,CAAAA,CAAAA;EAAAA,KAAAA;EAAAA;CAAAA,EAAAA;SAIHI;EADaH,KAAAA,EAEbD,KAFaC,CAEPR,uBAFoC,GAEVE,gBAFU,CAAA,GAEUC,YAFV;CAAA,CAAA,EAGjDC,kBAHiD,CAG9BE,4BAH8B,EAGAM,OAHA,CAGQN,4BAHR,CAAA,EAAA,OAG8CD,KAH9C,GAAA,OAAA,GAAA,QAAA,CAAA"}
@@ -1,23 +0,0 @@
1
- import { START } from "../constants.js";
2
- import { CompiledStateGraph } from "../graph/state.js";
3
- import { ToolExecutor } from "./tool_executor.js";
4
- import { RunnableToolLike } from "@langchain/core/runnables";
5
- import { BaseMessage } from "@langchain/core/messages";
6
- import { StructuredToolInterface } from "@langchain/core/tools";
7
-
8
- //#region src/prebuilt/chat_agent_executor.d.ts
9
- /** @deprecated Use {@link createReactAgent} instead with tool calling. */
10
- type FunctionCallingExecutorState = {
11
- messages: Array<BaseMessage>;
12
- };
13
- /** @deprecated Use {@link createReactAgent} instead with tool calling. */
14
- declare function createFunctionCallingExecutor<Model extends object>({
15
- model,
16
- tools
17
- }: {
18
- model: Model;
19
- tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;
20
- }): CompiledStateGraph<FunctionCallingExecutorState, Partial<FunctionCallingExecutorState>, typeof START | "agent" | "action">;
21
- //#endregion
22
- export { FunctionCallingExecutorState, createFunctionCallingExecutor };
23
- //# sourceMappingURL=chat_agent_executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat_agent_executor.d.ts","names":["StructuredToolInterface","BaseMessage","RunnableToolLike","ToolExecutor","CompiledStateGraph","START","FunctionCallingExecutorState","Array","createFunctionCallingExecutor","model","tools","Model","Partial"],"sources":["../../src/prebuilt/chat_agent_executor.d.ts"],"sourcesContent":["import { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { RunnableToolLike } from \"@langchain/core/runnables\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport { CompiledStateGraph } from \"../graph/state.js\";\nimport { START } from \"../constants.js\";\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport type FunctionCallingExecutorState = {\n messages: Array<BaseMessage>;\n};\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport declare function createFunctionCallingExecutor<Model extends object>({ model, tools }: {\n model: Model;\n tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;\n}): CompiledStateGraph<FunctionCallingExecutorState, Partial<FunctionCallingExecutorState>, typeof START | \"agent\" | \"action\">;\n"],"mappings":";;;;;;;;;KAOYM,4BAAAA;EAAAA,QAAAA,EACEC,KADFD,CACQL,WADRK,CAAAA;CAA4B;;AAC1BC,iBAGUC,6BAHVD,CAAAA,cAAAA,MAAAA,CAAAA,CAAAA;EAAAA,KAAAA;EAAAA;CAAAA,EAAAA;SAIHI;EADaH,KAAAA,EAEbD,KAFaC,CAEPR,uBAFoC,GAEVE,gBAFU,CAAA,GAEUC,YAFV;CAAA,CAAA,EAGjDC,kBAHiD,CAG9BE,4BAH8B,EAGAM,OAHA,CAGQN,4BAHR,CAAA,EAAA,OAG8CD,KAH9C,GAAA,OAAA,GAAA,QAAA,CAAA"}
@@ -1,67 +0,0 @@
1
- import { END, START } from "../constants.js";
2
- import { StateGraph } from "../graph/state.js";
3
- import { ToolExecutor } from "./tool_executor.js";
4
- import { RunnableLambda } from "@langchain/core/runnables";
5
- import { FunctionMessage } from "@langchain/core/messages";
6
- import { convertToOpenAIFunction } from "@langchain/core/utils/function_calling";
7
-
8
- //#region src/prebuilt/chat_agent_executor.ts
9
- /** @deprecated Use {@link createReactAgent} instead with tool calling. */
10
- function createFunctionCallingExecutor({ model, tools }) {
11
- let toolExecutor;
12
- let toolClasses;
13
- if (!Array.isArray(tools)) {
14
- toolExecutor = tools;
15
- toolClasses = tools.tools;
16
- } else {
17
- toolExecutor = new ToolExecutor({ tools });
18
- toolClasses = tools;
19
- }
20
- if (!("bind" in model) || typeof model.bind !== "function") throw new Error("Model must be bindable");
21
- const toolsAsOpenAIFunctions = toolClasses.map((tool) => convertToOpenAIFunction(tool));
22
- const newModel = model.bind({ functions: toolsAsOpenAIFunctions });
23
- const shouldContinue = (state) => {
24
- const { messages } = state;
25
- const lastMessage = messages[messages.length - 1];
26
- if (!("function_call" in lastMessage.additional_kwargs) || !lastMessage.additional_kwargs.function_call) return "end";
27
- return "continue";
28
- };
29
- const callModel = async (state, config) => {
30
- const { messages } = state;
31
- const response = await newModel.invoke(messages, config);
32
- return { messages: [response] };
33
- };
34
- const _getAction = (state) => {
35
- const { messages } = state;
36
- const lastMessage = messages[messages.length - 1];
37
- if (!lastMessage) throw new Error("No messages found.");
38
- if (!lastMessage.additional_kwargs.function_call) throw new Error("No function call found in message.");
39
- return {
40
- tool: lastMessage.additional_kwargs.function_call.name,
41
- toolInput: JSON.stringify(lastMessage.additional_kwargs.function_call.arguments),
42
- log: ""
43
- };
44
- };
45
- const callTool = async (state, config) => {
46
- const action = _getAction(state);
47
- const response = await toolExecutor.invoke(action, config);
48
- const functionMessage = new FunctionMessage({
49
- content: response,
50
- name: action.tool
51
- });
52
- return { messages: [functionMessage] };
53
- };
54
- const schema = { messages: {
55
- value: (x, y) => x.concat(y),
56
- default: () => []
57
- } };
58
- const workflow = new StateGraph({ channels: schema }).addNode("agent", new RunnableLambda({ func: callModel })).addNode("action", new RunnableLambda({ func: callTool })).addEdge(START, "agent").addConditionalEdges("agent", shouldContinue, {
59
- continue: "action",
60
- end: END
61
- }).addEdge("action", "agent");
62
- return workflow.compile();
63
- }
64
-
65
- //#endregion
66
- export { createFunctionCallingExecutor };
67
- //# sourceMappingURL=chat_agent_executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat_agent_executor.js","names":["toolExecutor: ToolExecutor","toolClasses: Array<StructuredToolInterface | RunnableToolLike>","schema: StateGraphArgs<FunctionCallingExecutorState>[\"channels\"]"],"sources":["../../src/prebuilt/chat_agent_executor.ts"],"sourcesContent":["import { StructuredToolInterface } from \"@langchain/core/tools\";\nimport { convertToOpenAIFunction } from \"@langchain/core/utils/function_calling\";\nimport { AgentAction } from \"@langchain/core/agents\";\nimport { FunctionMessage, BaseMessage } from \"@langchain/core/messages\";\nimport {\n type RunnableConfig,\n RunnableLambda,\n RunnableToolLike,\n} from \"@langchain/core/runnables\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport {\n CompiledStateGraph,\n StateGraph,\n StateGraphArgs,\n} from \"../graph/state.js\";\nimport { END, START } from \"../constants.js\";\n\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport type FunctionCallingExecutorState = { messages: Array<BaseMessage> };\n\n/** @deprecated Use {@link createReactAgent} instead with tool calling. */\nexport function createFunctionCallingExecutor<Model extends object>({\n model,\n tools,\n}: {\n model: Model;\n tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;\n}): CompiledStateGraph<\n FunctionCallingExecutorState,\n Partial<FunctionCallingExecutorState>,\n typeof START | \"agent\" | \"action\"\n> {\n let toolExecutor: ToolExecutor;\n let toolClasses: Array<StructuredToolInterface | RunnableToolLike>;\n if (!Array.isArray(tools)) {\n toolExecutor = tools;\n toolClasses = tools.tools;\n } else {\n toolExecutor = new ToolExecutor({\n tools,\n });\n toolClasses = tools;\n }\n\n if (!(\"bind\" in model) || typeof model.bind !== \"function\") {\n throw new Error(\"Model must be bindable\");\n }\n const toolsAsOpenAIFunctions = toolClasses.map((tool) =>\n convertToOpenAIFunction(tool)\n );\n const newModel = model.bind({\n functions: toolsAsOpenAIFunctions,\n });\n\n // Define the function that determines whether to continue or not\n const shouldContinue = (state: FunctionCallingExecutorState) => {\n const { messages } = state;\n const lastMessage = messages[messages.length - 1];\n // If there is no function call, then we finish\n if (\n !(\"function_call\" in lastMessage.additional_kwargs) ||\n !lastMessage.additional_kwargs.function_call\n ) {\n return \"end\";\n }\n // Otherwise if there is, we continue\n return \"continue\";\n };\n\n // Define the function that calls the model\n const callModel = async (\n state: FunctionCallingExecutorState,\n config?: RunnableConfig\n ) => {\n const { messages } = state;\n const response = await newModel.invoke(messages, config);\n // We return a list, because this will get added to the existing list\n return {\n messages: [response],\n };\n };\n\n // Define the function to execute tools\n const _getAction = (state: FunctionCallingExecutorState): AgentAction => {\n const { messages } = state;\n // Based on the continue condition\n // we know the last message involves a function call\n const lastMessage = messages[messages.length - 1];\n if (!lastMessage) {\n throw new Error(\"No messages found.\");\n }\n if (!lastMessage.additional_kwargs.function_call) {\n throw new Error(\"No function call found in message.\");\n }\n // We construct an AgentAction from the function_call\n return {\n tool: lastMessage.additional_kwargs.function_call.name,\n toolInput: JSON.stringify(\n lastMessage.additional_kwargs.function_call.arguments\n ),\n log: \"\",\n };\n };\n\n const callTool = async (\n state: FunctionCallingExecutorState,\n config?: RunnableConfig\n ) => {\n const action = _getAction(state);\n // We call the tool_executor and get back a response\n const response = await toolExecutor.invoke(action, config);\n // We use the response to create a FunctionMessage\n const functionMessage = new FunctionMessage({\n content: response,\n name: action.tool,\n });\n // We return a list, because this will get added to the existing list\n return { messages: [functionMessage] };\n };\n\n // We create the AgentState that we will pass around\n // This simply involves a list of messages\n // We want steps to return messages to append to the list\n // So we annotate the messages attribute with operator.add\n const schema: StateGraphArgs<FunctionCallingExecutorState>[\"channels\"] = {\n messages: {\n value: (x: BaseMessage[], y: BaseMessage[]) => x.concat(y),\n default: () => [],\n },\n };\n\n // Define a new graph\n const workflow = new StateGraph<FunctionCallingExecutorState>({\n channels: schema,\n })\n // Define the two nodes we will cycle between\n .addNode(\"agent\", new RunnableLambda({ func: callModel }))\n .addNode(\"action\", new RunnableLambda({ func: callTool }))\n // Set the entrypoint as `agent`\n // This means that this node is the first one called\n .addEdge(START, \"agent\")\n // We now add a conditional edge\n .addConditionalEdges(\n // First, we define the start node. We use `agent`.\n // This means these are the edges taken after the `agent` node is called.\n \"agent\",\n // Next, we pass in the function that will determine which node is called next.\n shouldContinue,\n // Finally we pass in a mapping.\n // The keys are strings, and the values are other nodes.\n // END is a special node marking that the graph should finish.\n // What will happen is we will call `should_continue`, and then the output of that\n // will be matched against the keys in this mapping.\n // Based on which one it matches, that node will then be called.\n {\n // If `tools`, then we call the tool node.\n continue: \"action\",\n // Otherwise we finish.\n end: END,\n }\n )\n // We now add a normal edge from `tools` to `agent`.\n // This means that after `tools` is called, `agent` node is called next.\n .addEdge(\"action\", \"agent\");\n\n // Finally, we compile it!\n // This compiles it into a LangChain Runnable,\n // meaning you can use it as you would any other runnable\n return workflow.compile();\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAgB,8BAAoD,EAClE,OACA,SAQA;CACA,IAAIA;CACJ,IAAIC;AACJ,KAAI,CAAC,MAAM,QAAQ,QAAQ;AACzB,iBAAe;AACf,gBAAc,MAAM;QACf;AACL,iBAAe,IAAI,aAAa,EAC9B;AAEF,gBAAc;;AAGhB,KAAI,EAAE,UAAU,UAAU,OAAO,MAAM,SAAS,WAC9C,OAAM,IAAI,MAAM;CAElB,MAAM,yBAAyB,YAAY,KAAK,SAC9C,wBAAwB;CAE1B,MAAM,WAAW,MAAM,KAAK,EAC1B,WAAW;CAIb,MAAM,kBAAkB,UAAwC;EAC9D,MAAM,EAAE,aAAa;EACrB,MAAM,cAAc,SAAS,SAAS,SAAS;AAE/C,MACE,EAAE,mBAAmB,YAAY,sBACjC,CAAC,YAAY,kBAAkB,cAE/B,QAAO;AAGT,SAAO;;CAIT,MAAM,YAAY,OAChB,OACA,WACG;EACH,MAAM,EAAE,aAAa;EACrB,MAAM,WAAW,MAAM,SAAS,OAAO,UAAU;AAEjD,SAAO,EACL,UAAU,CAAC;;CAKf,MAAM,cAAc,UAAqD;EACvE,MAAM,EAAE,aAAa;EAGrB,MAAM,cAAc,SAAS,SAAS,SAAS;AAC/C,MAAI,CAAC,YACH,OAAM,IAAI,MAAM;AAElB,MAAI,CAAC,YAAY,kBAAkB,cACjC,OAAM,IAAI,MAAM;AAGlB,SAAO;GACL,MAAM,YAAY,kBAAkB,cAAc;GAClD,WAAW,KAAK,UACd,YAAY,kBAAkB,cAAc;GAE9C,KAAK;;;CAIT,MAAM,WAAW,OACf,OACA,WACG;EACH,MAAM,SAAS,WAAW;EAE1B,MAAM,WAAW,MAAM,aAAa,OAAO,QAAQ;EAEnD,MAAM,kBAAkB,IAAI,gBAAgB;GAC1C,SAAS;GACT,MAAM,OAAO;;AAGf,SAAO,EAAE,UAAU,CAAC;;CAOtB,MAAMC,SAAmE,EACvE,UAAU;EACR,QAAQ,GAAkB,MAAqB,EAAE,OAAO;EACxD,eAAe;;CAKnB,MAAM,WAAW,IAAI,WAAyC,EAC5D,UAAU,UAGT,QAAQ,SAAS,IAAI,eAAe,EAAE,MAAM,cAC5C,QAAQ,UAAU,IAAI,eAAe,EAAE,MAAM,aAG7C,QAAQ,OAAO,SAEf,oBAGC,SAEA,gBAOA;EAEE,UAAU;EAEV,KAAK;IAKR,QAAQ,UAAU;AAKrB,QAAO,SAAS"}
@@ -1,15 +0,0 @@
1
- const require_tool_executor = require('./tool_executor.cjs');
2
- const require_agent_executor = require('./agent_executor.cjs');
3
- const require_chat_agent_executor = require('./chat_agent_executor.cjs');
4
- const require_tool_node = require('./tool_node.cjs');
5
- const require_agentName = require('./agentName.cjs');
6
- const require_react_agent_executor = require('./react_agent_executor.cjs');
7
-
8
- exports.ToolExecutor = require_tool_executor.ToolExecutor;
9
- exports.ToolNode = require_tool_node.ToolNode;
10
- exports.createAgentExecutor = require_agent_executor.createAgentExecutor;
11
- exports.createFunctionCallingExecutor = require_chat_agent_executor.createFunctionCallingExecutor;
12
- exports.createReactAgent = require_react_agent_executor.createReactAgent;
13
- exports.createReactAgentAnnotation = require_react_agent_executor.createReactAgentAnnotation;
14
- exports.toolsCondition = require_tool_node.toolsCondition;
15
- exports.withAgentName = require_agentName.withAgentName;
@@ -1,8 +0,0 @@
1
- import { ToolExecutor, ToolExecutorArgs, ToolInvocationInterface } from "./tool_executor.cjs";
2
- import { AgentExecutorState, createAgentExecutor } from "./agent_executor.cjs";
3
- import { FunctionCallingExecutorState, createFunctionCallingExecutor } from "./chat_agent_executor.cjs";
4
- import { ToolNode, ToolNodeOptions, toolsCondition } from "./tool_node.cjs";
5
- import { AgentState, CreateReactAgentParams, createReactAgent, createReactAgentAnnotation } from "./react_agent_executor.cjs";
6
- import { ActionRequest, HumanInterrupt, HumanInterruptConfig, HumanResponse } from "./interrupt.cjs";
7
- import { AgentNameMode, withAgentName } from "./agentName.cjs";
8
- export { type ActionRequest, type AgentExecutorState, type AgentNameMode, type AgentState, type CreateReactAgentParams, type FunctionCallingExecutorState, type HumanInterrupt, type HumanInterruptConfig, type HumanResponse, ToolExecutor, type ToolExecutorArgs, type ToolInvocationInterface, ToolNode, type ToolNodeOptions, createAgentExecutor, createFunctionCallingExecutor, createReactAgent, createReactAgentAnnotation, toolsCondition, withAgentName };
@@ -1,8 +0,0 @@
1
- import { ToolExecutor, ToolExecutorArgs, ToolInvocationInterface } from "./tool_executor.js";
2
- import { AgentExecutorState, createAgentExecutor } from "./agent_executor.js";
3
- import { FunctionCallingExecutorState, createFunctionCallingExecutor } from "./chat_agent_executor.js";
4
- import { ToolNode, ToolNodeOptions, toolsCondition } from "./tool_node.js";
5
- import { AgentState, CreateReactAgentParams, createReactAgent, createReactAgentAnnotation } from "./react_agent_executor.js";
6
- import { ActionRequest, HumanInterrupt, HumanInterruptConfig, HumanResponse } from "./interrupt.js";
7
- import { AgentNameMode, withAgentName } from "./agentName.js";
8
- export { type ActionRequest, type AgentExecutorState, type AgentNameMode, type AgentState, type CreateReactAgentParams, type FunctionCallingExecutorState, type HumanInterrupt, type HumanInterruptConfig, type HumanResponse, ToolExecutor, type ToolExecutorArgs, type ToolInvocationInterface, ToolNode, type ToolNodeOptions, createAgentExecutor, createFunctionCallingExecutor, createReactAgent, createReactAgentAnnotation, toolsCondition, withAgentName };
@@ -1,8 +0,0 @@
1
- import { ToolExecutor } from "./tool_executor.js";
2
- import { createAgentExecutor } from "./agent_executor.js";
3
- import { createFunctionCallingExecutor } from "./chat_agent_executor.js";
4
- import { ToolNode, toolsCondition } from "./tool_node.js";
5
- import { withAgentName } from "./agentName.js";
6
- import { createReactAgent, createReactAgentAnnotation } from "./react_agent_executor.js";
7
-
8
- export { ToolExecutor, ToolNode, createAgentExecutor, createFunctionCallingExecutor, createReactAgent, createReactAgentAnnotation, toolsCondition, withAgentName };
@@ -1,61 +0,0 @@
1
- //#region src/prebuilt/interrupt.d.ts
2
- /**
3
- * Configuration interface that defines what actions are allowed for a human interrupt.
4
- * This controls the available interaction options when the graph is paused for human input.
5
- *
6
- * @property {boolean} allow_ignore - Whether the human can choose to ignore/skip the current step
7
- * @property {boolean} allow_respond - Whether the human can provide a text response/feedback
8
- * @property {boolean} allow_edit - Whether the human can edit the provided content/state
9
- * @property {boolean} allow_accept - Whether the human can accept/approve the current state
10
- */
11
- interface HumanInterruptConfig {
12
- allow_ignore: boolean;
13
- allow_respond: boolean;
14
- allow_edit: boolean;
15
- allow_accept: boolean;
16
- }
17
- /**
18
- * Represents a request for human action within the graph execution.
19
- * Contains the action type and any associated arguments needed for the action.
20
- *
21
- * @property {string} action - The type or name of action being requested (e.g., "Approve XYZ action")
22
- * @property {Record<string, any>} args - Key-value pairs of arguments needed for the action
23
- */
24
- interface ActionRequest {
25
- action: string;
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- args: Record<string, any>;
28
- }
29
- /**
30
- * Represents an interrupt triggered by the graph that requires human intervention.
31
- * This is passed to the `interrupt` function when execution is paused for human input.
32
- *
33
- * @property {ActionRequest} action_request - The specific action being requested from the human
34
- * @property {HumanInterruptConfig} config - Configuration defining what actions are allowed
35
- * @property {string} [description] - Optional detailed description of what input is needed
36
- */
37
- interface HumanInterrupt {
38
- action_request: ActionRequest;
39
- config: HumanInterruptConfig;
40
- description?: string;
41
- }
42
- /**
43
- * The response provided by a human to an interrupt, which is returned when graph execution resumes.
44
- *
45
- * @property {("accept"|"ignore"|"response"|"edit")} type - The type of response:
46
- * - "accept": Approves the current state without changes
47
- * - "ignore": Skips/ignores the current step
48
- * - "response": Provides text feedback or instructions
49
- * - "edit": Modifies the current state/content
50
- * @property {null|string|ActionRequest} args - The response payload:
51
- * - null: For ignore/accept actions
52
- * - string: For text responses
53
- * - ActionRequest: For edit actions with updated content
54
- */
55
- type HumanResponse = {
56
- type: "accept" | "ignore" | "response" | "edit";
57
- args: null | string | ActionRequest;
58
- };
59
- //#endregion
60
- export { ActionRequest, HumanInterrupt, HumanInterruptConfig, HumanResponse };
61
- //# sourceMappingURL=interrupt.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interrupt.d.cts","names":["HumanInterruptConfig","ActionRequest","Record","HumanInterrupt","HumanResponse"],"sources":["../../src/prebuilt/interrupt.d.ts"],"sourcesContent":["/**\n * Configuration interface that defines what actions are allowed for a human interrupt.\n * This controls the available interaction options when the graph is paused for human input.\n *\n * @property {boolean} allow_ignore - Whether the human can choose to ignore/skip the current step\n * @property {boolean} allow_respond - Whether the human can provide a text response/feedback\n * @property {boolean} allow_edit - Whether the human can edit the provided content/state\n * @property {boolean} allow_accept - Whether the human can accept/approve the current state\n */\nexport interface HumanInterruptConfig {\n allow_ignore: boolean;\n allow_respond: boolean;\n allow_edit: boolean;\n allow_accept: boolean;\n}\n/**\n * Represents a request for human action within the graph execution.\n * Contains the action type and any associated arguments needed for the action.\n *\n * @property {string} action - The type or name of action being requested (e.g., \"Approve XYZ action\")\n * @property {Record<string, any>} args - Key-value pairs of arguments needed for the action\n */\nexport interface ActionRequest {\n action: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args: Record<string, any>;\n}\n/**\n * Represents an interrupt triggered by the graph that requires human intervention.\n * This is passed to the `interrupt` function when execution is paused for human input.\n *\n * @property {ActionRequest} action_request - The specific action being requested from the human\n * @property {HumanInterruptConfig} config - Configuration defining what actions are allowed\n * @property {string} [description] - Optional detailed description of what input is needed\n */\nexport interface HumanInterrupt {\n action_request: ActionRequest;\n config: HumanInterruptConfig;\n description?: string;\n}\n/**\n * The response provided by a human to an interrupt, which is returned when graph execution resumes.\n *\n * @property {(\"accept\"|\"ignore\"|\"response\"|\"edit\")} type - The type of response:\n * - \"accept\": Approves the current state without changes\n * - \"ignore\": Skips/ignores the current step\n * - \"response\": Provides text feedback or instructions\n * - \"edit\": Modifies the current state/content\n * @property {null|string|ActionRequest} args - The response payload:\n * - null: For ignore/accept actions\n * - string: For text responses\n * - ActionRequest: For edit actions with updated content\n */\nexport type HumanResponse = {\n type: \"accept\" | \"ignore\" | \"response\" | \"edit\";\n args: null | string | ActionRequest;\n};\n"],"mappings":";;AASA;AAaA;AAaA;;;;;AAkBA;UA5CiBA,oBAAAA;;;;;;;;;;;;;UAaAC,aAAAA;;;QAGPC;;;;;;;;;;UAUOC,cAAAA;kBACGF;UACRD;;;;;;;;;;;;;;;;KAgBAI,aAAAA;;wBAEcH"}
@@ -1,61 +0,0 @@
1
- //#region src/prebuilt/interrupt.d.ts
2
- /**
3
- * Configuration interface that defines what actions are allowed for a human interrupt.
4
- * This controls the available interaction options when the graph is paused for human input.
5
- *
6
- * @property {boolean} allow_ignore - Whether the human can choose to ignore/skip the current step
7
- * @property {boolean} allow_respond - Whether the human can provide a text response/feedback
8
- * @property {boolean} allow_edit - Whether the human can edit the provided content/state
9
- * @property {boolean} allow_accept - Whether the human can accept/approve the current state
10
- */
11
- interface HumanInterruptConfig {
12
- allow_ignore: boolean;
13
- allow_respond: boolean;
14
- allow_edit: boolean;
15
- allow_accept: boolean;
16
- }
17
- /**
18
- * Represents a request for human action within the graph execution.
19
- * Contains the action type and any associated arguments needed for the action.
20
- *
21
- * @property {string} action - The type or name of action being requested (e.g., "Approve XYZ action")
22
- * @property {Record<string, any>} args - Key-value pairs of arguments needed for the action
23
- */
24
- interface ActionRequest {
25
- action: string;
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- args: Record<string, any>;
28
- }
29
- /**
30
- * Represents an interrupt triggered by the graph that requires human intervention.
31
- * This is passed to the `interrupt` function when execution is paused for human input.
32
- *
33
- * @property {ActionRequest} action_request - The specific action being requested from the human
34
- * @property {HumanInterruptConfig} config - Configuration defining what actions are allowed
35
- * @property {string} [description] - Optional detailed description of what input is needed
36
- */
37
- interface HumanInterrupt {
38
- action_request: ActionRequest;
39
- config: HumanInterruptConfig;
40
- description?: string;
41
- }
42
- /**
43
- * The response provided by a human to an interrupt, which is returned when graph execution resumes.
44
- *
45
- * @property {("accept"|"ignore"|"response"|"edit")} type - The type of response:
46
- * - "accept": Approves the current state without changes
47
- * - "ignore": Skips/ignores the current step
48
- * - "response": Provides text feedback or instructions
49
- * - "edit": Modifies the current state/content
50
- * @property {null|string|ActionRequest} args - The response payload:
51
- * - null: For ignore/accept actions
52
- * - string: For text responses
53
- * - ActionRequest: For edit actions with updated content
54
- */
55
- type HumanResponse = {
56
- type: "accept" | "ignore" | "response" | "edit";
57
- args: null | string | ActionRequest;
58
- };
59
- //#endregion
60
- export { ActionRequest, HumanInterrupt, HumanInterruptConfig, HumanResponse };
61
- //# sourceMappingURL=interrupt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interrupt.d.ts","names":["HumanInterruptConfig","ActionRequest","Record","HumanInterrupt","HumanResponse"],"sources":["../../src/prebuilt/interrupt.d.ts"],"sourcesContent":["/**\n * Configuration interface that defines what actions are allowed for a human interrupt.\n * This controls the available interaction options when the graph is paused for human input.\n *\n * @property {boolean} allow_ignore - Whether the human can choose to ignore/skip the current step\n * @property {boolean} allow_respond - Whether the human can provide a text response/feedback\n * @property {boolean} allow_edit - Whether the human can edit the provided content/state\n * @property {boolean} allow_accept - Whether the human can accept/approve the current state\n */\nexport interface HumanInterruptConfig {\n allow_ignore: boolean;\n allow_respond: boolean;\n allow_edit: boolean;\n allow_accept: boolean;\n}\n/**\n * Represents a request for human action within the graph execution.\n * Contains the action type and any associated arguments needed for the action.\n *\n * @property {string} action - The type or name of action being requested (e.g., \"Approve XYZ action\")\n * @property {Record<string, any>} args - Key-value pairs of arguments needed for the action\n */\nexport interface ActionRequest {\n action: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n args: Record<string, any>;\n}\n/**\n * Represents an interrupt triggered by the graph that requires human intervention.\n * This is passed to the `interrupt` function when execution is paused for human input.\n *\n * @property {ActionRequest} action_request - The specific action being requested from the human\n * @property {HumanInterruptConfig} config - Configuration defining what actions are allowed\n * @property {string} [description] - Optional detailed description of what input is needed\n */\nexport interface HumanInterrupt {\n action_request: ActionRequest;\n config: HumanInterruptConfig;\n description?: string;\n}\n/**\n * The response provided by a human to an interrupt, which is returned when graph execution resumes.\n *\n * @property {(\"accept\"|\"ignore\"|\"response\"|\"edit\")} type - The type of response:\n * - \"accept\": Approves the current state without changes\n * - \"ignore\": Skips/ignores the current step\n * - \"response\": Provides text feedback or instructions\n * - \"edit\": Modifies the current state/content\n * @property {null|string|ActionRequest} args - The response payload:\n * - null: For ignore/accept actions\n * - string: For text responses\n * - ActionRequest: For edit actions with updated content\n */\nexport type HumanResponse = {\n type: \"accept\" | \"ignore\" | \"response\" | \"edit\";\n args: null | string | ActionRequest;\n};\n"],"mappings":";;AASA;AAaA;AAaA;;;;;AAkBA;UA5CiBA,oBAAAA;;;;;;;;;;;;;UAaAC,aAAAA;;;QAGPC;;;;;;;;;;UAUOC,cAAAA;kBACGF;UACRD;;;;;;;;;;;;;;;;KAgBAI,aAAAA;;wBAEcH"}