@langchain/langgraph 1.0.0-alpha.5 → 1.0.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 +32 -0
- package/dist/graph/message.d.cts +2 -2
- package/dist/graph/message.d.cts.map +1 -1
- package/dist/graph/message.d.ts +2 -2
- package/dist/graph/message.d.ts.map +1 -1
- package/dist/graph/messages_annotation.d.cts +5 -5
- package/dist/graph/messages_annotation.d.cts.map +1 -1
- package/dist/graph/messages_annotation.d.ts +5 -5
- package/dist/graph/messages_annotation.d.ts.map +1 -1
- package/dist/graph/zod/zod-registry.d.cts.map +1 -1
- package/dist/graph/zod/zod-registry.d.ts.map +1 -1
- package/dist/prebuilt/agent_executor.d.cts +5 -5
- package/dist/prebuilt/agent_executor.d.cts.map +1 -1
- package/dist/prebuilt/react_agent_executor.d.cts +3 -3
- package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @langchain/langgraph
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 1e1ecbb: Make Zod a peer dependency of @langchain/langgraph
|
|
8
|
+
- 1e1ecbb: This release updates the package for compatibility with LangGraph v1.0. See the [v1.0 release notes](https://docs.langchain.com/oss/javascript/releases/langgraph-v1) for details on what's new.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 1e1ecbb: Fix type issue with defining `interrupt` and `writer` in StateGraph constructor when using Annotation.Root
|
|
13
|
+
- 1e1ecbb: Add `pushMessage` method for manually publishing to messages stream channel
|
|
14
|
+
- 1e1ecbb: chore(prebuilt): deprecate createReactAgent
|
|
15
|
+
- 1e1ecbb: Improve performance of scheduling tasks with large graphs
|
|
16
|
+
- 1e1ecbb: Improve graph execution performance by avoiding unnecessary cloning of checkpoints after every tick
|
|
17
|
+
- 1e1ecbb: fix(@langchain/langgraph): export missing `CommandParams` symbol
|
|
18
|
+
- 1e1ecbb: Add `stream.encoding` option to emit LangGraph API events as Server-Sent Events. This allows for sending events through the wire by piping the stream to a `Response` object.
|
|
19
|
+
- 1e1ecbb: fix(@langchain/langgraph): export missing `CommandInstance` symbol
|
|
20
|
+
- 1e1ecbb: Update troubleshooting link for common errors, add MISSING_CHECKPOINTER troubleshooting page
|
|
21
|
+
- 1e1ecbb: Fix `stateKey` property in `pushMessage` being ignored when RunnableConfig is automatically inherited
|
|
22
|
+
- 1e1ecbb: Improve tick performance by detecting interrupts faster within a tick.
|
|
23
|
+
- 1e1ecbb: Improve tick performance by calling `maxChannelMapVersion` only once
|
|
24
|
+
- 1e1ecbb: feat(langgraph): add `toLangGraphEventStream` method to stream events in LGP compatible format
|
|
25
|
+
- 1e1ecbb: fix(createReactAgent): update deprecation messages to contain reactAgent
|
|
26
|
+
- 1e1ecbb: `writer`, `interrupt` and `signal` is no longer an optional property of `Runtime`
|
|
27
|
+
- 1e1ecbb: Add support for defining multiple interrupts in StateGraph constructor. Interrupts from the map can be picked from the `Runtime` object, ensuring type-safety across multiple interrupts.
|
|
28
|
+
- 1e1ecbb: Channels are now part of the public API, allowing users to customise behaviour of checkpointing per channel (#976)
|
|
29
|
+
- 1e1ecbb: Allow defining types for interrupt and custom events upfront
|
|
30
|
+
- 1e1ecbb: Fix performance regression due to deferred nodes
|
|
31
|
+
- Updated dependencies [1e1ecbb]
|
|
32
|
+
- @langchain/langgraph-checkpoint@1.0.0
|
|
33
|
+
- @langchain/langgraph-sdk@1.0.0
|
|
34
|
+
|
|
3
35
|
## 1.0.0-alpha.5
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/dist/graph/message.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateGraph } from "./state.cjs";
|
|
2
2
|
import { RunnableConfig } from "@langchain/core/runnables";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _langchain_core_messages0 from "@langchain/core/messages";
|
|
4
4
|
import { BaseMessage, BaseMessageLike } from "@langchain/core/messages";
|
|
5
5
|
|
|
6
6
|
//#region src/graph/message.d.ts
|
|
@@ -34,7 +34,7 @@ declare function pushMessage(message: BaseMessage | BaseMessageLike, options?: R
|
|
|
34
34
|
* @default "messages"
|
|
35
35
|
*/
|
|
36
36
|
stateKey?: string | null;
|
|
37
|
-
}): BaseMessage<
|
|
37
|
+
}): BaseMessage<_langchain_core_messages0.MessageStructure, _langchain_core_messages0.MessageType>;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { MessageGraph, Messages, REMOVE_ALL_MESSAGES, messagesStateReducer, pushMessage };
|
|
40
40
|
//# sourceMappingURL=message.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.cts","names":["BaseMessage","BaseMessageLike","RunnableConfig","StateGraph","REMOVE_ALL_MESSAGES","Messages","Array","messagesStateReducer","MessageGraph","pushMessage","
|
|
1
|
+
{"version":3,"file":"message.d.cts","names":["BaseMessage","BaseMessageLike","RunnableConfig","StateGraph","REMOVE_ALL_MESSAGES","Messages","Array","messagesStateReducer","MessageGraph","pushMessage","_langchain_core_messages0","MessageStructure","MessageType"],"sources":["../../src/graph/message.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\nimport type { RunnableConfig } from \"@langchain/core/runnables\";\nimport { StateGraph } from \"./state.js\";\nexport declare const REMOVE_ALL_MESSAGES = \"__remove_all__\";\nexport type Messages = Array<BaseMessage | BaseMessageLike> | BaseMessage | BaseMessageLike;\n/**\n * Prebuilt reducer that combines returned messages.\n * Can handle standard messages and special modifiers like {@link RemoveMessage}\n * instances.\n */\nexport declare function messagesStateReducer(left: Messages, right: Messages): BaseMessage[];\n/** @ignore */\nexport declare class MessageGraph extends StateGraph<BaseMessage[], BaseMessage[], Messages> {\n constructor();\n}\n/**\n * Manually push a message to a message stream.\n *\n * This is useful when you need to push a manually created message before the node\n * has finished executing.\n *\n * When a message is pushed, it will be automatically persisted to the state after the node has finished executing.\n * To disable persisting, set `options.stateKey` to `null`.\n *\n * @param message The message to push. The message must have an ID set, otherwise an error will be thrown.\n * @param options RunnableConfig / Runtime coming from node context.\n */\nexport declare function pushMessage(message: BaseMessage | BaseMessageLike, options?: RunnableConfig & {\n /**\n * The key of the state to push the message to. Set to `null` to avoid persisting.\n * @default \"messages\"\n */\n stateKey?: string | null;\n}): BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>;\n"],"mappings":";;;;;;cAGqBI,mBAAAA;KACTC,QAAAA,GAAWC,MAAMN,cAAcC,mBAAmBD,cAAcC;;AAD5E;AACA;;;AAA2CA,iBAMnBM,oBAAAA,CANmBN,IAAAA,EAMQI,QANRJ,EAAAA,KAAAA,EAMyBI,QANzBJ,CAAAA,EAMoCD,WANpCC,EAAAA;;AAAmBD,cAQzCQ,YAAAA,SAAqBL,UARoBH,CAQTA,WARSA,EAAAA,EAQMA,WARNA,EAAAA,EAQqBK,QARrBL,CAAAA,CAAAA;aAAcC,CAAAA;;AAM5E;;;;;;AAEA;;;;;;iBAewBQ,WAAAA,UAAqBT,cAAcC,2BAA2BC;EAA9DO;;;;UAA8DP,CAAAA,EAAAA,MAAAA,GAAAA,IAAAA;IAMlFF,WANgGU,CAAAA,yBAAAA,CAMjDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAArDD"}
|
package/dist/graph/message.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateGraph } from "./state.js";
|
|
2
2
|
import { RunnableConfig } from "@langchain/core/runnables";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _langchain_core_messages9 from "@langchain/core/messages";
|
|
4
4
|
import { BaseMessage, BaseMessageLike } from "@langchain/core/messages";
|
|
5
5
|
|
|
6
6
|
//#region src/graph/message.d.ts
|
|
@@ -34,7 +34,7 @@ declare function pushMessage(message: BaseMessage | BaseMessageLike, options?: R
|
|
|
34
34
|
* @default "messages"
|
|
35
35
|
*/
|
|
36
36
|
stateKey?: string | null;
|
|
37
|
-
}): BaseMessage<
|
|
37
|
+
}): BaseMessage<_langchain_core_messages9.MessageStructure, _langchain_core_messages9.MessageType>;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { MessageGraph, Messages, REMOVE_ALL_MESSAGES, messagesStateReducer, pushMessage };
|
|
40
40
|
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","names":["BaseMessage","BaseMessageLike","RunnableConfig","StateGraph","REMOVE_ALL_MESSAGES","Messages","Array","messagesStateReducer","MessageGraph","pushMessage","
|
|
1
|
+
{"version":3,"file":"message.d.ts","names":["BaseMessage","BaseMessageLike","RunnableConfig","StateGraph","REMOVE_ALL_MESSAGES","Messages","Array","messagesStateReducer","MessageGraph","pushMessage","_langchain_core_messages9","MessageStructure","MessageType"],"sources":["../../src/graph/message.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\nimport type { RunnableConfig } from \"@langchain/core/runnables\";\nimport { StateGraph } from \"./state.js\";\nexport declare const REMOVE_ALL_MESSAGES = \"__remove_all__\";\nexport type Messages = Array<BaseMessage | BaseMessageLike> | BaseMessage | BaseMessageLike;\n/**\n * Prebuilt reducer that combines returned messages.\n * Can handle standard messages and special modifiers like {@link RemoveMessage}\n * instances.\n */\nexport declare function messagesStateReducer(left: Messages, right: Messages): BaseMessage[];\n/** @ignore */\nexport declare class MessageGraph extends StateGraph<BaseMessage[], BaseMessage[], Messages> {\n constructor();\n}\n/**\n * Manually push a message to a message stream.\n *\n * This is useful when you need to push a manually created message before the node\n * has finished executing.\n *\n * When a message is pushed, it will be automatically persisted to the state after the node has finished executing.\n * To disable persisting, set `options.stateKey` to `null`.\n *\n * @param message The message to push. The message must have an ID set, otherwise an error will be thrown.\n * @param options RunnableConfig / Runtime coming from node context.\n */\nexport declare function pushMessage(message: BaseMessage | BaseMessageLike, options?: RunnableConfig & {\n /**\n * The key of the state to push the message to. Set to `null` to avoid persisting.\n * @default \"messages\"\n */\n stateKey?: string | null;\n}): BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>;\n"],"mappings":";;;;;;cAGqBI,mBAAAA;KACTC,QAAAA,GAAWC,MAAMN,cAAcC,mBAAmBD,cAAcC;;AAD5E;AACA;;;AAA2CA,iBAMnBM,oBAAAA,CANmBN,IAAAA,EAMQI,QANRJ,EAAAA,KAAAA,EAMyBI,QANzBJ,CAAAA,EAMoCD,WANpCC,EAAAA;;AAAmBD,cAQzCQ,YAAAA,SAAqBL,UARoBH,CAQTA,WARSA,EAAAA,EAQMA,WARNA,EAAAA,EAQqBK,QARrBL,CAAAA,CAAAA;aAAcC,CAAAA;;AAM5E;;;;;;AAEA;;;;;;iBAewBQ,WAAAA,UAAqBT,cAAcC,2BAA2BC;EAA9DO;;;;UAA8DP,CAAAA,EAAAA,MAAAA,GAAAA,IAAAA;IAMlFF,WANgGU,CAAAA,yBAAAA,CAMjDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAArDD"}
|
|
@@ -3,7 +3,7 @@ import { ReducedZodChannel, SchemaMeta } from "./zod/meta.cjs";
|
|
|
3
3
|
import { AnnotationRoot } from "./annotation.cjs";
|
|
4
4
|
import { Messages } from "./message.cjs";
|
|
5
5
|
import * as _langchain_core_utils_types0 from "@langchain/core/utils/types";
|
|
6
|
-
import * as
|
|
6
|
+
import * as _langchain_core_messages19 from "@langchain/core/messages";
|
|
7
7
|
import { BaseMessage } from "@langchain/core/messages";
|
|
8
8
|
import { z } from "zod/v3";
|
|
9
9
|
|
|
@@ -45,7 +45,7 @@ import { z } from "zod/v3";
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
declare const MessagesAnnotation: AnnotationRoot<{
|
|
48
|
-
messages: BinaryOperatorAggregate<BaseMessage<
|
|
48
|
+
messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages19.MessageStructure, _langchain_core_messages19.MessageType>[], Messages>;
|
|
49
49
|
}>;
|
|
50
50
|
/**
|
|
51
51
|
* Prebuilt schema meta for Zod state definition.
|
|
@@ -101,11 +101,11 @@ declare const MessagesZodMeta: SchemaMeta<BaseMessage[], Messages>;
|
|
|
101
101
|
* ```
|
|
102
102
|
*/
|
|
103
103
|
declare const MessagesZodState: z.ZodObject<{
|
|
104
|
-
messages: ReducedZodChannel<z.ZodType<BaseMessage<
|
|
104
|
+
messages: ReducedZodChannel<z.ZodType<BaseMessage<_langchain_core_messages19.MessageStructure, _langchain_core_messages19.MessageType>[], z.ZodTypeDef, BaseMessage<_langchain_core_messages19.MessageStructure, _langchain_core_messages19.MessageType>[]>, _langchain_core_utils_types0.InteropZodType<Messages>>;
|
|
105
105
|
}, "strip", z.ZodTypeAny, {
|
|
106
|
-
messages: BaseMessage<
|
|
106
|
+
messages: BaseMessage<_langchain_core_messages19.MessageStructure, _langchain_core_messages19.MessageType>[];
|
|
107
107
|
}, {
|
|
108
|
-
messages: BaseMessage<
|
|
108
|
+
messages: BaseMessage<_langchain_core_messages19.MessageStructure, _langchain_core_messages19.MessageType>[];
|
|
109
109
|
}>;
|
|
110
110
|
//#endregion
|
|
111
111
|
export { MessagesAnnotation, MessagesZodMeta, MessagesZodState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages_annotation.d.cts","names":["
|
|
1
|
+
{"version":3,"file":"messages_annotation.d.cts","names":["___web_js7","__annotation_js0","_langchain_core_utils_types0","__zod_meta_js0","BaseMessage","z","Messages","SchemaMeta","MessagesAnnotation","_langchain_core_messages19","MessageStructure","MessageType","BinaryOperatorAggregate","AnnotationRoot","MessagesZodMeta","MessagesZodState","ZodTypeDef","ZodType","InteropZodType","ReducedZodChannel","ZodTypeAny","ZodObject"],"sources":["../../src/graph/messages_annotation.d.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { z } from \"zod/v3\";\nimport { Messages } from \"./message.js\";\nimport { SchemaMeta } from \"./zod/meta.js\";\n/**\n * Prebuilt state annotation that combines returned messages.\n * Can handle standard messages and special modifiers like {@link RemoveMessage}\n * instances.\n *\n * Specifically, importing and using the prebuilt MessagesAnnotation like this:\n *\n * @example\n * ```ts\n * import { MessagesAnnotation, StateGraph } from \"@langchain/langgraph\";\n *\n * const graph = new StateGraph(MessagesAnnotation)\n * .addNode(...)\n * ...\n * ```\n *\n * Is equivalent to initializing your state manually like this:\n *\n * @example\n * ```ts\n * import { BaseMessage } from \"@langchain/core/messages\";\n * import { Annotation, StateGraph, messagesStateReducer } from \"@langchain/langgraph\";\n *\n * export const StateAnnotation = Annotation.Root({\n * messages: Annotation<BaseMessage[]>({\n * reducer: messagesStateReducer,\n * default: () => [],\n * }),\n * });\n *\n * const graph = new StateGraph(StateAnnotation)\n * .addNode(...)\n * ...\n * ```\n */\nexport declare const MessagesAnnotation: import(\"./annotation.js\").AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\n/**\n * Prebuilt schema meta for Zod state definition.\n *\n * @example\n * ```ts\n * import { z } from \"zod/v4-mini\";\n * import { MessagesZodState, StateGraph } from \"@langchain/langgraph\";\n *\n * const AgentState = z.object({\n * messages: z.custom<BaseMessage[]>().register(registry, MessagesZodMeta),\n * });\n * ```\n */\nexport declare const MessagesZodMeta: SchemaMeta<BaseMessage[], Messages>;\n/**\n * Prebuilt state object that uses Zod to combine returned messages.\n * This utility is synonymous with the `MessagesAnnotation` annotation,\n * but uses Zod as the way to express messages state.\n *\n * You can use import and use this prebuilt schema like this:\n *\n * @example\n * ```ts\n * import { MessagesZodState, StateGraph } from \"@langchain/langgraph\";\n *\n * const graph = new StateGraph(MessagesZodState)\n * .addNode(...)\n * ...\n * ```\n *\n * Which is equivalent to initializing the schema object manually like this:\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import type { BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\n * import { StateGraph, messagesStateReducer } from \"@langchain/langgraph\";\n * import \"@langchain/langgraph/zod\";\n *\n * const AgentState = z.object({\n * messages: z\n * .custom<BaseMessage[]>()\n * .default(() => [])\n * .langgraph.reducer(\n * messagesStateReducer,\n * z.custom<BaseMessageLike | BaseMessageLike[]>()\n * ),\n * });\n * const graph = new StateGraph(AgentState)\n * .addNode(...)\n * ...\n * ```\n */\nexport declare const MessagesZodState: z.ZodObject<{\n messages: import(\"./zod/meta.js\").ReducedZodChannel<z.ZodType<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[], z.ZodTypeDef, BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[]>, import(\"@langchain/core/utils/types\").InteropZodType<Messages>>;\n}, \"strip\", z.ZodTypeAny, {\n messages: BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[];\n}, {\n messages: BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[];\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;AAwCA;;;;;;;;;AAgBA;;;;;;AAwCA;;;;;;;;;;;;;;;AAG6ES,cA3DxDD,kBA2D6FG,gBAAAA,CAAAA;UAApGP,yBAAAA,CA1D4CA,WA0D5CA,CAzDZK,0BAAAA,CADuGC,gBAAAA,EAAgBD,0BAAAA,CAAqCE,WAAAA,CA0DhJP,EAAAA,EA1DgKE,QA0DhKF,CAAAA;;;;;;;;;;;;;;;cA3COU,iBAAiBP,WAAWH,eAAeE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwC3CS,kBAAkBV,CAAAA,CAAEgB;8BACehB,CAAAA,CAAEY,QAAQb,YAKhEK,0BAAAA,CAL+GC,gBAAAA,EAAgBD,0BAAAA,CAAqCE,WAAAA,KAAgBN,CAAAA,CAAEW,YAAYZ,YAAFK,0BAAAA,CAAiDC,gBAAAA,EAAgBD,0BAAAA,CAAqCE,WAAAA,MAA8ET,4BAAAA,CAAvBgB,eAAeZ;YAClWD,CAAAA,CAAEe;YACAhB,YADUK,0BAAAA,CACqCC,gBAAAA,EAAgBD,0BAAAA,CAAqCE,WAAAA;;YAEpGP,YAFWK,0BAAAA,CAEoCC,gBAAAA,EAAgBD,0BAAAA,CAAqCE,WAAAA"}
|
|
@@ -2,7 +2,7 @@ import { BinaryOperatorAggregate } from "../channels/binop.js";
|
|
|
2
2
|
import { ReducedZodChannel, SchemaMeta } from "./zod/meta.js";
|
|
3
3
|
import { AnnotationRoot } from "./annotation.js";
|
|
4
4
|
import { Messages } from "./message.js";
|
|
5
|
-
import * as
|
|
5
|
+
import * as _langchain_core_messages0 from "@langchain/core/messages";
|
|
6
6
|
import { BaseMessage } from "@langchain/core/messages";
|
|
7
7
|
import * as _langchain_core_utils_types0 from "@langchain/core/utils/types";
|
|
8
8
|
import { z } from "zod/v3";
|
|
@@ -45,7 +45,7 @@ import { z } from "zod/v3";
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
declare const MessagesAnnotation: AnnotationRoot<{
|
|
48
|
-
messages: BinaryOperatorAggregate<BaseMessage<
|
|
48
|
+
messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages0.MessageStructure, _langchain_core_messages0.MessageType>[], Messages>;
|
|
49
49
|
}>;
|
|
50
50
|
/**
|
|
51
51
|
* Prebuilt schema meta for Zod state definition.
|
|
@@ -101,11 +101,11 @@ declare const MessagesZodMeta: SchemaMeta<BaseMessage[], Messages>;
|
|
|
101
101
|
* ```
|
|
102
102
|
*/
|
|
103
103
|
declare const MessagesZodState: z.ZodObject<{
|
|
104
|
-
messages: ReducedZodChannel<z.ZodType<BaseMessage<
|
|
104
|
+
messages: ReducedZodChannel<z.ZodType<BaseMessage<_langchain_core_messages0.MessageStructure, _langchain_core_messages0.MessageType>[], z.ZodTypeDef, BaseMessage<_langchain_core_messages0.MessageStructure, _langchain_core_messages0.MessageType>[]>, _langchain_core_utils_types0.InteropZodType<Messages>>;
|
|
105
105
|
}, "strip", z.ZodTypeAny, {
|
|
106
|
-
messages: BaseMessage<
|
|
106
|
+
messages: BaseMessage<_langchain_core_messages0.MessageStructure, _langchain_core_messages0.MessageType>[];
|
|
107
107
|
}, {
|
|
108
|
-
messages: BaseMessage<
|
|
108
|
+
messages: BaseMessage<_langchain_core_messages0.MessageStructure, _langchain_core_messages0.MessageType>[];
|
|
109
109
|
}>;
|
|
110
110
|
//#endregion
|
|
111
111
|
export { MessagesAnnotation, MessagesZodMeta, MessagesZodState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages_annotation.d.ts","names":["___web_js0","__annotation_js0","_langchain_core_utils_types0","__zod_meta_js0","BaseMessage","z","Messages","SchemaMeta","MessagesAnnotation","
|
|
1
|
+
{"version":3,"file":"messages_annotation.d.ts","names":["___web_js0","__annotation_js0","_langchain_core_utils_types0","__zod_meta_js0","BaseMessage","z","Messages","SchemaMeta","MessagesAnnotation","_langchain_core_messages0","MessageStructure","MessageType","BinaryOperatorAggregate","AnnotationRoot","MessagesZodMeta","MessagesZodState","ZodTypeDef","ZodType","InteropZodType","ReducedZodChannel","ZodTypeAny","ZodObject"],"sources":["../../src/graph/messages_annotation.d.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { z } from \"zod/v3\";\nimport { Messages } from \"./message.js\";\nimport { SchemaMeta } from \"./zod/meta.js\";\n/**\n * Prebuilt state annotation that combines returned messages.\n * Can handle standard messages and special modifiers like {@link RemoveMessage}\n * instances.\n *\n * Specifically, importing and using the prebuilt MessagesAnnotation like this:\n *\n * @example\n * ```ts\n * import { MessagesAnnotation, StateGraph } from \"@langchain/langgraph\";\n *\n * const graph = new StateGraph(MessagesAnnotation)\n * .addNode(...)\n * ...\n * ```\n *\n * Is equivalent to initializing your state manually like this:\n *\n * @example\n * ```ts\n * import { BaseMessage } from \"@langchain/core/messages\";\n * import { Annotation, StateGraph, messagesStateReducer } from \"@langchain/langgraph\";\n *\n * export const StateAnnotation = Annotation.Root({\n * messages: Annotation<BaseMessage[]>({\n * reducer: messagesStateReducer,\n * default: () => [],\n * }),\n * });\n *\n * const graph = new StateGraph(StateAnnotation)\n * .addNode(...)\n * ...\n * ```\n */\nexport declare const MessagesAnnotation: import(\"./annotation.js\").AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\n/**\n * Prebuilt schema meta for Zod state definition.\n *\n * @example\n * ```ts\n * import { z } from \"zod/v4-mini\";\n * import { MessagesZodState, StateGraph } from \"@langchain/langgraph\";\n *\n * const AgentState = z.object({\n * messages: z.custom<BaseMessage[]>().register(registry, MessagesZodMeta),\n * });\n * ```\n */\nexport declare const MessagesZodMeta: SchemaMeta<BaseMessage[], Messages>;\n/**\n * Prebuilt state object that uses Zod to combine returned messages.\n * This utility is synonymous with the `MessagesAnnotation` annotation,\n * but uses Zod as the way to express messages state.\n *\n * You can use import and use this prebuilt schema like this:\n *\n * @example\n * ```ts\n * import { MessagesZodState, StateGraph } from \"@langchain/langgraph\";\n *\n * const graph = new StateGraph(MessagesZodState)\n * .addNode(...)\n * ...\n * ```\n *\n * Which is equivalent to initializing the schema object manually like this:\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import type { BaseMessage, BaseMessageLike } from \"@langchain/core/messages\";\n * import { StateGraph, messagesStateReducer } from \"@langchain/langgraph\";\n * import \"@langchain/langgraph/zod\";\n *\n * const AgentState = z.object({\n * messages: z\n * .custom<BaseMessage[]>()\n * .default(() => [])\n * .langgraph.reducer(\n * messagesStateReducer,\n * z.custom<BaseMessageLike | BaseMessageLike[]>()\n * ),\n * });\n * const graph = new StateGraph(AgentState)\n * .addNode(...)\n * ...\n * ```\n */\nexport declare const MessagesZodState: z.ZodObject<{\n messages: import(\"./zod/meta.js\").ReducedZodChannel<z.ZodType<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[], z.ZodTypeDef, BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[]>, import(\"@langchain/core/utils/types\").InteropZodType<Messages>>;\n}, \"strip\", z.ZodTypeAny, {\n messages: BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[];\n}, {\n messages: BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[];\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;AAwCA;;;;;;;;;AAgBA;;;;;;AAwCA;;;;;;;;;;;;;;;AAG6ES,cA3DxDD,kBA2D6FG,gBAAAA,CAAAA;UAApGP,yBAAAA,CA1D4CA,WA0D5CA,CAzDZK,yBAAAA,CADuGC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CA0DhJP,EAAAA,EA1DgKE,QA0DhKF,CAAAA;;;;;;;;;;;;;;;cA3COU,iBAAiBP,WAAWH,eAAeE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwC3CS,kBAAkBV,CAAAA,CAAEgB;8BACehB,CAAAA,CAAEY,QAAQb,YAKhEK,yBAAAA,CAL+GC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,KAAgBN,CAAAA,CAAEW,YAAYZ,YAAFK,yBAAAA,CAAiDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,MAA8ET,4BAAAA,CAAvBgB,eAAeZ;YAClWD,CAAAA,CAAEe;YACAhB,YADUK,yBAAAA,CACqCC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA;;YAEpGP,YAFWK,yBAAAA,CAEoCC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod-registry.d.cts","names":["core","$ZodType","$ZodRegistry","$replace","ReducedZodChannel","SchemaMeta","SchemaMetaRegistry","LanggraphZodMetaRegistry","Meta","Schema","S","
|
|
1
|
+
{"version":3,"file":"zod-registry.d.cts","names":["core","$ZodType","$ZodRegistry","$replace","ReducedZodChannel","SchemaMeta","SchemaMetaRegistry","LanggraphZodMetaRegistry","Meta","Schema","S","_1","Output","Input","$ZodTypeInternals","Internals","output","input","TOutput","TInput","R","TInternals","ZodType","sideEffect","_2","ZodMiniType","registry"],"sources":["../../../src/graph/zod/zod-registry.d.ts"],"sourcesContent":["import type * as core from \"zod/v4/core\";\nimport { $ZodType, $ZodRegistry, $replace } from \"zod/v4/core\";\nimport { type ReducedZodChannel, type SchemaMeta, type SchemaMetaRegistry } from \"./meta.js\";\n/**\n * A Zod v4-compatible meta registry that extends the base registry.\n *\n * This registry allows you to associate and retrieve metadata for Zod schemas,\n * leveraging the base registry for storage. It is compatible with Zod v4 and\n * interoperates with the base registry to ensure consistent metadata management\n * across different Zod versions.\n *\n * @template Meta - The type of metadata associated with each schema.\n * @template Schema - The Zod schema type.\n */\nexport declare class LanggraphZodMetaRegistry<Meta extends SchemaMeta = SchemaMeta, Schema extends $ZodType = $ZodType> extends $ZodRegistry<Meta & {\n [key: string]: unknown;\n}, Schema> {\n protected parent: SchemaMetaRegistry;\n /**\n * Creates a new LanggraphZodMetaRegistry instance.\n *\n * @param parent - The base SchemaMetaRegistry to use for metadata storage.\n */\n constructor(parent: SchemaMetaRegistry);\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta & {\n [key: string]: unknown;\n } ? [$replace<Meta & {\n [key: string]: unknown;\n }, S>?] : [$replace<Meta & {\n [key: string]: unknown;\n }, S>]): this;\n}\n// Augment the zod/v4 module nudging the `register` method\n// to use the user provided input schema if specified.\ndeclare module \"zod/v4\" {\n interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;\n }\n}\ndeclare module \"zod/v4-mini\" {\n interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;\n }\n}\nexport declare const registry: LanggraphZodMetaRegistry<SchemaMeta<any, any>, $ZodType<unknown, unknown, core.$ZodTypeInternals<unknown, unknown>>>;\n"],"mappings":";;;;;;;;AAcA;;;;;;;;;AASwBM,cATHC,wBASGD,CAAAA,aATmCD,UASnCC,GATgDD,UAShDC,EAAAA,eAT2EL,QAS3EK,GATsFL,QAStFK,CAAAA,SATwGJ,YASxGI,CATqHE,IASrHF,GAAAA;MACNG,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;GARfA,MAQ+BC,CAAAA,CAAAA;YAA+BF,MAAAA,EAP3CF,kBAO2CE;;;;;;aAIlDL,CAAAA,MAAAA,EALSG,kBAKTH;KAdiHD,CAAAA,UAU9GO,MAV8GP,CAAAA,CAAAA,MAAAA,EAU9FQ,CAV8FR,EAAAA,GAAAA,KAAAA,EAAAA,SAA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aAAAA,OAAAA,EAAAA,YAAAA,OAAAA,EAAAA,sBAI5DlB,IAAAA,CAAKc,iBAJuDI,CAIrCN,MAJqCM,EAI7BL,KAJ6BK,CAAAA,GAIpBlB,IAAAA,CAAKc,iBAJeI,CAIGN,MAJHM,EAIWL,KAJXK,CAAAA,CAAAA,SAI2BlB,IAAAA,CAAKC,QAJhCiB,CAIyCN,MAJzCM,EAIiDL,KAJjDK,EAIwDH,SAJxDG,CAAAA,CAAAA;IAASC,QAAAA,CAAAA,UAKrIZ,wBALqIY,EAAAA,UAKjGnB,IAAAA,CAAKgB,MAL4FG,CAAAA,IAAAA,CAAAA,EAAAA,SAKrEnB,IAAAA,CAAKiB,KALgEE,CAAAA,IAAAA,CAAAA,EAAAA,mBAKhCnB,IAAAA,CAAKc,iBAL2BK,CAKTD,OALSC,EAKAA,MALAA,CAAAA,GAKUnB,IAAAA,CAAKc,iBALfK,CAKiCD,OALjCC,EAK0CA,MAL1CA,CAAAA,CAAAA,CAAAA,QAAAA,EAK6DC,CAL7DD,EAAAA,IAAAA,EAKsEd,UALtEc,CAKiFD,OALjFC,EAK0FA,MAL1FA,CAAAA,CAAAA,EAKoGf,iBALpGe,CAAAA,IAAAA,EAK4HM,WAL5HN,CAKwID,OALxIC,EAKiJA,MALjJA,EAKyJE,UALzJF,CAAAA,CAAAA;;;AAA0CA,cAQrLO,QARqLP,EAQ3KZ,wBAR2KY,CAQlJd,UARkJc,CAAAA,GAAAA,EAAAA,GAAAA,CAAAA,EAQ5HlB,QAR4HkB,CAAAA,OAAAA,EAAAA,OAAAA,EAQjGnB,IAAAA,CAAKc,iBAR4FK,CAAAA,OAAAA,EAAAA,OAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod-registry.d.ts","names":["core","$ZodType","$ZodRegistry","$replace","ReducedZodChannel","SchemaMeta","SchemaMetaRegistry","LanggraphZodMetaRegistry","Meta","Schema","S","
|
|
1
|
+
{"version":3,"file":"zod-registry.d.ts","names":["core","$ZodType","$ZodRegistry","$replace","ReducedZodChannel","SchemaMeta","SchemaMetaRegistry","LanggraphZodMetaRegistry","Meta","Schema","S","_1","Output","Input","$ZodTypeInternals","Internals","output","input","TOutput","TInput","R","TInternals","ZodType","sideEffect","_2","ZodMiniType","registry"],"sources":["../../../src/graph/zod/zod-registry.d.ts"],"sourcesContent":["import type * as core from \"zod/v4/core\";\nimport { $ZodType, $ZodRegistry, $replace } from \"zod/v4/core\";\nimport { type ReducedZodChannel, type SchemaMeta, type SchemaMetaRegistry } from \"./meta.js\";\n/**\n * A Zod v4-compatible meta registry that extends the base registry.\n *\n * This registry allows you to associate and retrieve metadata for Zod schemas,\n * leveraging the base registry for storage. It is compatible with Zod v4 and\n * interoperates with the base registry to ensure consistent metadata management\n * across different Zod versions.\n *\n * @template Meta - The type of metadata associated with each schema.\n * @template Schema - The Zod schema type.\n */\nexport declare class LanggraphZodMetaRegistry<Meta extends SchemaMeta = SchemaMeta, Schema extends $ZodType = $ZodType> extends $ZodRegistry<Meta & {\n [key: string]: unknown;\n}, Schema> {\n protected parent: SchemaMetaRegistry;\n /**\n * Creates a new LanggraphZodMetaRegistry instance.\n *\n * @param parent - The base SchemaMetaRegistry to use for metadata storage.\n */\n constructor(parent: SchemaMetaRegistry);\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta & {\n [key: string]: unknown;\n } ? [$replace<Meta & {\n [key: string]: unknown;\n }, S>?] : [$replace<Meta & {\n [key: string]: unknown;\n }, S>]): this;\n}\n// Augment the zod/v4 module nudging the `register` method\n// to use the user provided input schema if specified.\ndeclare module \"zod/v4\" {\n interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;\n }\n}\ndeclare module \"zod/v4-mini\" {\n interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;\n }\n}\nexport declare const registry: LanggraphZodMetaRegistry<SchemaMeta<any, any>, $ZodType<unknown, unknown, core.$ZodTypeInternals<unknown, unknown>>>;\n"],"mappings":";;;;;;;;AAcA;;;;;;;;;AASwBM,cATHC,wBASGD,CAAAA,aATmCD,UASnCC,GATgDD,UAShDC,EAAAA,eAT2EL,QAS3EK,GATsFL,QAStFK,CAAAA,SATwGJ,YASxGI,CATqHE,IASrHF,GAAAA;MACNG,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;GARfA,MAQ+BC,CAAAA,CAAAA;YAA+BF,MAAAA,EAP3CF,kBAO2CE;;;;;;aAIlDL,CAAAA,MAAAA,EALSG,kBAKTH;KAdiHD,CAAAA,UAU9GO,MAV8GP,CAAAA,CAAAA,MAAAA,EAU9FQ,CAV8FR,EAAAA,GAAAA,KAAAA,EAAAA,SAAAA,SAU/DM,IAV+DN,GAAAA;;EAiB/HS,CAAAA,GAAAA,CALQR,QAKR,CALiBK,IAKjB,GAAA;IAAA,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;KAHME,CAOuGE,CAAAA,CAAAA,CAAAA,GAAAA,CAP/FT,QAO+FS,CAPtFJ,IAOsFI,GAAAA;IAAQC,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;KAL/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AAAA,CAAAA;IAASC,QAAAA,CAAAA,UAKrIZ,wBALqIY,EAAAA,UAKjGnB,IAAAA,CAAKgB,MAL4FG,CAAAA,IAAAA,CAAAA,EAAAA,SAKrEnB,IAAAA,CAAKiB,KALgEE,CAAAA,IAAAA,CAAAA,EAAAA,mBAKhCnB,IAAAA,CAAKc,iBAL2BK,CAKTD,OALSC,EAKAA,MALAA,CAAAA,GAKUnB,IAAAA,CAAKc,iBALfK,CAKiCD,OALjCC,EAK0CA,MAL1CA,CAAAA,CAAAA,CAAAA,QAAAA,EAK6DC,CAL7DD,EAAAA,IAAAA,EAKsEd,UALtEc,CAKiFD,OALjFC,EAK0FA,MAL1FA,CAAAA,CAAAA,EAKoGf,iBALpGe,CAAAA,IAAAA,EAK4HM,WAL5HN,CAKwID,OALxIC,EAKiJA,MALjJA,EAKyJE,UALzJF,CAAAA,CAAAA;;;AAA0CA,cAQrLO,QARqLP,EAQ3KZ,wBAR2KY,CAQlJd,UARkJc,CAAAA,GAAAA,EAAAA,GAAAA,CAAAA,EAQ5HlB,QAR4HkB,CAAAA,OAAAA,EAAAA,OAAAA,EAQjGnB,IAAAA,CAAKc,iBAR4FK,CAAAA,OAAAA,EAAAA,OAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -3,7 +3,7 @@ import { StateDefinition } from "../graph/annotation.cjs";
|
|
|
3
3
|
import { CompiledStateGraph } from "../graph/state.cjs";
|
|
4
4
|
import { ToolExecutor } from "./tool_executor.cjs";
|
|
5
5
|
import { Runnable } from "@langchain/core/runnables";
|
|
6
|
-
import * as
|
|
6
|
+
import * as _langchain_core_messages1 from "@langchain/core/messages";
|
|
7
7
|
import { BaseMessage } from "@langchain/core/messages";
|
|
8
8
|
import { AgentAction, AgentFinish } from "@langchain/core/agents";
|
|
9
9
|
import { Tool } from "@langchain/core/tools";
|
|
@@ -31,22 +31,22 @@ declare function createAgentExecutor({
|
|
|
31
31
|
agentOutcome?: AgentAction | AgentFinish | undefined;
|
|
32
32
|
steps: Step[];
|
|
33
33
|
input: string;
|
|
34
|
-
chatHistory?: BaseMessage<
|
|
34
|
+
chatHistory?: BaseMessage<_langchain_core_messages1.MessageStructure, _langchain_core_messages1.MessageType>[] | undefined;
|
|
35
35
|
}, {
|
|
36
36
|
agentOutcome?: AgentAction | AgentFinish | undefined;
|
|
37
37
|
steps?: Step[] | undefined;
|
|
38
38
|
input?: string | undefined;
|
|
39
|
-
chatHistory?: BaseMessage<
|
|
39
|
+
chatHistory?: BaseMessage<_langchain_core_messages1.MessageStructure, _langchain_core_messages1.MessageType>[] | undefined;
|
|
40
40
|
}, "__start__" | "action" | "agent", {
|
|
41
41
|
agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
|
|
42
42
|
steps: BaseChannel<Step[], Step[], unknown>;
|
|
43
43
|
input: BaseChannel<string, string, unknown>;
|
|
44
|
-
chatHistory?: BaseChannel<BaseMessage<
|
|
44
|
+
chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages1.MessageStructure, _langchain_core_messages1.MessageType>[] | undefined, BaseMessage<_langchain_core_messages1.MessageStructure, _langchain_core_messages1.MessageType>[] | undefined, unknown> | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;
|
|
47
47
|
steps: BaseChannel<Step[], Step[], unknown>;
|
|
48
48
|
input: BaseChannel<string, string, unknown>;
|
|
49
|
-
chatHistory?: BaseChannel<BaseMessage<
|
|
49
|
+
chatHistory?: BaseChannel<BaseMessage<_langchain_core_messages1.MessageStructure, _langchain_core_messages1.MessageType>[] | undefined, BaseMessage<_langchain_core_messages1.MessageStructure, _langchain_core_messages1.MessageType>[] | undefined, unknown> | undefined;
|
|
50
50
|
}, StateDefinition, {
|
|
51
51
|
action: Partial<AgentExecutorState>;
|
|
52
52
|
agent: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_executor.d.cts","names":["___web_js0","AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","
|
|
1
|
+
{"version":3,"file":"agent_executor.d.cts","names":["___web_js0","AgentAction","AgentFinish","BaseMessage","Runnable","Tool","ToolExecutor","BaseChannel","Step","AgentExecutorState","Array","createAgentExecutor","agentRunnable","tools","_langchain_core_messages1","MessageStructure","MessageType","StateDefinition","Partial","CompiledStateGraph"],"sources":["../../src/prebuilt/agent_executor.d.ts"],"sourcesContent":["import { AgentAction, AgentFinish } from \"@langchain/core/agents\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { Tool } from \"@langchain/core/tools\";\nimport { ToolExecutor } from \"./tool_executor.js\";\nimport type { BaseChannel } from \"../channels/base.js\";\ninterface Step {\n action: AgentAction | AgentFinish;\n observation: unknown;\n}\n/** @ignore */\nexport interface AgentExecutorState {\n agentOutcome?: AgentAction | AgentFinish;\n steps: Array<Step>;\n input: string;\n chatHistory?: BaseMessage[];\n}\n/** @ignore */\nexport declare function createAgentExecutor({ agentRunnable, tools }: {\n agentRunnable: Runnable;\n tools: Array<Tool> | ToolExecutor;\n}): import(\"../web.js\").CompiledStateGraph<{\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps: Step[];\n input: string;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, {\n agentOutcome?: AgentAction | AgentFinish | undefined;\n steps?: Step[] | undefined;\n input?: string | undefined;\n chatHistory?: BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined;\n}, \"__start__\" | \"action\" | \"agent\", {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, {\n agentOutcome?: BaseChannel<AgentAction | AgentFinish | undefined, AgentAction | AgentFinish | undefined, unknown> | undefined;\n steps: BaseChannel<Step[], Step[], unknown>;\n input: BaseChannel<string, string, unknown>;\n chatHistory?: BaseChannel<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined, BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[] | undefined, unknown> | undefined;\n}, import(\"../web.js\").StateDefinition, {\n action: Partial<AgentExecutorState>;\n agent: {\n agentOutcome: any;\n };\n}, unknown, unknown>;\nexport {};\n"],"mappings":";;;;;;;;;;;UAMUQ,IAAAA;UACEP,cAAcC;;;;AADhBM,UAKOC,kBAAAA,CALH;EAAA,YAAA,CAAA,EAMKR,WANL,GAMmBC,WANnB;OACFD,EAMDS,KANCT,CAMKO,IANLP,CAAAA;OAAcC,EAAAA,MAAAA;gBAQRC;AAJlB;;AACmBF,iBAMKU,mBAAAA,CANLV;EAAAA,aAAAA;EAAAA;CAAAA,EAAAA;eAAcC,EAOdE,QAPcF;OAChBM,EAONE,KAPMF,CAOAH,IAPAG,CAAAA,GAOQF,YAPRE;sBAANE,CAAAA;cAEOP,CAAAA,EAOCF,WAPDE,GAOeD,WAPfC,GAAAA,SAAAA;SAQPK;EALaG,KAAAA,EAAAA,MAAAA;EAAmB,WAAA,CAAA,EAOzBR,WAPyB,CAK5BW,yBAAAA,CAEkDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAP3E,EAAA,GAAA,SAAA;;cAAkBH,CAAAA,EAS1CZ,WAT0CY,GAS5BX,WAT4BW,GAAAA,SAAAA;OAC1C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WUM,yBAAAA,CACuDC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAZtHR,EAAAA,GAAAA,SAAAA,EAYkJL,WAZlJK,CAY6BM,yBAAAA,CAAoKC,gBAAAA,EAAgBD,yBAAAA,CAAqCE,WAAAA,CAZtPR,EAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,GAAAA,SAAAA;oBAEqDO;QAAgBD,EAYrEI,OAZqEJ,CAY7DL,kBAZkGO,CAAAA;OAApGb,EAAAA;IAEaF,YAAAA,EAAAA,GAAAA;;UAAuCA,EAAAA,OAAAA,CAAAA"}
|
|
@@ -11,7 +11,7 @@ import { ToolNode } from "./tool_node.cjs";
|
|
|
11
11
|
import { All, BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
|
|
12
12
|
import { InteropZodObject, InteropZodType } from "@langchain/core/utils/types";
|
|
13
13
|
import { Runnable, RunnableBinding, RunnableLike, RunnableToolLike } from "@langchain/core/runnables";
|
|
14
|
-
import * as
|
|
14
|
+
import * as _langchain_core_messages13 from "@langchain/core/messages";
|
|
15
15
|
import { BaseMessage, BaseMessageLike, SystemMessage } from "@langchain/core/messages";
|
|
16
16
|
import { DynamicTool, StructuredToolInterface } from "@langchain/core/tools";
|
|
17
17
|
import { LanguageModelLike } from "@langchain/core/language_models/base";
|
|
@@ -50,7 +50,7 @@ type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => Ba
|
|
|
50
50
|
declare const createReactAgentAnnotation: <
|
|
51
51
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
52
|
T extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{
|
|
53
|
-
messages: BinaryOperatorAggregate<BaseMessage<
|
|
53
|
+
messages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages13.MessageStructure, _langchain_core_messages13.MessageType>[], Messages>;
|
|
54
54
|
structuredResponse: {
|
|
55
55
|
(): LastValue<T>;
|
|
56
56
|
(annotation: SingleReducer<T, T>): BinaryOperatorAggregate<T, T>;
|
|
@@ -58,7 +58,7 @@ T extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{
|
|
|
58
58
|
};
|
|
59
59
|
}>;
|
|
60
60
|
declare const PreHookAnnotation: AnnotationRoot<{
|
|
61
|
-
llmInputMessages: BinaryOperatorAggregate<BaseMessage<
|
|
61
|
+
llmInputMessages: BinaryOperatorAggregate<BaseMessage<_langchain_core_messages13.MessageStructure, _langchain_core_messages13.MessageType>[], Messages>;
|
|
62
62
|
}>;
|
|
63
63
|
type PreHookAnnotation = typeof PreHookAnnotation;
|
|
64
64
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react_agent_executor.d.cts","names":["_langchain_core_messages23","_langchain_core_language_models_chat_models0","___web_js2","BaseChatModel","LanguageModelLike","BaseMessage","BaseMessageLike","SystemMessage","Runnable","RunnableToolLike","RunnableSequence","RunnableBinding","RunnableLike","DynamicTool","StructuredToolInterface","InteropZodObject","InteropZodType","All","BaseCheckpointSaver","BaseStore","CompiledStateGraph","AnnotationRoot","MessagesAnnotation","ToolNode","LangGraphRunnableConfig","Runtime","Messages","START","InteropZodToStateDefinition","AgentState","Record","StructuredResponseType","N","StructuredResponseSchemaOptions","ServerTool","ClientTool","ConfigurableModelInterface","Promise","_shouldBindTools","_bindTools","_langchain_core_language_models_base0","BaseLanguageModelInput","MessageStructure","AIMessageChunk","BaseChatModelCallOptions","_getModel","Prompt","State","StateModifier","MessageModifier","createReactAgentAnnotation","MessageType","BinaryOperatorAggregate","T","LastValue","SingleReducer","StateDefinition","S","PreHookAnnotation","AnyAnnotationRoot","ToAnnotationRoot","A","CreateReactAgentParams","C","createReactAgent","StructuredResponseFormat","spec","ReturnType"],"sources":["../../src/prebuilt/react_agent_executor.d.ts"],"sourcesContent":["import { BaseChatModel } from \"@langchain/core/language_models/chat_models\";\nimport { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { BaseMessage, BaseMessageLike, SystemMessage } from \"@langchain/core/messages\";\nimport { Runnable, RunnableToolLike, RunnableSequence, RunnableBinding, type RunnableLike } from \"@langchain/core/runnables\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport { All, BaseCheckpointSaver, BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { type CompiledStateGraph, AnnotationRoot } from \"../graph/index.js\";\nimport { MessagesAnnotation } from \"../graph/messages_annotation.js\";\nimport { ToolNode } from \"./tool_node.js\";\nimport { LangGraphRunnableConfig, Runtime } from \"../pregel/runnable_types.js\";\nimport { Messages } from \"../graph/message.js\";\nimport { START } from \"../constants.js\";\nimport type { InteropZodToStateDefinition } from \"../graph/zod/meta.js\";\n/**\n * @deprecated `AgentState` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { AgentState } from \"langchain\";`\n */\nexport interface AgentState<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nStructuredResponseType extends Record<string, any> = Record<string, any>> {\n messages: BaseMessage[];\n // TODO: This won't be set until we\n // implement managed values in LangGraphJS\n // Will be useful for inserting a message on\n // graph recursion end\n // is_last_step: boolean;\n structuredResponse: StructuredResponseType;\n}\nexport type N = typeof START | \"agent\" | \"tools\";\ntype StructuredResponseSchemaOptions<StructuredResponseType> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schema: InteropZodType<StructuredResponseType> | Record<string, any>;\n prompt?: string;\n strict?: boolean;\n [key: string]: unknown;\n};\ntype ServerTool = Record<string, unknown>;\ntype ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;\ninterface ConfigurableModelInterface {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _queuedMethodOperations: Record<string, any>;\n _model: () => Promise<BaseChatModel>;\n}\nexport declare function _shouldBindTools(llm: LanguageModelLike, tools: (ClientTool | ServerTool)[]): Promise<boolean>;\nexport declare function _bindTools(llm: LanguageModelLike, toolClasses: (ClientTool | ServerTool)[]): Promise<Runnable<import(\"@langchain/core/language_models/base\").BaseLanguageModelInput, import(\"@langchain/core/messages\").AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure>, import(\"@langchain/core/language_models/chat_models\").BaseChatModelCallOptions> | RunnableBinding<any, any, any> | RunnableSequence<any, any>>;\nexport declare function _getModel(llm: LanguageModelLike | ConfigurableModelInterface): Promise<LanguageModelLike>;\nexport type Prompt = SystemMessage | string | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => BaseMessageLike[]) | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => Promise<BaseMessageLike[]>) | Runnable;\n/** @deprecated Use Prompt instead. */\nexport type StateModifier = Prompt;\n/** @deprecated Use Prompt instead. */\nexport type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => BaseMessage[]) | ((messages: BaseMessage[]) => Promise<BaseMessage[]>) | Runnable;\nexport declare const createReactAgentAnnotation: <\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n structuredResponse: {\n (): import(\"../web.js\").LastValue<T>;\n (annotation: import(\"../web.js\").SingleReducer<T, T>): import(\"../web.js\").BinaryOperatorAggregate<T, T>;\n Root: <S extends import(\"../web.js\").StateDefinition>(sd: S) => AnnotationRoot<S>;\n };\n}>;\ndeclare const PreHookAnnotation: AnnotationRoot<{\n llmInputMessages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\ntype PreHookAnnotation = typeof PreHookAnnotation;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyAnnotationRoot = AnnotationRoot<any>;\ntype ToAnnotationRoot<A extends AnyAnnotationRoot | InteropZodObject> = A extends AnyAnnotationRoot ? A : A extends InteropZodObject ? AnnotationRoot<InteropZodToStateDefinition<A>> : never;\n/**\n * @deprecated `CreateReactAgentParams` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { CreateAgentParams } from \"langchain\";`\n */\nexport type CreateReactAgentParams<A extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nStructuredResponseType extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot> = {\n /** The chat model that can utilize OpenAI-style tool calling. */\n llm: LanguageModelLike | ((state: ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], runtime: Runtime<ToAnnotationRoot<C>[\"State\"]>) => Promise<LanguageModelLike> | LanguageModelLike);\n /** A list of tools or a ToolNode. */\n tools: ToolNode | (ServerTool | ClientTool)[];\n /**\n * @deprecated Use prompt instead.\n */\n messageModifier?: MessageModifier;\n /**\n * @deprecated Use prompt instead.\n */\n stateModifier?: StateModifier;\n /**\n * An optional prompt for the LLM. This takes full graph state BEFORE the LLM is called and prepares the input to LLM.\n *\n * Can take a few different forms:\n *\n * - str: This is converted to a SystemMessage and added to the beginning of the list of messages in state[\"messages\"].\n * - SystemMessage: this is added to the beginning of the list of messages in state[\"messages\"].\n * - Function: This function should take in full graph state and the output is then passed to the language model.\n * - Runnable: This runnable should take in full graph state and the output is then passed to the language model.\n *\n * Note:\n * Prior to `v0.2.46`, the prompt was set using `stateModifier` / `messagesModifier` parameters.\n * This is now deprecated and will be removed in a future release.\n */\n prompt?: Prompt;\n /**\n * Additional state schema for the agent.\n */\n stateSchema?: A;\n /**\n * An optional schema for the context.\n */\n contextSchema?: C;\n /** An optional checkpoint saver to persist the agent's state. */\n checkpointSaver?: BaseCheckpointSaver | boolean;\n /** An optional checkpoint saver to persist the agent's state. Alias of \"checkpointSaver\". */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** An optional list of node names to interrupt before running. */\n interruptBefore?: N[] | All;\n /** An optional list of node names to interrupt after running. */\n interruptAfter?: N[] | All;\n store?: BaseStore;\n /**\n * An optional schema for the final agent output.\n *\n * If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.\n * If not provided, `structuredResponse` will not be present in the output state.\n *\n * Can be passed in as:\n * - Zod schema\n * - JSON schema\n * - { prompt, schema }, where schema is one of the above.\n * The prompt will be used together with the model that is being used to generate the structured response.\n *\n * @remarks\n * **Important**: `responseFormat` requires the model to support `.withStructuredOutput()`.\n *\n * **Note**: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.\n * This is not the only strategy to get structured responses, see more options in [this guide](https://langchain-ai.github.io/langgraph/how-tos/react-agent-structured-output/).\n */\n responseFormat?: InteropZodType<StructuredResponseType> | StructuredResponseSchemaOptions<StructuredResponseType>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>;\n /**\n * An optional name for the agent.\n */\n name?: string;\n /**\n * An optional description for the agent.\n * This can be used to describe the agent to the underlying supervisor LLM.\n */\n description?: string | undefined;\n /**\n * Use to specify how to expose the agent name to the underlying supervisor LLM.\n \n - undefined: Relies on the LLM provider {@link AIMessage#name}. Currently, only OpenAI supports this.\n - `\"inline\"`: Add the agent name directly into the content field of the {@link AIMessage} using XML-style tags.\n Example: `\"How can I help you\"` -> `\"<name>agent_name</name><content>How can I help you?</content>\"`\n */\n includeAgentName?: \"inline\" | undefined;\n /**\n * An optional node to add before the `agent` node (i.e., the node that calls the LLM).\n * Useful for managing long message histories (e.g., message trimming, summarization, etc.).\n */\n preModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], ToAnnotationRoot<A>[\"Update\"] & PreHookAnnotation[\"Update\"], LangGraphRunnableConfig>;\n /**\n * An optional node to add after the `agent` node (i.e., the node that calls the LLM).\n * Useful for implementing human-in-the-loop, guardrails, validation, or other post-processing.\n */\n postModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], LangGraphRunnableConfig>;\n /**\n * Determines the version of the graph to create.\n *\n * Can be one of\n * - `\"v1\"`: The tool node processes a single message. All tool calls in the message are\n * executed in parallel within the tool node.\n * - `\"v2\"`: The tool node processes a single tool call. Tool calls are distributed across\n * multiple instances of the tool node using the Send API.\n *\n * @default `\"v1\"`\n */\n version?: \"v1\" | \"v2\";\n};\n/**\n * @deprecated `createReactAgent` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { createAgent } from \"langchain\";`\n *\n * Creates a StateGraph agent that relies on a chat model utilizing tool calling.\n *\n * @example\n * ```ts\n * import { ChatOpenAI } from \"@langchain/openai\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { createReactAgent } from \"@langchain/langgraph/prebuilt\";\n *\n * const model = new ChatOpenAI({\n * model: \"gpt-4o\",\n * });\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * })\n * })\n *\n * const agent = createReactAgent({ llm: model, tools: [getWeather] });\n *\n * const inputs = {\n * messages: [{ role: \"user\", content: \"what is the weather in SF?\" }],\n * };\n *\n * const stream = await agent.stream(inputs, { streamMode: \"values\" });\n *\n * for await (const { messages } of stream) {\n * console.log(messages);\n * }\n * // Returns the messages in the state at each step of execution\n * ```\n */\nexport declare function createReactAgent<A extends AnyAnnotationRoot | InteropZodObject = typeof MessagesAnnotation, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nStructuredResponseFormat extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot>(params: CreateReactAgentParams<A, StructuredResponseFormat, C>): CompiledStateGraph<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nany, typeof MessagesAnnotation.spec & ToAnnotationRoot<A>[\"spec\"], ReturnType<typeof createReactAgentAnnotation<StructuredResponseFormat>>[\"spec\"] & ToAnnotationRoot<A>[\"spec\"]>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAkBiB6B;AAAjB;+BAE+BC,MAFJ,CAAA,MAAA,EAAA,GAAA,CAAA,GAE0BA,MAF1B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA;UAEIA,EACjBzB,WADiByB,EAAAA;;;;;EASnBE;EACPC,kBAAAA,EAHmBF,sBAGY;;AAETA,KAHfC,CAAAA,GAGeD,OAHJJ,KAGII,GAAAA,OAAAA,GAAAA,OAAAA;KAFtBE,+BAEOjB,CAAAA,sBAAAA,CAAAA,GAAAA;;UAAAA,eAAee,0BAA0BD;EAKhDI,MAAAA,CAAAA,EAAAA,MAAU;EACVC,MAAAA,CAAAA,EAAAA,OAAU;EAAA,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;KADVD,UAAAA,GAAaJ,MAC0BjB,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;KAAvCsB,UAAAA,GAAarB,uBAAwCL,GAAdI,WAAcJ,GAAAA,gBAAAA;AASyIe,KAAvLsB,MAAAA,GAASvC,aAA8KiB,GAAAA,MAAAA,GAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAArIF,kBAAAA,CAAmByB,KAAkHvB,EAAAA,MAAAA,EAAnGA,uBAAmGA,EAAAA,GAAvElB,eAAuEkB,EAAAA,CAAAA,GAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAAlCF,kBAAAA,CAAmByB,KAAevB,EAAAA,MAAAA,EAAAA,uBAAAA,EAAAA,GAA4Ba,OAA5Bb,CAAoClB,eAApCkB,EAAAA,CAAAA,CAAAA,GAA0DhB,QA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_langchain_core_language_models_chat_models0","___web_js1","BaseChatModel","LanguageModelLike","BaseMessage","BaseMessageLike","SystemMessage","Runnable","RunnableToolLike","RunnableSequence","RunnableBinding","RunnableLike","DynamicTool","StructuredToolInterface","InteropZodObject","InteropZodType","All","BaseCheckpointSaver","BaseStore","CompiledStateGraph","AnnotationRoot","MessagesAnnotation","ToolNode","LangGraphRunnableConfig","Runtime","Messages","START","InteropZodToStateDefinition","AgentState","Record","StructuredResponseType","N","StructuredResponseSchemaOptions","ServerTool","ClientTool","ConfigurableModelInterface","Promise","_shouldBindTools","_bindTools","_langchain_core_language_models_base0","BaseLanguageModelInput","MessageStructure","AIMessageChunk","BaseChatModelCallOptions","_getModel","Prompt","State","StateModifier","MessageModifier","createReactAgentAnnotation","MessageType","BinaryOperatorAggregate","T","LastValue","SingleReducer","StateDefinition","S","PreHookAnnotation","AnyAnnotationRoot","ToAnnotationRoot","A","CreateReactAgentParams","C","createReactAgent","StructuredResponseFormat","spec","ReturnType"],"sources":["../../src/prebuilt/react_agent_executor.d.ts"],"sourcesContent":["import { BaseChatModel } from \"@langchain/core/language_models/chat_models\";\nimport { LanguageModelLike } from \"@langchain/core/language_models/base\";\nimport { BaseMessage, BaseMessageLike, SystemMessage } from \"@langchain/core/messages\";\nimport { Runnable, RunnableToolLike, RunnableSequence, RunnableBinding, type RunnableLike } from \"@langchain/core/runnables\";\nimport { DynamicTool, StructuredToolInterface } from \"@langchain/core/tools\";\nimport type { InteropZodObject, InteropZodType } from \"@langchain/core/utils/types\";\nimport { All, BaseCheckpointSaver, BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { type CompiledStateGraph, AnnotationRoot } from \"../graph/index.js\";\nimport { MessagesAnnotation } from \"../graph/messages_annotation.js\";\nimport { ToolNode } from \"./tool_node.js\";\nimport { LangGraphRunnableConfig, Runtime } from \"../pregel/runnable_types.js\";\nimport { Messages } from \"../graph/message.js\";\nimport { START } from \"../constants.js\";\nimport type { InteropZodToStateDefinition } from \"../graph/zod/meta.js\";\n/**\n * @deprecated `AgentState` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { AgentState } from \"langchain\";`\n */\nexport interface AgentState<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nStructuredResponseType extends Record<string, any> = Record<string, any>> {\n messages: BaseMessage[];\n // TODO: This won't be set until we\n // implement managed values in LangGraphJS\n // Will be useful for inserting a message on\n // graph recursion end\n // is_last_step: boolean;\n structuredResponse: StructuredResponseType;\n}\nexport type N = typeof START | \"agent\" | \"tools\";\ntype StructuredResponseSchemaOptions<StructuredResponseType> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schema: InteropZodType<StructuredResponseType> | Record<string, any>;\n prompt?: string;\n strict?: boolean;\n [key: string]: unknown;\n};\ntype ServerTool = Record<string, unknown>;\ntype ClientTool = StructuredToolInterface | DynamicTool | RunnableToolLike;\ninterface ConfigurableModelInterface {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _queuedMethodOperations: Record<string, any>;\n _model: () => Promise<BaseChatModel>;\n}\nexport declare function _shouldBindTools(llm: LanguageModelLike, tools: (ClientTool | ServerTool)[]): Promise<boolean>;\nexport declare function _bindTools(llm: LanguageModelLike, toolClasses: (ClientTool | ServerTool)[]): Promise<Runnable<import(\"@langchain/core/language_models/base\").BaseLanguageModelInput, import(\"@langchain/core/messages\").AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure>, import(\"@langchain/core/language_models/chat_models\").BaseChatModelCallOptions> | RunnableBinding<any, any, any> | RunnableSequence<any, any>>;\nexport declare function _getModel(llm: LanguageModelLike | ConfigurableModelInterface): Promise<LanguageModelLike>;\nexport type Prompt = SystemMessage | string | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => BaseMessageLike[]) | ((state: typeof MessagesAnnotation.State, config: LangGraphRunnableConfig) => Promise<BaseMessageLike[]>) | Runnable;\n/** @deprecated Use Prompt instead. */\nexport type StateModifier = Prompt;\n/** @deprecated Use Prompt instead. */\nexport type MessageModifier = SystemMessage | string | ((messages: BaseMessage[]) => BaseMessage[]) | ((messages: BaseMessage[]) => Promise<BaseMessage[]>) | Runnable;\nexport declare const createReactAgentAnnotation: <\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nT extends Record<string, any> = Record<string, any>>() => AnnotationRoot<{\n messages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n structuredResponse: {\n (): import(\"../web.js\").LastValue<T>;\n (annotation: import(\"../web.js\").SingleReducer<T, T>): import(\"../web.js\").BinaryOperatorAggregate<T, T>;\n Root: <S extends import(\"../web.js\").StateDefinition>(sd: S) => AnnotationRoot<S>;\n };\n}>;\ndeclare const PreHookAnnotation: AnnotationRoot<{\n llmInputMessages: import(\"../web.js\").BinaryOperatorAggregate<BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>[], Messages>;\n}>;\ntype PreHookAnnotation = typeof PreHookAnnotation;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyAnnotationRoot = AnnotationRoot<any>;\ntype ToAnnotationRoot<A extends AnyAnnotationRoot | InteropZodObject> = A extends AnyAnnotationRoot ? A : A extends InteropZodObject ? AnnotationRoot<InteropZodToStateDefinition<A>> : never;\n/**\n * @deprecated `CreateReactAgentParams` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { CreateAgentParams } from \"langchain\";`\n */\nexport type CreateReactAgentParams<A extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nStructuredResponseType extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot> = {\n /** The chat model that can utilize OpenAI-style tool calling. */\n llm: LanguageModelLike | ((state: ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], runtime: Runtime<ToAnnotationRoot<C>[\"State\"]>) => Promise<LanguageModelLike> | LanguageModelLike);\n /** A list of tools or a ToolNode. */\n tools: ToolNode | (ServerTool | ClientTool)[];\n /**\n * @deprecated Use prompt instead.\n */\n messageModifier?: MessageModifier;\n /**\n * @deprecated Use prompt instead.\n */\n stateModifier?: StateModifier;\n /**\n * An optional prompt for the LLM. This takes full graph state BEFORE the LLM is called and prepares the input to LLM.\n *\n * Can take a few different forms:\n *\n * - str: This is converted to a SystemMessage and added to the beginning of the list of messages in state[\"messages\"].\n * - SystemMessage: this is added to the beginning of the list of messages in state[\"messages\"].\n * - Function: This function should take in full graph state and the output is then passed to the language model.\n * - Runnable: This runnable should take in full graph state and the output is then passed to the language model.\n *\n * Note:\n * Prior to `v0.2.46`, the prompt was set using `stateModifier` / `messagesModifier` parameters.\n * This is now deprecated and will be removed in a future release.\n */\n prompt?: Prompt;\n /**\n * Additional state schema for the agent.\n */\n stateSchema?: A;\n /**\n * An optional schema for the context.\n */\n contextSchema?: C;\n /** An optional checkpoint saver to persist the agent's state. */\n checkpointSaver?: BaseCheckpointSaver | boolean;\n /** An optional checkpoint saver to persist the agent's state. Alias of \"checkpointSaver\". */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** An optional list of node names to interrupt before running. */\n interruptBefore?: N[] | All;\n /** An optional list of node names to interrupt after running. */\n interruptAfter?: N[] | All;\n store?: BaseStore;\n /**\n * An optional schema for the final agent output.\n *\n * If provided, output will be formatted to match the given schema and returned in the 'structuredResponse' state key.\n * If not provided, `structuredResponse` will not be present in the output state.\n *\n * Can be passed in as:\n * - Zod schema\n * - JSON schema\n * - { prompt, schema }, where schema is one of the above.\n * The prompt will be used together with the model that is being used to generate the structured response.\n *\n * @remarks\n * **Important**: `responseFormat` requires the model to support `.withStructuredOutput()`.\n *\n * **Note**: The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.\n * This is not the only strategy to get structured responses, see more options in [this guide](https://langchain-ai.github.io/langgraph/how-tos/react-agent-structured-output/).\n */\n responseFormat?: InteropZodType<StructuredResponseType> | StructuredResponseSchemaOptions<StructuredResponseType>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>;\n /**\n * An optional name for the agent.\n */\n name?: string;\n /**\n * An optional description for the agent.\n * This can be used to describe the agent to the underlying supervisor LLM.\n */\n description?: string | undefined;\n /**\n * Use to specify how to expose the agent name to the underlying supervisor LLM.\n \n - undefined: Relies on the LLM provider {@link AIMessage#name}. Currently, only OpenAI supports this.\n - `\"inline\"`: Add the agent name directly into the content field of the {@link AIMessage} using XML-style tags.\n Example: `\"How can I help you\"` -> `\"<name>agent_name</name><content>How can I help you?</content>\"`\n */\n includeAgentName?: \"inline\" | undefined;\n /**\n * An optional node to add before the `agent` node (i.e., the node that calls the LLM).\n * Useful for managing long message histories (e.g., message trimming, summarization, etc.).\n */\n preModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"] & PreHookAnnotation[\"State\"], ToAnnotationRoot<A>[\"Update\"] & PreHookAnnotation[\"Update\"], LangGraphRunnableConfig>;\n /**\n * An optional node to add after the `agent` node (i.e., the node that calls the LLM).\n * Useful for implementing human-in-the-loop, guardrails, validation, or other post-processing.\n */\n postModelHook?: RunnableLike<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], LangGraphRunnableConfig>;\n /**\n * Determines the version of the graph to create.\n *\n * Can be one of\n * - `\"v1\"`: The tool node processes a single message. All tool calls in the message are\n * executed in parallel within the tool node.\n * - `\"v2\"`: The tool node processes a single tool call. Tool calls are distributed across\n * multiple instances of the tool node using the Send API.\n *\n * @default `\"v1\"`\n */\n version?: \"v1\" | \"v2\";\n};\n/**\n * @deprecated `createReactAgent` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.\n * Update your import to `import { createAgent } from \"langchain\";`\n *\n * Creates a StateGraph agent that relies on a chat model utilizing tool calling.\n *\n * @example\n * ```ts\n * import { ChatOpenAI } from \"@langchain/openai\";\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n * import { createReactAgent } from \"@langchain/langgraph/prebuilt\";\n *\n * const model = new ChatOpenAI({\n * model: \"gpt-4o\",\n * });\n *\n * const getWeather = tool((input) => {\n * if ([\"sf\", \"san francisco\"].includes(input.location.toLowerCase())) {\n * return \"It's 60 degrees and foggy.\";\n * } else {\n * return \"It's 90 degrees and sunny.\";\n * }\n * }, {\n * name: \"get_weather\",\n * description: \"Call to get the current weather.\",\n * schema: z.object({\n * location: z.string().describe(\"Location to get the weather for.\"),\n * })\n * })\n *\n * const agent = createReactAgent({ llm: model, tools: [getWeather] });\n *\n * const inputs = {\n * messages: [{ role: \"user\", content: \"what is the weather in SF?\" }],\n * };\n *\n * const stream = await agent.stream(inputs, { streamMode: \"values\" });\n *\n * for await (const { messages } of stream) {\n * console.log(messages);\n * }\n * // Returns the messages in the state at each step of execution\n * ```\n */\nexport declare function createReactAgent<A extends AnyAnnotationRoot | InteropZodObject = typeof MessagesAnnotation, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nStructuredResponseFormat extends Record<string, any> = Record<string, any>, C extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot>(params: CreateReactAgentParams<A, StructuredResponseFormat, C>): CompiledStateGraph<ToAnnotationRoot<A>[\"State\"], ToAnnotationRoot<A>[\"Update\"], \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nany, typeof MessagesAnnotation.spec & ToAnnotationRoot<A>[\"spec\"], ReturnType<typeof createReactAgentAnnotation<StructuredResponseFormat>>[\"spec\"] & ToAnnotationRoot<A>[\"spec\"]>;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UAkBiB6B;AAAjB;+BAE+BC,MAFJ,CAAA,MAAA,EAAA,GAAA,CAAA,GAE0BA,MAF1B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA;UAEIA,EACjBzB,WADiByB,EAAAA;;;;;EASnBE;EACPC,kBAAAA,EAHmBF,sBAGY;;AAETA,KAHfC,CAAAA,GA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AAA,CAAAA,QAAAA,CAAAA,GAL6BkC,iBAK7BlC,CAAAA,QAAAA,CAAAA,EAL0DA,uBAK1DA,CAAAA;;;AA2D9F;;eAAmDmC,CAAAA,EA3D/B/C,YA2D+B+C,CA3DlBC,gBA2DkBD,CA3DDE,CA2DCF,CAAAA,CAAAA,OAAAA,CAAAA,EA3DYC,gBA2DZD,CA3D6BE,CA2D7BF,CAAAA,CAAAA,QAAAA,CAAAA,EA3D2CnC,uBA2D3CmC,CAAAA;;;;;;;;;;;;SAEkME,CAAAA,EAAAA,IAAAA,GAAAA,IAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAF7NG,2BAA2BL,oBAAoB5C,0BAA0BO;;iCAEhEQ,sBAAsBA,+BAA+B6B,oBAAoB5C,mBAAmB4C,2BAA2BG,uBAAuBD,GAAGI,0BAA0BF,KAAK3C,mBAAmBwC,iBAAiBC,aAAaD,iBAAiBC;;YAEvQvC,kBAAAA,CAAmB4C,OAAON,iBAAiBC,YAAYM,kBAAkBjB,2BAA2Be,qCAAqCL,iBAAiBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/langgraph",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "LangGraph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"author": "LangChain",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@langchain/langgraph-checkpoint": "^0.
|
|
36
|
-
"@langchain/langgraph-sdk": "~0.
|
|
35
|
+
"@langchain/langgraph-checkpoint": "^1.0.0",
|
|
36
|
+
"@langchain/langgraph-sdk": "~1.0.0",
|
|
37
37
|
"uuid": "^10.0.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@langchain/core": "
|
|
40
|
+
"@langchain/core": "^1.0.1",
|
|
41
41
|
"zod": "^3.25.32 || ^4.1.0",
|
|
42
42
|
"zod-to-json-schema": "^3.x"
|
|
43
43
|
},
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@langchain/anthropic": "^0.
|
|
51
|
-
"@langchain/core": "^1.0.
|
|
52
|
-
"@langchain/langgraph-checkpoint": "0.
|
|
53
|
-
"@langchain/langgraph-checkpoint-postgres": "0.
|
|
54
|
-
"@langchain/langgraph-checkpoint-sqlite": "0.
|
|
55
|
-
"@langchain/langgraph-sdk": "0.
|
|
56
|
-
"@langchain/openai": "^0.
|
|
50
|
+
"@langchain/anthropic": "^1.0.0",
|
|
51
|
+
"@langchain/core": "^1.0.1",
|
|
52
|
+
"@langchain/langgraph-checkpoint": "1.0.0",
|
|
53
|
+
"@langchain/langgraph-checkpoint-postgres": "1.0.0",
|
|
54
|
+
"@langchain/langgraph-checkpoint-sqlite": "1.0.0",
|
|
55
|
+
"@langchain/langgraph-sdk": "1.0.0",
|
|
56
|
+
"@langchain/openai": "^1.0.0",
|
|
57
57
|
"@langchain/scripts": ">=0.1.3 <0.2.0",
|
|
58
|
-
"@langchain/tavily": "^0.
|
|
58
|
+
"@langchain/tavily": "^1.0.0",
|
|
59
59
|
"@swc/core": "^1.3.90",
|
|
60
60
|
"@testing-library/dom": "^10.4.0",
|
|
61
61
|
"@tsconfig/recommended": "^1.0.3",
|