@langchain/langgraph 0.4.9 → 1.0.0-alpha.1
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 +26 -0
- package/README.md +1 -2
- package/dist/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/channels/any_value.cjs +44 -63
- package/dist/channels/any_value.cjs.map +1 -0
- package/dist/channels/any_value.d.cts +24 -0
- package/dist/channels/any_value.d.cts.map +1 -0
- package/dist/channels/any_value.d.ts +16 -11
- package/dist/channels/any_value.d.ts.map +1 -0
- package/dist/channels/any_value.js +42 -57
- package/dist/channels/any_value.js.map +1 -1
- package/dist/channels/base.cjs +93 -133
- package/dist/channels/base.cjs.map +1 -0
- package/dist/channels/base.d.cts +79 -0
- package/dist/channels/base.d.cts.map +1 -0
- package/dist/channels/base.d.ts +77 -73
- package/dist/channels/base.d.ts.map +1 -0
- package/dist/channels/base.js +90 -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.cjs +72 -208
- package/dist/channels/dynamic_barrier_value.cjs.map +1 -0
- package/dist/channels/dynamic_barrier_value.d.cts +42 -0
- package/dist/channels/dynamic_barrier_value.d.cts.map +1 -0
- package/dist/channels/dynamic_barrier_value.d.ts +20 -35
- package/dist/channels/dynamic_barrier_value.d.ts.map +1 -0
- package/dist/channels/dynamic_barrier_value.js +69 -200
- package/dist/channels/dynamic_barrier_value.js.map +1 -1
- package/dist/channels/ephemeral_value.cjs +44 -70
- package/dist/channels/ephemeral_value.cjs.map +1 -0
- package/dist/channels/ephemeral_value.d.cts +22 -0
- package/dist/channels/ephemeral_value.d.cts.map +1 -0
- package/dist/channels/ephemeral_value.d.ts +18 -12
- package/dist/channels/ephemeral_value.d.ts.map +1 -0
- package/dist/channels/ephemeral_value.js +43 -65
- package/dist/channels/ephemeral_value.js.map +1 -1
- package/dist/channels/index.cjs +21 -10
- package/dist/channels/index.d.cts +9 -0
- package/dist/channels/index.d.ts +9 -7
- package/dist/channels/index.js +10 -3
- package/dist/channels/last_value.cjs +90 -140
- package/dist/channels/last_value.cjs.map +1 -0
- package/dist/channels/last_value.d.cts +42 -0
- package/dist/channels/last_value.d.cts.map +1 -0
- package/dist/channels/last_value.d.ts +27 -23
- package/dist/channels/last_value.d.ts.map +1 -0
- package/dist/channels/last_value.js +87 -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 +46 -0
- package/dist/channels/named_barrier_value.d.cts.map +1 -0
- package/dist/channels/named_barrier_value.d.ts +32 -29
- package/dist/channels/named_barrier_value.d.ts.map +1 -0
- package/dist/channels/named_barrier_value.js +111 -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 +32 -0
- package/dist/channels/topic.d.cts.map +1 -0
- package/dist/channels/topic.d.ts +28 -19
- 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 +376 -452
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +285 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.ts +113 -148
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +336 -444
- package/dist/constants.js.map +1 -1
- package/dist/errors.cjs +151 -179
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +81 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.ts +56 -46
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +140 -165
- package/dist/errors.js.map +1 -1
- package/dist/func/index.cjs +292 -290
- package/dist/func/index.cjs.map +1 -0
- package/dist/func/index.d.cts +293 -0
- package/dist/func/index.d.cts.map +1 -0
- package/dist/func/index.d.ts +86 -72
- package/dist/func/index.d.ts.map +1 -0
- package/dist/func/index.js +288 -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 +133 -0
- package/dist/graph/graph.d.cts.map +1 -0
- package/dist/graph/graph.d.ts +124 -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 +475 -779
- package/dist/graph/state.cjs.map +1 -0
- package/dist/graph/state.d.cts +231 -0
- package/dist/graph/state.d.cts.map +1 -0
- package/dist/graph/state.d.ts +148 -138
- package/dist/graph/state.d.ts.map +1 -0
- package/dist/graph/state.js +469 -769
- 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 +111 -33
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -5
- package/dist/index.js +19 -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 +47 -38
- 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 +551 -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 +546 -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 +1138 -1604
- package/dist/pregel/index.cjs.map +1 -0
- package/dist/pregel/index.d.cts +536 -0
- package/dist/pregel/index.d.cts.map +1 -0
- package/dist/pregel/index.d.ts +460 -422
- package/dist/pregel/index.d.ts.map +1 -0
- package/dist/pregel/index.js +1129 -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 +542 -954
- package/dist/pregel/loop.cjs.map +1 -0
- package/dist/pregel/loop.js +539 -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 +49 -0
- package/dist/pregel/runnable_types.d.cts.map +1 -0
- package/dist/pregel/runnable_types.d.ts +47 -17
- 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 +440 -0
- package/dist/pregel/types.d.cts.map +1 -0
- package/dist/pregel/types.d.ts +381 -432
- 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 +101 -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 +99 -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 +96 -55
- package/dist/web.d.cts +23 -0
- package/dist/web.d.ts +23 -14
- package/dist/web.js +15 -8
- package/dist/writer.cjs +15 -0
- package/dist/writer.cjs.map +1 -0
- package/dist/writer.d.cts +5 -0
- package/dist/writer.d.cts.map +1 -0
- package/dist/writer.d.ts +5 -0
- package/dist/writer.d.ts.map +1 -0
- package/dist/writer.js +14 -0
- package/dist/writer.js.map +1 -0
- package/package.json +90 -83
- 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
|
@@ -1,127 +1,67 @@
|
|
|
1
|
-
import { convertToOpenAIFunction } from "@langchain/core/utils/function_calling";
|
|
2
|
-
import { FunctionMessage } from "@langchain/core/messages";
|
|
3
|
-
import { RunnableLambda, } from "@langchain/core/runnables";
|
|
4
|
-
import { ToolExecutor } from "./tool_executor.js";
|
|
5
|
-
import { StateGraph, } from "../graph/state.js";
|
|
6
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
|
|
7
9
|
/** @deprecated Use {@link createReactAgent} instead with tool calling. */
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// We construct an AgentAction from the function_call
|
|
62
|
-
return {
|
|
63
|
-
tool: lastMessage.additional_kwargs.function_call.name,
|
|
64
|
-
toolInput: JSON.stringify(lastMessage.additional_kwargs.function_call.arguments),
|
|
65
|
-
log: "",
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
const callTool = async (state, config) => {
|
|
69
|
-
const action = _getAction(state);
|
|
70
|
-
// We call the tool_executor and get back a response
|
|
71
|
-
const response = await toolExecutor.invoke(action, config);
|
|
72
|
-
// We use the response to create a FunctionMessage
|
|
73
|
-
const functionMessage = new FunctionMessage({
|
|
74
|
-
content: response,
|
|
75
|
-
name: action.tool,
|
|
76
|
-
});
|
|
77
|
-
// We return a list, because this will get added to the existing list
|
|
78
|
-
return { messages: [functionMessage] };
|
|
79
|
-
};
|
|
80
|
-
// We create the AgentState that we will pass around
|
|
81
|
-
// This simply involves a list of messages
|
|
82
|
-
// We want steps to return messages to append to the list
|
|
83
|
-
// So we annotate the messages attribute with operator.add
|
|
84
|
-
const schema = {
|
|
85
|
-
messages: {
|
|
86
|
-
value: (x, y) => x.concat(y),
|
|
87
|
-
default: () => [],
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
// Define a new graph
|
|
91
|
-
const workflow = new StateGraph({
|
|
92
|
-
channels: schema,
|
|
93
|
-
})
|
|
94
|
-
// Define the two nodes we will cycle between
|
|
95
|
-
.addNode("agent", new RunnableLambda({ func: callModel }))
|
|
96
|
-
.addNode("action", new RunnableLambda({ func: callTool }))
|
|
97
|
-
// Set the entrypoint as `agent`
|
|
98
|
-
// This means that this node is the first one called
|
|
99
|
-
.addEdge(START, "agent")
|
|
100
|
-
// We now add a conditional edge
|
|
101
|
-
.addConditionalEdges(
|
|
102
|
-
// First, we define the start node. We use `agent`.
|
|
103
|
-
// This means these are the edges taken after the `agent` node is called.
|
|
104
|
-
"agent",
|
|
105
|
-
// Next, we pass in the function that will determine which node is called next.
|
|
106
|
-
shouldContinue,
|
|
107
|
-
// Finally we pass in a mapping.
|
|
108
|
-
// The keys are strings, and the values are other nodes.
|
|
109
|
-
// END is a special node marking that the graph should finish.
|
|
110
|
-
// What will happen is we will call `should_continue`, and then the output of that
|
|
111
|
-
// will be matched against the keys in this mapping.
|
|
112
|
-
// Based on which one it matches, that node will then be called.
|
|
113
|
-
{
|
|
114
|
-
// If `tools`, then we call the tool node.
|
|
115
|
-
continue: "action",
|
|
116
|
-
// Otherwise we finish.
|
|
117
|
-
end: END,
|
|
118
|
-
})
|
|
119
|
-
// We now add a normal edge from `tools` to `agent`.
|
|
120
|
-
// This means that after `tools` is called, `agent` node is called next.
|
|
121
|
-
.addEdge("action", "agent");
|
|
122
|
-
// Finally, we compile it!
|
|
123
|
-
// This compiles it into a LangChain Runnable,
|
|
124
|
-
// meaning you can use it as you would any other runnable
|
|
125
|
-
return workflow.compile();
|
|
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();
|
|
126
63
|
}
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
export { createFunctionCallingExecutor };
|
|
127
67
|
//# sourceMappingURL=chat_agent_executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat_agent_executor.js","
|
|
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"}
|
package/dist/prebuilt/index.cjs
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var agentName_js_1 = require("./agentName.cjs");
|
|
17
|
-
Object.defineProperty(exports, "withAgentName", { enumerable: true, get: function () { return agentName_js_1.withAgentName; } });
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
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 };
|
package/dist/prebuilt/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type
|
|
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 };
|
package/dist/prebuilt/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 };
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
* @deprecated Use `HumanInterruptConfig` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
|
|
7
|
+
* Update your import to `import { HumanInterruptConfig } from "langchain";`
|
|
8
|
+
*
|
|
9
|
+
* @property {boolean} allow_ignore - Whether the human can choose to ignore/skip the current step
|
|
10
|
+
* @property {boolean} allow_respond - Whether the human can provide a text response/feedback
|
|
11
|
+
* @property {boolean} allow_edit - Whether the human can edit the provided content/state
|
|
12
|
+
* @property {boolean} allow_accept - Whether the human can accept/approve the current state
|
|
13
|
+
*/
|
|
14
|
+
interface HumanInterruptConfig {
|
|
15
|
+
allow_ignore: boolean;
|
|
16
|
+
allow_respond: boolean;
|
|
17
|
+
allow_edit: boolean;
|
|
18
|
+
allow_accept: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Represents a request for human action within the graph execution.
|
|
22
|
+
* Contains the action type and any associated arguments needed for the action.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Use `ActionRequest` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
|
|
25
|
+
* Update your import to `import { ActionRequest } from "langchain/prebuilt/interrupt";`
|
|
26
|
+
*
|
|
27
|
+
* @property {string} action - The type or name of action being requested (e.g., "Approve XYZ action")
|
|
28
|
+
* @property {Record<string, any>} args - Key-value pairs of arguments needed for the action
|
|
29
|
+
*/
|
|
30
|
+
interface ActionRequest {
|
|
31
|
+
action: string;
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
args: Record<string, any>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Represents an interrupt triggered by the graph that requires human intervention.
|
|
37
|
+
* This is passed to the `interrupt` function when execution is paused for human input.
|
|
38
|
+
*
|
|
39
|
+
* @deprecated Use `HumanInterrupt` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
|
|
40
|
+
* Update your import to `import { HumanInterrupt } from "langchain/prebuilt/interrupt";`
|
|
41
|
+
*
|
|
42
|
+
* @property {ActionRequest} action_request - The specific action being requested from the human
|
|
43
|
+
* @property {HumanInterruptConfig} config - Configuration defining what actions are allowed
|
|
44
|
+
* @property {string} [description] - Optional detailed description of what input is needed
|
|
45
|
+
*/
|
|
46
|
+
interface HumanInterrupt {
|
|
47
|
+
action_request: ActionRequest;
|
|
48
|
+
config: HumanInterruptConfig;
|
|
49
|
+
description?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The response provided by a human to an interrupt, which is returned when graph execution resumes.
|
|
53
|
+
*
|
|
54
|
+
* @deprecated Use `HumanResponse` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
|
|
55
|
+
* Update your import to `import { HumanResponse } from "langchain/prebuilt/interrupt";`
|
|
56
|
+
*
|
|
57
|
+
* @property {("accept"|"ignore"|"response"|"edit")} type - The type of response:
|
|
58
|
+
* - "accept": Approves the current state without changes
|
|
59
|
+
* - "ignore": Skips/ignores the current step
|
|
60
|
+
* - "response": Provides text feedback or instructions
|
|
61
|
+
* - "edit": Modifies the current state/content
|
|
62
|
+
* @property {null|string|ActionRequest} args - The response payload:
|
|
63
|
+
* - null: For ignore/accept actions
|
|
64
|
+
* - string: For text responses
|
|
65
|
+
* - ActionRequest: For edit actions with updated content
|
|
66
|
+
*/
|
|
67
|
+
type HumanResponse = {
|
|
68
|
+
type: "accept" | "ignore" | "response" | "edit";
|
|
69
|
+
args: null | string | ActionRequest;
|
|
70
|
+
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { ActionRequest, HumanInterrupt, HumanInterruptConfig, HumanResponse };
|
|
73
|
+
//# sourceMappingURL=interrupt.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
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 * @deprecated Use `HumanInterruptConfig` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { HumanInterruptConfig } from \"langchain\";`\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 * @deprecated Use `ActionRequest` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { ActionRequest } from \"langchain/prebuilt/interrupt\";`\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 * @deprecated Use `HumanInterrupt` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { HumanInterrupt } from \"langchain/prebuilt/interrupt\";`\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 * @deprecated Use `HumanResponse` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { HumanResponse } from \"langchain/prebuilt/interrupt\";`\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":";;AAYA;AAgBA;AAgBA;;;;;AAqBA;;;;UArDiBA,oBAAAA;;;;;;;;;;;;;;;;UAgBAC,aAAAA;;;QAGPC;;;;;;;;;;;;;UAaOC,cAAAA;kBACGF;UACRD;;;;;;;;;;;;;;;;;;;KAmBAI,aAAAA;;wBAEcH"}
|
|
@@ -1,45 +1,59 @@
|
|
|
1
|
+
//#region src/prebuilt/interrupt.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Configuration interface that defines what actions are allowed for a human interrupt.
|
|
3
4
|
* This controls the available interaction options when the graph is paused for human input.
|
|
4
5
|
*
|
|
6
|
+
* @deprecated Use `HumanInterruptConfig` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
|
|
7
|
+
* Update your import to `import { HumanInterruptConfig } from "langchain";`
|
|
8
|
+
*
|
|
5
9
|
* @property {boolean} allow_ignore - Whether the human can choose to ignore/skip the current step
|
|
6
10
|
* @property {boolean} allow_respond - Whether the human can provide a text response/feedback
|
|
7
11
|
* @property {boolean} allow_edit - Whether the human can edit the provided content/state
|
|
8
12
|
* @property {boolean} allow_accept - Whether the human can accept/approve the current state
|
|
9
13
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
interface HumanInterruptConfig {
|
|
15
|
+
allow_ignore: boolean;
|
|
16
|
+
allow_respond: boolean;
|
|
17
|
+
allow_edit: boolean;
|
|
18
|
+
allow_accept: boolean;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* Represents a request for human action within the graph execution.
|
|
18
22
|
* Contains the action type and any associated arguments needed for the action.
|
|
19
23
|
*
|
|
24
|
+
* @deprecated Use `ActionRequest` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
|
|
25
|
+
* Update your import to `import { ActionRequest } from "langchain/prebuilt/interrupt";`
|
|
26
|
+
*
|
|
20
27
|
* @property {string} action - The type or name of action being requested (e.g., "Approve XYZ action")
|
|
21
28
|
* @property {Record<string, any>} args - Key-value pairs of arguments needed for the action
|
|
22
29
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
interface ActionRequest {
|
|
31
|
+
action: string;
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
args: Record<string, any>;
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
36
|
* Represents an interrupt triggered by the graph that requires human intervention.
|
|
29
37
|
* This is passed to the `interrupt` function when execution is paused for human input.
|
|
30
38
|
*
|
|
39
|
+
* @deprecated Use `HumanInterrupt` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
|
|
40
|
+
* Update your import to `import { HumanInterrupt } from "langchain/prebuilt/interrupt";`
|
|
41
|
+
*
|
|
31
42
|
* @property {ActionRequest} action_request - The specific action being requested from the human
|
|
32
43
|
* @property {HumanInterruptConfig} config - Configuration defining what actions are allowed
|
|
33
44
|
* @property {string} [description] - Optional detailed description of what input is needed
|
|
34
45
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
interface HumanInterrupt {
|
|
47
|
+
action_request: ActionRequest;
|
|
48
|
+
config: HumanInterruptConfig;
|
|
49
|
+
description?: string;
|
|
39
50
|
}
|
|
40
51
|
/**
|
|
41
52
|
* The response provided by a human to an interrupt, which is returned when graph execution resumes.
|
|
42
53
|
*
|
|
54
|
+
* @deprecated Use `HumanResponse` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
|
|
55
|
+
* Update your import to `import { HumanResponse } from "langchain/prebuilt/interrupt";`
|
|
56
|
+
*
|
|
43
57
|
* @property {("accept"|"ignore"|"response"|"edit")} type - The type of response:
|
|
44
58
|
* - "accept": Approves the current state without changes
|
|
45
59
|
* - "ignore": Skips/ignores the current step
|
|
@@ -50,7 +64,10 @@ export interface HumanInterrupt {
|
|
|
50
64
|
* - string: For text responses
|
|
51
65
|
* - ActionRequest: For edit actions with updated content
|
|
52
66
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
type HumanResponse = {
|
|
68
|
+
type: "accept" | "ignore" | "response" | "edit";
|
|
69
|
+
args: null | string | ActionRequest;
|
|
56
70
|
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { ActionRequest, HumanInterrupt, HumanInterruptConfig, HumanResponse };
|
|
73
|
+
//# sourceMappingURL=interrupt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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 * @deprecated Use `HumanInterruptConfig` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { HumanInterruptConfig } from \"langchain\";`\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 * @deprecated Use `ActionRequest` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { ActionRequest } from \"langchain/prebuilt/interrupt\";`\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 * @deprecated Use `HumanInterrupt` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { HumanInterrupt } from \"langchain/prebuilt/interrupt\";`\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 * @deprecated Use `HumanResponse` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { HumanResponse } from \"langchain/prebuilt/interrupt\";`\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":";;AAYA;AAgBA;AAgBA;;;;;AAqBA;;;;UArDiBA,oBAAAA;;;;;;;;;;;;;;;;UAgBAC,aAAAA;;;QAGPC;;;;;;;;;;;;;UAaOC,cAAAA;kBACGF;UACRD;;;;;;;;;;;;;;;;;;;KAmBAI,aAAAA;;wBAEcH"}
|