@langchain/langgraph 0.4.8 → 1.0.0-alpha.0
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.
- package/CHANGELOG.md +7 -2
- package/README.md +1 -2
- package/dist/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/channels/any_value.d.cts +26 -0
- package/dist/channels/any_value.d.cts.map +1 -0
- package/dist/channels/any_value.d.ts +16 -9
- package/dist/channels/any_value.d.ts.map +1 -0
- package/dist/channels/base.cjs +97 -133
- package/dist/channels/base.cjs.map +1 -0
- package/dist/channels/base.d.cts +73 -0
- package/dist/channels/base.d.cts.map +1 -0
- package/dist/channels/base.d.ts +73 -74
- package/dist/channels/base.d.ts.map +1 -0
- package/dist/channels/base.js +94 -127
- package/dist/channels/base.js.map +1 -1
- package/dist/channels/binop.cjs +47 -77
- package/dist/channels/binop.cjs.map +1 -0
- package/dist/channels/binop.d.cts +22 -0
- package/dist/channels/binop.d.cts.map +1 -0
- package/dist/channels/binop.d.ts +17 -12
- package/dist/channels/binop.d.ts.map +1 -0
- package/dist/channels/binop.js +45 -71
- package/dist/channels/binop.js.map +1 -1
- package/dist/channels/dynamic_barrier_value.d.cts +43 -0
- package/dist/channels/dynamic_barrier_value.d.cts.map +1 -0
- package/dist/channels/dynamic_barrier_value.d.ts +20 -34
- package/dist/channels/dynamic_barrier_value.d.ts.map +1 -0
- package/dist/channels/ephemeral_value.cjs +46 -70
- package/dist/channels/ephemeral_value.cjs.map +1 -0
- package/dist/channels/ephemeral_value.d.cts +23 -0
- package/dist/channels/ephemeral_value.d.cts.map +1 -0
- package/dist/channels/ephemeral_value.d.ts +18 -11
- package/dist/channels/ephemeral_value.d.ts.map +1 -0
- package/dist/channels/ephemeral_value.js +45 -65
- package/dist/channels/ephemeral_value.js.map +1 -1
- package/dist/channels/index.cjs +2 -10
- package/dist/channels/index.js +4 -3
- package/dist/channels/last_value.cjs +91 -140
- package/dist/channels/last_value.cjs.map +1 -0
- package/dist/channels/last_value.d.cts +30 -0
- package/dist/channels/last_value.d.cts.map +1 -0
- package/dist/channels/last_value.d.ts +15 -23
- package/dist/channels/last_value.d.ts.map +1 -0
- package/dist/channels/last_value.js +88 -133
- package/dist/channels/last_value.js.map +1 -1
- package/dist/channels/named_barrier_value.cjs +114 -170
- package/dist/channels/named_barrier_value.cjs.map +1 -0
- package/dist/channels/named_barrier_value.d.cts +33 -0
- package/dist/channels/named_barrier_value.d.cts.map +1 -0
- package/dist/channels/named_barrier_value.d.ts +19 -29
- package/dist/channels/named_barrier_value.d.ts.map +1 -0
- package/dist/channels/named_barrier_value.js +112 -163
- package/dist/channels/named_barrier_value.js.map +1 -1
- package/dist/channels/topic.cjs +63 -96
- package/dist/channels/topic.cjs.map +1 -0
- package/dist/channels/topic.d.cts +26 -0
- package/dist/channels/topic.d.cts.map +1 -0
- package/dist/channels/topic.d.ts +21 -18
- package/dist/channels/topic.d.ts.map +1 -0
- package/dist/channels/topic.js +61 -90
- package/dist/channels/topic.js.map +1 -1
- package/dist/constants.cjs +373 -452
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +284 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.ts +112 -148
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +333 -444
- package/dist/constants.js.map +1 -1
- package/dist/errors.cjs +150 -179
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +80 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.ts +55 -46
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +139 -165
- package/dist/errors.js.map +1 -1
- package/dist/func/index.cjs +289 -290
- package/dist/func/index.cjs.map +1 -0
- package/dist/func/index.d.cts +289 -0
- package/dist/func/index.d.cts.map +1 -0
- package/dist/func/index.d.ts +81 -71
- package/dist/func/index.d.ts.map +1 -0
- package/dist/func/index.js +285 -284
- package/dist/func/index.js.map +1 -1
- package/dist/func/types.d.cts +64 -0
- package/dist/func/types.d.cts.map +1 -0
- package/dist/func/types.d.ts +24 -19
- package/dist/func/types.d.ts.map +1 -0
- package/dist/graph/annotation.cjs +96 -120
- package/dist/graph/annotation.cjs.map +1 -0
- package/dist/graph/annotation.d.cts +116 -0
- package/dist/graph/annotation.d.cts.map +1 -0
- package/dist/graph/annotation.d.ts +33 -34
- package/dist/graph/annotation.d.ts.map +1 -0
- package/dist/graph/annotation.js +91 -112
- package/dist/graph/annotation.js.map +1 -1
- package/dist/graph/graph.cjs +419 -723
- package/dist/graph/graph.cjs.map +1 -0
- package/dist/graph/graph.d.cts +131 -0
- package/dist/graph/graph.d.cts.map +1 -0
- package/dist/graph/graph.d.ts +122 -91
- package/dist/graph/graph.d.ts.map +1 -0
- package/dist/graph/graph.js +412 -713
- package/dist/graph/graph.js.map +1 -1
- package/dist/graph/index.cjs +4 -17
- package/dist/graph/index.js +6 -5
- package/dist/graph/message.cjs +59 -104
- package/dist/graph/message.cjs.map +1 -0
- package/dist/graph/message.d.cts +19 -0
- package/dist/graph/message.d.cts.map +1 -0
- package/dist/graph/message.d.ts +11 -10
- package/dist/graph/message.d.ts.map +1 -0
- package/dist/graph/message.js +56 -98
- package/dist/graph/message.js.map +1 -1
- package/dist/graph/messages_annotation.cjs +106 -106
- package/dist/graph/messages_annotation.cjs.map +1 -0
- package/dist/graph/messages_annotation.d.cts +111 -0
- package/dist/graph/messages_annotation.d.cts.map +1 -0
- package/dist/graph/messages_annotation.d.ts +18 -9
- package/dist/graph/messages_annotation.d.ts.map +1 -0
- package/dist/graph/messages_annotation.js +100 -100
- package/dist/graph/messages_annotation.js.map +1 -1
- package/dist/graph/state.cjs +476 -777
- package/dist/graph/state.cjs.map +1 -0
- package/dist/graph/state.d.cts +216 -0
- package/dist/graph/state.d.cts.map +1 -0
- package/dist/graph/state.d.ts +129 -134
- package/dist/graph/state.d.ts.map +1 -0
- package/dist/graph/state.js +470 -768
- package/dist/graph/state.js.map +1 -1
- package/dist/graph/zod/index.cjs +10 -21
- package/dist/graph/zod/index.d.cts +3 -0
- package/dist/graph/zod/index.d.ts +3 -3
- package/dist/graph/zod/index.js +4 -4
- package/dist/graph/zod/meta.cjs +142 -177
- package/dist/graph/zod/meta.cjs.map +1 -0
- package/dist/graph/zod/meta.d.cts +116 -0
- package/dist/graph/zod/meta.d.cts.map +1 -0
- package/dist/graph/zod/meta.d.ts +99 -97
- package/dist/graph/zod/meta.d.ts.map +1 -0
- package/dist/graph/zod/meta.js +136 -170
- package/dist/graph/zod/meta.js.map +1 -1
- package/dist/graph/zod/plugin.cjs +36 -39
- package/dist/graph/zod/plugin.cjs.map +1 -0
- package/dist/graph/zod/plugin.js +34 -35
- package/dist/graph/zod/plugin.js.map +1 -1
- package/dist/graph/zod/schema.cjs +82 -110
- package/dist/graph/zod/schema.cjs.map +1 -0
- package/dist/graph/zod/schema.d.cts +38 -0
- package/dist/graph/zod/schema.d.cts.map +1 -0
- package/dist/graph/zod/schema.d.ts +12 -6
- package/dist/graph/zod/schema.d.ts.map +1 -0
- package/dist/graph/zod/schema.js +77 -103
- package/dist/graph/zod/schema.js.map +1 -1
- package/dist/graph/zod/zod-registry.cjs +41 -47
- package/dist/graph/zod/zod-registry.cjs.map +1 -0
- package/dist/graph/zod/zod-registry.d.cts +51 -0
- package/dist/graph/zod/zod-registry.d.cts.map +1 -0
- package/dist/graph/zod/zod-registry.d.ts +34 -26
- package/dist/graph/zod/zod-registry.d.ts.map +1 -0
- package/dist/graph/zod/zod-registry.js +37 -41
- package/dist/graph/zod/zod-registry.js.map +1 -1
- package/dist/hash.cjs +205 -267
- package/dist/hash.cjs.map +1 -0
- package/dist/hash.js +205 -265
- package/dist/hash.js.map +1 -1
- package/dist/index.cjs +110 -33
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +25 -0
- package/dist/index.d.ts +25 -5
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/interrupt.cjs +79 -85
- package/dist/interrupt.cjs.map +1 -0
- package/dist/interrupt.d.cts +49 -0
- package/dist/interrupt.d.cts.map +1 -0
- package/dist/interrupt.d.ts +6 -1
- package/dist/interrupt.d.ts.map +1 -0
- package/dist/interrupt.js +76 -80
- package/dist/interrupt.js.map +1 -1
- package/dist/prebuilt/agentName.cjs +139 -172
- package/dist/prebuilt/agentName.cjs.map +1 -0
- package/dist/prebuilt/agentName.d.cts +42 -0
- package/dist/prebuilt/agentName.d.cts.map +1 -0
- package/dist/prebuilt/agentName.d.ts +13 -21
- package/dist/prebuilt/agentName.d.ts.map +1 -0
- package/dist/prebuilt/agentName.js +139 -168
- package/dist/prebuilt/agentName.js.map +1 -1
- package/dist/prebuilt/agent_executor.cjs +42 -80
- package/dist/prebuilt/agent_executor.cjs.map +1 -0
- package/dist/prebuilt/agent_executor.d.cts +57 -0
- package/dist/prebuilt/agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/agent_executor.d.ts +46 -37
- package/dist/prebuilt/agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/agent_executor.js +40 -75
- package/dist/prebuilt/agent_executor.js.map +1 -1
- package/dist/prebuilt/chat_agent_executor.cjs +66 -128
- package/dist/prebuilt/chat_agent_executor.cjs.map +1 -0
- package/dist/prebuilt/chat_agent_executor.d.cts +23 -0
- package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/chat_agent_executor.d.ts +18 -10
- package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/chat_agent_executor.js +63 -123
- package/dist/prebuilt/chat_agent_executor.js.map +1 -1
- package/dist/prebuilt/index.cjs +15 -18
- package/dist/prebuilt/index.d.cts +8 -0
- package/dist/prebuilt/index.d.ts +8 -8
- package/dist/prebuilt/index.js +8 -7
- package/dist/prebuilt/interrupt.d.cts +73 -0
- package/dist/prebuilt/interrupt.d.cts.map +1 -0
- package/dist/prebuilt/interrupt.d.ts +32 -15
- package/dist/prebuilt/interrupt.d.ts.map +1 -0
- package/dist/prebuilt/react_agent_executor.cjs +317 -473
- package/dist/prebuilt/react_agent_executor.cjs.map +1 -0
- package/dist/prebuilt/react_agent_executor.d.cts +229 -0
- package/dist/prebuilt/react_agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/react_agent_executor.d.ts +171 -143
- package/dist/prebuilt/react_agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/react_agent_executor.js +315 -465
- package/dist/prebuilt/react_agent_executor.js.map +1 -1
- package/dist/prebuilt/tool_executor.cjs +45 -67
- package/dist/prebuilt/tool_executor.cjs.map +1 -0
- package/dist/prebuilt/tool_executor.d.cts +42 -0
- package/dist/prebuilt/tool_executor.d.cts.map +1 -0
- package/dist/prebuilt/tool_executor.d.ts +30 -24
- package/dist/prebuilt/tool_executor.d.ts.map +1 -0
- package/dist/prebuilt/tool_executor.js +44 -63
- package/dist/prebuilt/tool_executor.js.map +1 -1
- package/dist/prebuilt/tool_node.cjs +213 -275
- package/dist/prebuilt/tool_node.cjs.map +1 -0
- package/dist/prebuilt/tool_node.d.cts +151 -0
- package/dist/prebuilt/tool_node.d.cts.map +1 -0
- package/dist/prebuilt/tool_node.d.ts +30 -17
- package/dist/prebuilt/tool_node.d.ts.map +1 -0
- package/dist/prebuilt/tool_node.js +209 -268
- package/dist/prebuilt/tool_node.js.map +1 -1
- package/dist/pregel/algo.cjs +521 -692
- package/dist/pregel/algo.cjs.map +1 -0
- package/dist/pregel/algo.d.cts +13 -0
- package/dist/pregel/algo.d.cts.map +1 -0
- package/dist/pregel/algo.d.ts +8 -38
- package/dist/pregel/algo.d.ts.map +1 -0
- package/dist/pregel/algo.js +516 -683
- package/dist/pregel/algo.js.map +1 -1
- package/dist/pregel/call.cjs +46 -42
- package/dist/pregel/call.cjs.map +1 -0
- package/dist/pregel/call.js +43 -37
- package/dist/pregel/call.js.map +1 -1
- package/dist/pregel/debug.cjs +153 -223
- package/dist/pregel/debug.cjs.map +1 -0
- package/dist/pregel/debug.js +152 -215
- package/dist/pregel/debug.js.map +1 -1
- package/dist/pregel/index.cjs +1134 -1604
- package/dist/pregel/index.cjs.map +1 -0
- package/dist/pregel/index.d.cts +534 -0
- package/dist/pregel/index.d.cts.map +1 -0
- package/dist/pregel/index.d.ts +458 -422
- package/dist/pregel/index.d.ts.map +1 -0
- package/dist/pregel/index.js +1125 -1592
- package/dist/pregel/index.js.map +1 -1
- package/dist/pregel/io.cjs +127 -234
- package/dist/pregel/io.cjs.map +1 -0
- package/dist/pregel/io.js +122 -225
- package/dist/pregel/io.js.map +1 -1
- package/dist/pregel/loop.cjs +539 -954
- package/dist/pregel/loop.cjs.map +1 -0
- package/dist/pregel/loop.js +536 -948
- package/dist/pregel/loop.js.map +1 -1
- package/dist/pregel/messages.cjs +104 -196
- package/dist/pregel/messages.cjs.map +1 -0
- package/dist/pregel/messages.js +102 -191
- package/dist/pregel/messages.js.map +1 -1
- package/dist/pregel/read.cjs +150 -280
- package/dist/pregel/read.cjs.map +1 -0
- package/dist/pregel/read.d.cts +51 -0
- package/dist/pregel/read.d.cts.map +1 -0
- package/dist/pregel/read.d.ts +48 -46
- package/dist/pregel/read.d.ts.map +1 -0
- package/dist/pregel/read.js +147 -274
- package/dist/pregel/read.js.map +1 -1
- package/dist/pregel/remote.cjs +339 -458
- package/dist/pregel/remote.cjs.map +1 -0
- package/dist/pregel/remote.d.cts +121 -0
- package/dist/pregel/remote.d.cts.map +1 -0
- package/dist/pregel/remote.d.ts +79 -69
- package/dist/pregel/remote.d.ts.map +1 -0
- package/dist/pregel/remote.js +337 -453
- package/dist/pregel/remote.js.map +1 -1
- package/dist/pregel/retry.cjs +87 -138
- package/dist/pregel/retry.cjs.map +1 -0
- package/dist/pregel/retry.js +83 -130
- package/dist/pregel/retry.js.map +1 -1
- package/dist/pregel/runnable_types.d.cts +25 -0
- package/dist/pregel/runnable_types.d.cts.map +1 -0
- package/dist/pregel/runnable_types.d.ts +22 -16
- package/dist/pregel/runnable_types.d.ts.map +1 -0
- package/dist/pregel/runner.cjs +222 -315
- package/dist/pregel/runner.cjs.map +1 -0
- package/dist/pregel/runner.js +219 -308
- package/dist/pregel/runner.js.map +1 -1
- package/dist/pregel/stream.cjs +89 -130
- package/dist/pregel/stream.cjs.map +1 -0
- package/dist/pregel/stream.js +87 -125
- package/dist/pregel/stream.js.map +1 -1
- package/dist/pregel/types.cjs +25 -62
- package/dist/pregel/types.cjs.map +1 -0
- package/dist/pregel/types.d.cts +437 -0
- package/dist/pregel/types.d.cts.map +1 -0
- package/dist/pregel/types.d.ts +377 -431
- package/dist/pregel/types.d.ts.map +1 -0
- package/dist/pregel/types.js +23 -57
- package/dist/pregel/types.js.map +1 -1
- package/dist/pregel/utils/config.cjs +100 -147
- package/dist/pregel/utils/config.cjs.map +1 -0
- package/dist/pregel/utils/config.d.cts +36 -0
- package/dist/pregel/utils/config.d.cts.map +1 -0
- package/dist/pregel/utils/config.d.ts +12 -9
- package/dist/pregel/utils/config.d.ts.map +1 -0
- package/dist/pregel/utils/config.js +98 -143
- package/dist/pregel/utils/config.js.map +1 -1
- package/dist/pregel/utils/index.cjs +87 -125
- package/dist/pregel/utils/index.cjs.map +1 -0
- package/dist/pregel/utils/index.d.cts +51 -0
- package/dist/pregel/utils/index.d.cts.map +1 -0
- package/dist/pregel/utils/index.d.ts +45 -61
- package/dist/pregel/utils/index.d.ts.map +1 -0
- package/dist/pregel/utils/index.js +86 -120
- package/dist/pregel/utils/index.js.map +1 -1
- package/dist/pregel/utils/subgraph.cjs +15 -26
- package/dist/pregel/utils/subgraph.cjs.map +1 -0
- package/dist/pregel/utils/subgraph.js +12 -21
- package/dist/pregel/utils/subgraph.js.map +1 -1
- package/dist/pregel/validate.cjs +42 -92
- package/dist/pregel/validate.cjs.map +1 -0
- package/dist/pregel/validate.js +39 -84
- package/dist/pregel/validate.js.map +1 -1
- package/dist/pregel/write.cjs +87 -137
- package/dist/pregel/write.cjs.map +1 -0
- package/dist/pregel/write.d.cts +35 -0
- package/dist/pregel/write.d.cts.map +1 -0
- package/dist/pregel/write.d.ts +27 -23
- package/dist/pregel/write.d.ts.map +1 -0
- package/dist/pregel/write.js +83 -131
- package/dist/pregel/write.js.map +1 -1
- package/dist/remote.cjs +3 -6
- package/dist/remote.d.cts +2 -0
- package/dist/remote.d.ts +2 -1
- package/dist/remote.js +3 -2
- package/dist/setup/async_local_storage.cjs +10 -7
- package/dist/setup/async_local_storage.cjs.map +1 -0
- package/dist/setup/async_local_storage.js +7 -2
- package/dist/setup/async_local_storage.js.map +1 -1
- package/dist/ui/index.cjs +4 -0
- package/dist/ui/index.d.cts +5 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/stream.cjs +145 -0
- package/dist/ui/stream.cjs.map +1 -0
- package/dist/ui/stream.d.cts +25 -0
- package/dist/ui/stream.d.cts.map +1 -0
- package/dist/ui/stream.d.ts +25 -0
- package/dist/ui/stream.d.ts.map +1 -0
- package/dist/ui/stream.js +143 -0
- package/dist/ui/stream.js.map +1 -0
- package/dist/ui/types.infer.d.cts +53 -0
- package/dist/ui/types.infer.d.cts.map +1 -0
- package/dist/ui/types.infer.d.ts +53 -0
- package/dist/ui/types.infer.d.ts.map +1 -0
- package/dist/ui/types.message.d.cts +95 -0
- package/dist/ui/types.message.d.cts.map +1 -0
- package/dist/ui/types.message.d.ts +95 -0
- package/dist/ui/types.message.d.ts.map +1 -0
- package/dist/ui/types.schema.d.cts +228 -0
- package/dist/ui/types.schema.d.cts.map +1 -0
- package/dist/ui/types.schema.d.ts +228 -0
- package/dist/ui/types.schema.d.ts.map +1 -0
- package/dist/utils.cjs +77 -147
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +32 -0
- package/dist/utils.d.cts.map +1 -0
- package/dist/utils.d.ts +29 -25
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +73 -140
- package/dist/utils.js.map +1 -1
- package/dist/web.cjs +97 -55
- package/dist/web.d.cts +23 -0
- package/dist/web.d.ts +23 -14
- package/dist/web.js +15 -8
- package/package.json +83 -86
- package/dist/channels/any_value.cjs +0 -65
- package/dist/channels/any_value.js +0 -61
- package/dist/channels/any_value.js.map +0 -1
- package/dist/channels/dynamic_barrier_value.cjs +0 -212
- package/dist/channels/dynamic_barrier_value.js +0 -207
- package/dist/channels/dynamic_barrier_value.js.map +0 -1
- package/dist/channels/index.d.ts +0 -7
- package/dist/channels/index.js.map +0 -1
- package/dist/func/types.cjs +0 -15
- package/dist/func/types.js +0 -12
- package/dist/func/types.js.map +0 -1
- package/dist/graph/index.d.ts +0 -4
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/message.test.cjs +0 -196
- package/dist/graph/message.test.d.ts +0 -1
- package/dist/graph/message.test.js +0 -194
- package/dist/graph/message.test.js.map +0 -1
- package/dist/graph/zod/index.js.map +0 -1
- package/dist/graph/zod/plugin.d.ts +0 -28
- package/dist/hash.d.ts +0 -2
- package/dist/prebuilt/index.js.map +0 -1
- package/dist/prebuilt/interrupt.cjs +0 -3
- package/dist/prebuilt/interrupt.js +0 -2
- package/dist/prebuilt/interrupt.js.map +0 -1
- package/dist/pregel/call.d.ts +0 -16
- package/dist/pregel/debug.d.ts +0 -41
- package/dist/pregel/debug.test.cjs +0 -258
- package/dist/pregel/debug.test.d.ts +0 -1
- package/dist/pregel/debug.test.js +0 -256
- package/dist/pregel/debug.test.js.map +0 -1
- package/dist/pregel/io.d.ts +0 -30
- package/dist/pregel/io.mapCommand.test.cjs +0 -150
- package/dist/pregel/io.mapCommand.test.d.ts +0 -1
- package/dist/pregel/io.mapCommand.test.js +0 -148
- package/dist/pregel/io.mapCommand.test.js.map +0 -1
- package/dist/pregel/loop.d.ts +0 -147
- package/dist/pregel/messages.d.ts +0 -30
- package/dist/pregel/messages.test.cjs +0 -369
- package/dist/pregel/messages.test.d.ts +0 -1
- package/dist/pregel/messages.test.js +0 -367
- package/dist/pregel/messages.test.js.map +0 -1
- package/dist/pregel/read.test.cjs +0 -194
- package/dist/pregel/read.test.d.ts +0 -1
- package/dist/pregel/read.test.js +0 -192
- package/dist/pregel/read.test.js.map +0 -1
- package/dist/pregel/retry.d.ts +0 -17
- package/dist/pregel/runnable_types.cjs +0 -3
- package/dist/pregel/runnable_types.js +0 -2
- package/dist/pregel/runnable_types.js.map +0 -1
- package/dist/pregel/runner.d.ts +0 -79
- package/dist/pregel/runner.test.cjs +0 -66
- package/dist/pregel/runner.test.d.ts +0 -1
- package/dist/pregel/runner.test.js +0 -64
- package/dist/pregel/runner.test.js.map +0 -1
- package/dist/pregel/stream.d.ts +0 -40
- package/dist/pregel/utils/config.test.cjs +0 -214
- package/dist/pregel/utils/config.test.d.ts +0 -1
- package/dist/pregel/utils/config.test.js +0 -212
- package/dist/pregel/utils/config.test.js.map +0 -1
- package/dist/pregel/utils/subgraph.d.ts +0 -4
- package/dist/pregel/utils/subgraph.test.cjs +0 -83
- package/dist/pregel/utils/subgraph.test.d.ts +0 -1
- package/dist/pregel/utils/subgraph.test.js +0 -81
- package/dist/pregel/utils/subgraph.test.js.map +0 -1
- package/dist/pregel/validate.d.ts +0 -16
- package/dist/pregel/validate.test.cjs +0 -220
- package/dist/pregel/validate.test.d.ts +0 -1
- package/dist/pregel/validate.test.js +0 -218
- package/dist/pregel/validate.test.js.map +0 -1
- package/dist/pregel/write.test.cjs +0 -181
- package/dist/pregel/write.test.d.ts +0 -1
- package/dist/pregel/write.test.js +0 -179
- package/dist/pregel/write.test.js.map +0 -1
- package/dist/remote.js.map +0 -1
- package/dist/setup/async_local_storage.d.ts +0 -1
- package/dist/web.js.map +0 -1
- package/index.cjs +0 -1
- package/index.d.cts +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/prebuilt.cjs +0 -1
- package/prebuilt.d.cts +0 -1
- package/prebuilt.d.ts +0 -1
- package/prebuilt.js +0 -1
- package/pregel.cjs +0 -1
- package/pregel.d.cts +0 -1
- package/pregel.d.ts +0 -1
- package/pregel.js +0 -1
- package/remote.cjs +0 -1
- package/remote.d.cts +0 -1
- package/remote.d.ts +0 -1
- package/remote.js +0 -1
- package/web.cjs +0 -1
- package/web.d.cts +0 -1
- package/web.d.ts +0 -1
- package/web.js +0 -1
- package/zod/schema.cjs +0 -1
- package/zod/schema.d.cts +0 -1
- package/zod/schema.d.ts +0 -1
- package/zod/schema.js +0 -1
- package/zod.cjs +0 -1
- package/zod.d.cts +0 -1
- package/zod.d.ts +0 -1
- package/zod.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent_executor.d.cts","names":["AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","___web_js0","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[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage[] | 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[] | undefined, BaseMessage[] | 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[] | undefined, BaseMessage[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}>;\nexport {};\n"],"mappings":";;;;;;;;;;UAMUO,IAAAA;UACEP,cAAcC;;;AAF6B;AACzC,UAKGO,kBAAAA,CALH;cACFR,CAAAA,EAKOA,WALPA,GAKqBC,WALrBD;OAAcC,EAMfQ,KANeR,CAMTM,IANSN,CAAAA;;EAITO,WAAAA,CAAAA,EAICN,WAJiB,EAAA;;;AACFD,iBAMTS,mBAAAA,CANST;EAAAA,aAAAA;EAAAA;CAAAA,EAAAA;eAChBM,EAMEJ,QANFI;OAANE,EAOAA,KAPAA,CAOML,IAPNK,CAAAA,GAOcJ,YAPdI;sBAEOP,CAAAA;iBAOCF,cAAcC;EAJTS,KAAAA,EAKbH,IALaG,EAAAA;EAAmB,KAAA,EAAA,MAAA;aAAGC,CAAAA,EAO5BT,WAP4BS,EAAAA,GAAAA,SAAAA;;cAC3BR,CAAAA,EAQAH,WARAG,GAQcF,WARdE,GAAAA,SAAAA;OACFC,CAAAA,EAQLG,IARKH,EAAAA,GAAAA,SAAAA;OAANK,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;aAAcJ,CAAAA,EAUPH,WAVOG,EAAAA,GAAAA,SAAAA;cAENL,GAAAA,QAAAA,GAAAA,OAAAA,EAAAA;cAAcC,CAAAA,EAUdK,WAVcL,CAUFD,WAVEC,GAUYA,WAVZA,GAAAA,SAAAA,EAUqCD,WAVrCC,GAUmDA,WAVnDA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;OACtBM,EAUAD,WAVAC,CAUYA,IAVZA,EAAAA,EAUoBA,IAVpBA,EAAAA,EAAAA,OAAAA,CAAAA;OAEOL,EASPI,WATOJ,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA;aAECF,CAAAA,EAQDM,WARCN,CAQWE,WARXF,EAAAA,GAAAA,SAAAA,EAQsCE,WARtCF,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;;cACPO,CAAAA,EASOD,WATPC,CASmBP,WATnBO,GASiCN,WATjCM,GAAAA,SAAAA,EAS0DP,WAT1DO,GASwEN,WATxEM,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;OAEML,EAQPI,WAROJ,CAQKK,IARLL,EAAAA,EAQaK,IARbL,EAAAA,EAAAA,OAAAA,CAAAA;OAEaF,EAOpBM,WAPoBN,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA;aAAcC,CAAAA,EAQ3BK,WAR2BL,CAQfC,WAReD,EAAAA,GAAAA,SAAAA,EAQYC,WARZD,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;oBAAyBD;QAAcC,EAUxEc,OAVwEd,CAUhEO,kBAVgEP,CAAAA;OAAjEK,EAAAA;IACIC,YAAAA,EAAAA,GAAAA"}
|
|
@@ -1,48 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { BaseChannel } from "../channels/base.js";
|
|
2
|
+
import { StateDefinition } from "../graph/annotation.js";
|
|
3
|
+
import { CompiledStateGraph } from "../graph/state.js";
|
|
4
|
+
import { ToolExecutor } from "./tool_executor.js";
|
|
3
5
|
import { Runnable } from "@langchain/core/runnables";
|
|
6
|
+
import { BaseMessage } from "@langchain/core/messages";
|
|
7
|
+
import { AgentAction, AgentFinish } from "@langchain/core/agents";
|
|
4
8
|
import { Tool } from "@langchain/core/tools";
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
|
|
10
|
+
//#region src/prebuilt/agent_executor.d.ts
|
|
7
11
|
interface Step {
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
action: AgentAction | AgentFinish;
|
|
13
|
+
observation: unknown;
|
|
10
14
|
}
|
|
11
15
|
/** @ignore */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
interface AgentExecutorState {
|
|
17
|
+
agentOutcome?: AgentAction | AgentFinish;
|
|
18
|
+
steps: Array<Step>;
|
|
19
|
+
input: string;
|
|
20
|
+
chatHistory?: BaseMessage[];
|
|
17
21
|
}
|
|
18
22
|
/** @ignore */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
declare function createAgentExecutor({
|
|
24
|
+
agentRunnable,
|
|
25
|
+
tools
|
|
26
|
+
}: {
|
|
27
|
+
agentRunnable: Runnable;
|
|
28
|
+
tools: Array<Tool> | ToolExecutor;
|
|
29
|
+
}): CompiledStateGraph<{
|
|
30
|
+
agentOutcome?: AgentAction | AgentFinish | undefined;
|
|
31
|
+
steps: Step[];
|
|
32
|
+
input: string;
|
|
33
|
+
chatHistory?: BaseMessage[] | undefined;
|
|
27
34
|
}, {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
agentOutcome?: AgentAction | AgentFinish | undefined;
|
|
36
|
+
steps?: Step[] | undefined;
|
|
37
|
+
input?: string | undefined;
|
|
38
|
+
chatHistory?: BaseMessage[] | undefined;
|
|
32
39
|
}, "__start__" | "action" | "agent", {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
|
|
41
|
+
steps: BaseChannel<Step[], Step[], unknown>;
|
|
42
|
+
input: BaseChannel<string, string, unknown>;
|
|
43
|
+
chatHistory?: BaseChannel<BaseMessage[] | undefined, BaseMessage[] | undefined, unknown> | undefined;
|
|
37
44
|
}, {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
|
|
46
|
+
steps: BaseChannel<Step[], Step[], unknown>;
|
|
47
|
+
input: BaseChannel<string, string, unknown>;
|
|
48
|
+
chatHistory?: BaseChannel<BaseMessage[] | undefined, BaseMessage[] | undefined, unknown> | undefined;
|
|
49
|
+
}, StateDefinition, {
|
|
50
|
+
action: Partial<AgentExecutorState>;
|
|
51
|
+
agent: {
|
|
52
|
+
agentOutcome: any;
|
|
53
|
+
};
|
|
47
54
|
}>;
|
|
48
|
-
|
|
55
|
+
//#endregion
|
|
56
|
+
export { AgentExecutorState, createAgentExecutor };
|
|
57
|
+
//# sourceMappingURL=agent_executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent_executor.d.ts","names":["AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","___web_js0","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[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage[] | 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[] | undefined, BaseMessage[] | 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[] | undefined, BaseMessage[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}>;\nexport {};\n"],"mappings":";;;;;;;;;;UAMUO,IAAAA;UACEP,cAAcC;;;AAF6B;AACzC,UAKGO,kBAAAA,CALH;cACFR,CAAAA,EAKOA,WALPA,GAKqBC,WALrBD;OAAcC,EAMfQ,KANeR,CAMTM,IANSN,CAAAA;;EAITO,WAAAA,CAAAA,EAICN,WAJiB,EAAA;;;AACFD,iBAMTS,mBAAAA,CANST;EAAAA,aAAAA;EAAAA;CAAAA,EAAAA;eAChBM,EAMEJ,QANFI;OAANE,EAOAA,KAPAA,CAOML,IAPNK,CAAAA,GAOcJ,YAPdI;sBAEOP,CAAAA;iBAOCF,cAAcC;EAJTS,KAAAA,EAKbH,IALaG,EAAAA;EAAmB,KAAA,EAAA,MAAA;aAAGC,CAAAA,EAO5BT,WAP4BS,EAAAA,GAAAA,SAAAA;;cAC3BR,CAAAA,EAQAH,WARAG,GAQcF,WARdE,GAAAA,SAAAA;OACFC,CAAAA,EAQLG,IARKH,EAAAA,GAAAA,SAAAA;OAANK,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;aAAcJ,CAAAA,EAUPH,WAVOG,EAAAA,GAAAA,SAAAA;cAENL,GAAAA,QAAAA,GAAAA,OAAAA,EAAAA;cAAcC,CAAAA,EAUdK,WAVcL,CAUFD,WAVEC,GAUYA,WAVZA,GAAAA,SAAAA,EAUqCD,WAVrCC,GAUmDA,WAVnDA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;OACtBM,EAUAD,WAVAC,CAUYA,IAVZA,EAAAA,EAUoBA,IAVpBA,EAAAA,EAAAA,OAAAA,CAAAA;OAEOL,EASPI,WATOJ,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA;aAECF,CAAAA,EAQDM,WARCN,CAQWE,WARXF,EAAAA,GAAAA,SAAAA,EAQsCE,WARtCF,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;;cACPO,CAAAA,EASOD,WATPC,CASmBP,WATnBO,GASiCN,WATjCM,GAAAA,SAAAA,EAS0DP,WAT1DO,GASwEN,WATxEM,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;OAEML,EAQPI,WAROJ,CAQKK,IARLL,EAAAA,EAQaK,IARbL,EAAAA,EAAAA,OAAAA,CAAAA;OAEaF,EAOpBM,WAPoBN,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA;aAAcC,CAAAA,EAQ3BK,WAR2BL,CAQfC,WAReD,EAAAA,GAAAA,SAAAA,EAQYC,WARZD,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;oBAAyBD;QAAcC,EAUxEc,OAVwEd,CAUhEO,kBAVgEP,CAAAA;OAAjEK,EAAAA;IACIC,YAAAA,EAAAA,GAAAA"}
|
|
@@ -1,79 +1,44 @@
|
|
|
1
|
-
import { ToolExecutor } from "./tool_executor.js";
|
|
2
|
-
import { StateGraph } from "../graph/state.js";
|
|
3
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
|
|
4
6
|
/** @ignore */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// Define a new graph
|
|
39
|
-
const workflow = new StateGraph({
|
|
40
|
-
channels: {
|
|
41
|
-
input: null,
|
|
42
|
-
agentOutcome: null,
|
|
43
|
-
steps: {
|
|
44
|
-
reducer: (x, y) => x.concat(y),
|
|
45
|
-
default: () => [],
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
})
|
|
49
|
-
// Define the two nodes we will cycle between
|
|
50
|
-
.addNode("agent", runAgent)
|
|
51
|
-
.addNode("action", executeTools)
|
|
52
|
-
// Set the entrypoint as `agent`
|
|
53
|
-
// This means that this node is the first one called
|
|
54
|
-
.addEdge(START, "agent")
|
|
55
|
-
// We now add a conditional edge
|
|
56
|
-
.addConditionalEdges(
|
|
57
|
-
// First, we define the start node. We use `agent`.
|
|
58
|
-
// This means these are the edges taken after the `agent` node is called.
|
|
59
|
-
"agent",
|
|
60
|
-
// Next, we pass in the function that will determine which node is called next.
|
|
61
|
-
shouldContinue,
|
|
62
|
-
// Finally we pass in a mapping.
|
|
63
|
-
// The keys are strings, and the values are other nodes.
|
|
64
|
-
// END is a special node marking that the graph should finish.
|
|
65
|
-
// What will happen is we will call `should_continue`, and then the output of that
|
|
66
|
-
// will be matched against the keys in this mapping.
|
|
67
|
-
// Based on which one it matches, that node will then be called.
|
|
68
|
-
{
|
|
69
|
-
// If `tools`, then we call the tool node.
|
|
70
|
-
continue: "action",
|
|
71
|
-
// Otherwise we finish.
|
|
72
|
-
end: END,
|
|
73
|
-
})
|
|
74
|
-
// We now add a normal edge from `tools` to `agent`.
|
|
75
|
-
// This means that after `tools` is called, `agent` node is called next.
|
|
76
|
-
.addEdge("action", "agent");
|
|
77
|
-
return workflow.compile();
|
|
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();
|
|
78
40
|
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { createAgentExecutor };
|
|
79
44
|
//# sourceMappingURL=agent_executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_executor.js","
|
|
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,130 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
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
10
|
/** @deprecated Use {@link createReactAgent} instead with tool calling. */
|
|
11
|
-
function createFunctionCallingExecutor({ model, tools
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// We construct an AgentAction from the function_call
|
|
65
|
-
return {
|
|
66
|
-
tool: lastMessage.additional_kwargs.function_call.name,
|
|
67
|
-
toolInput: JSON.stringify(lastMessage.additional_kwargs.function_call.arguments),
|
|
68
|
-
log: "",
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
const callTool = async (state, config) => {
|
|
72
|
-
const action = _getAction(state);
|
|
73
|
-
// We call the tool_executor and get back a response
|
|
74
|
-
const response = await toolExecutor.invoke(action, config);
|
|
75
|
-
// We use the response to create a FunctionMessage
|
|
76
|
-
const functionMessage = new messages_1.FunctionMessage({
|
|
77
|
-
content: response,
|
|
78
|
-
name: action.tool,
|
|
79
|
-
});
|
|
80
|
-
// We return a list, because this will get added to the existing list
|
|
81
|
-
return { messages: [functionMessage] };
|
|
82
|
-
};
|
|
83
|
-
// We create the AgentState that we will pass around
|
|
84
|
-
// This simply involves a list of messages
|
|
85
|
-
// We want steps to return messages to append to the list
|
|
86
|
-
// So we annotate the messages attribute with operator.add
|
|
87
|
-
const schema = {
|
|
88
|
-
messages: {
|
|
89
|
-
value: (x, y) => x.concat(y),
|
|
90
|
-
default: () => [],
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
// Define a new graph
|
|
94
|
-
const workflow = new state_js_1.StateGraph({
|
|
95
|
-
channels: schema,
|
|
96
|
-
})
|
|
97
|
-
// Define the two nodes we will cycle between
|
|
98
|
-
.addNode("agent", new runnables_1.RunnableLambda({ func: callModel }))
|
|
99
|
-
.addNode("action", new runnables_1.RunnableLambda({ func: callTool }))
|
|
100
|
-
// Set the entrypoint as `agent`
|
|
101
|
-
// This means that this node is the first one called
|
|
102
|
-
.addEdge(constants_js_1.START, "agent")
|
|
103
|
-
// We now add a conditional edge
|
|
104
|
-
.addConditionalEdges(
|
|
105
|
-
// First, we define the start node. We use `agent`.
|
|
106
|
-
// This means these are the edges taken after the `agent` node is called.
|
|
107
|
-
"agent",
|
|
108
|
-
// Next, we pass in the function that will determine which node is called next.
|
|
109
|
-
shouldContinue,
|
|
110
|
-
// Finally we pass in a mapping.
|
|
111
|
-
// The keys are strings, and the values are other nodes.
|
|
112
|
-
// END is a special node marking that the graph should finish.
|
|
113
|
-
// What will happen is we will call `should_continue`, and then the output of that
|
|
114
|
-
// will be matched against the keys in this mapping.
|
|
115
|
-
// Based on which one it matches, that node will then be called.
|
|
116
|
-
{
|
|
117
|
-
// If `tools`, then we call the tool node.
|
|
118
|
-
continue: "action",
|
|
119
|
-
// Otherwise we finish.
|
|
120
|
-
end: constants_js_1.END,
|
|
121
|
-
})
|
|
122
|
-
// We now add a normal edge from `tools` to `agent`.
|
|
123
|
-
// This means that after `tools` is called, `agent` node is called next.
|
|
124
|
-
.addEdge("action", "agent");
|
|
125
|
-
// Finally, we compile it!
|
|
126
|
-
// This compiles it into a LangChain Runnable,
|
|
127
|
-
// meaning you can use it as you would any other runnable
|
|
128
|
-
return workflow.compile();
|
|
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();
|
|
129
64
|
}
|
|
130
|
-
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
exports.createFunctionCallingExecutor = createFunctionCallingExecutor;
|
|
68
|
+
//# sourceMappingURL=chat_agent_executor.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,15 +1,23 @@
|
|
|
1
|
-
import { StructuredToolInterface } from "@langchain/core/tools";
|
|
2
|
-
import { BaseMessage } from "@langchain/core/messages";
|
|
3
|
-
import { RunnableToolLike } from "@langchain/core/runnables";
|
|
4
|
-
import { ToolExecutor } from "./tool_executor.js";
|
|
5
|
-
import { CompiledStateGraph } from "../graph/state.js";
|
|
6
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
|
|
7
9
|
/** @deprecated Use {@link createReactAgent} instead with tool calling. */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
type FunctionCallingExecutorState = {
|
|
11
|
+
messages: Array<BaseMessage>;
|
|
10
12
|
};
|
|
11
13
|
/** @deprecated Use {@link createReactAgent} instead with tool calling. */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
declare function createFunctionCallingExecutor<Model extends object>({
|
|
15
|
+
model,
|
|
16
|
+
tools
|
|
17
|
+
}: {
|
|
18
|
+
model: Model;
|
|
19
|
+
tools: Array<StructuredToolInterface | RunnableToolLike> | ToolExecutor;
|
|
15
20
|
}): CompiledStateGraph<FunctionCallingExecutorState, Partial<FunctionCallingExecutorState>, typeof START | "agent" | "action">;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { FunctionCallingExecutorState, createFunctionCallingExecutor };
|
|
23
|
+
//# sourceMappingURL=chat_agent_executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|