langchain 1.0.0-alpha.2 → 1.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/agents/ReactAgent.cjs +1 -1
  2. package/dist/agents/ReactAgent.cjs.map +1 -1
  3. package/dist/agents/ReactAgent.d.cts +3 -3
  4. package/dist/agents/ReactAgent.d.cts.map +1 -1
  5. package/dist/agents/ReactAgent.d.ts +3 -3
  6. package/dist/agents/ReactAgent.d.ts.map +1 -1
  7. package/dist/agents/ReactAgent.js +2 -2
  8. package/dist/agents/ReactAgent.js.map +1 -1
  9. package/dist/agents/annotation.cjs +122 -2
  10. package/dist/agents/annotation.cjs.map +1 -1
  11. package/dist/agents/annotation.d.cts +18 -14
  12. package/dist/agents/annotation.d.cts.map +1 -1
  13. package/dist/agents/annotation.d.ts +18 -14
  14. package/dist/agents/annotation.d.ts.map +1 -1
  15. package/dist/agents/annotation.js +121 -2
  16. package/dist/agents/annotation.js.map +1 -1
  17. package/dist/agents/errors.cjs +1 -1
  18. package/dist/agents/errors.cjs.map +1 -1
  19. package/dist/agents/errors.js +1 -1
  20. package/dist/agents/errors.js.map +1 -1
  21. package/dist/agents/index.cjs +2 -2
  22. package/dist/agents/index.cjs.map +1 -1
  23. package/dist/agents/index.d.cts +15 -15
  24. package/dist/agents/index.d.cts.map +1 -1
  25. package/dist/agents/index.d.ts +15 -15
  26. package/dist/agents/index.d.ts.map +1 -1
  27. package/dist/agents/index.js +2 -2
  28. package/dist/agents/index.js.map +1 -1
  29. package/dist/agents/nodes/AgentNode.cjs +8 -3
  30. package/dist/agents/nodes/AgentNode.cjs.map +1 -1
  31. package/dist/agents/nodes/AgentNode.js +8 -3
  32. package/dist/agents/nodes/AgentNode.js.map +1 -1
  33. package/dist/agents/nodes/ToolNode.cjs +2 -2
  34. package/dist/agents/nodes/ToolNode.cjs.map +1 -1
  35. package/dist/agents/nodes/ToolNode.d.cts +1 -1
  36. package/dist/agents/nodes/ToolNode.d.cts.map +1 -1
  37. package/dist/agents/nodes/ToolNode.d.ts +1 -1
  38. package/dist/agents/nodes/ToolNode.d.ts.map +1 -1
  39. package/dist/agents/nodes/ToolNode.js +2 -2
  40. package/dist/agents/nodes/ToolNode.js.map +1 -1
  41. package/dist/agents/responses.cjs +2 -3
  42. package/dist/agents/responses.cjs.map +1 -1
  43. package/dist/agents/responses.d.cts +6 -1
  44. package/dist/agents/responses.d.cts.map +1 -1
  45. package/dist/agents/responses.d.ts +6 -1
  46. package/dist/agents/responses.d.ts.map +1 -1
  47. package/dist/agents/responses.js +2 -3
  48. package/dist/agents/responses.js.map +1 -1
  49. package/dist/agents/types.d.cts +28 -10
  50. package/dist/agents/types.d.cts.map +1 -1
  51. package/dist/agents/types.d.ts +28 -10
  52. package/dist/agents/types.d.ts.map +1 -1
  53. package/dist/agents/utils.cjs +1 -1
  54. package/dist/agents/utils.cjs.map +1 -1
  55. package/dist/agents/utils.js +1 -1
  56. package/dist/agents/utils.js.map +1 -1
  57. package/dist/agents/withAgentName.cjs +1 -1
  58. package/dist/agents/withAgentName.cjs.map +1 -1
  59. package/dist/agents/withAgentName.js +1 -1
  60. package/dist/agents/withAgentName.js.map +1 -1
  61. package/dist/evaluation/agents/trajectory.d.cts.map +1 -1
  62. package/dist/evaluation/agents/trajectory.d.ts.map +1 -1
  63. package/dist/evaluation/comparison/pairwise.d.cts.map +1 -1
  64. package/dist/evaluation/comparison/pairwise.d.ts.map +1 -1
  65. package/dist/evaluation/criteria/criteria.d.cts.map +1 -1
  66. package/dist/evaluation/criteria/criteria.d.ts.map +1 -1
  67. package/dist/index.cjs +52 -3
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.d.cts +4 -4
  70. package/dist/index.d.ts +4 -4
  71. package/dist/index.js +12 -5
  72. package/dist/index.js.map +1 -1
  73. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * LangChain Messages\n */\nexport {\n BaseMessage,\n AIMessage,\n SystemMessage,\n HumanMessage,\n ToolMessage,\n} from \"@langchain/core/messages\";\n\n/**\n * Universal Chat Model\n */\nexport { initChatModel } from \"./chat_models/universal.js\";\n\n/**\n * LangChain Tools\n */\nexport { tool, DynamicStructuredTool } from \"@langchain/core/tools\";\n\n/**\n * LangChain Agents\n */\nexport {\n createReactAgent,\n toolStrategy,\n providerStrategy,\n ToolNode,\n type AgentState,\n type HumanInterrupt,\n type HumanInterruptConfig,\n type ActionRequest,\n type HumanResponse,\n} from \"./agents/index.js\";\n\n/**\n * LangChain Memory\n * Check in what we want to export here\n */\nexport { MemorySaver, InMemoryStore } from \"@langchain/langgraph\";\n\n/**\n * LangChain Context\n */\nexport {\n setContextVariable,\n getContextVariable,\n} from \"@langchain/core/context\";\n\n/**\n * LangChain Documents\n */\nexport { Document } from \"@langchain/core/documents\";\n"],"mappings":""}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * LangChain Messages\n */\nexport {\n BaseMessage,\n BaseMessageChunk,\n AIMessage,\n AIMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n type ContentBlock,\n filterMessages,\n trimMessages,\n} from \"@langchain/core/messages\";\n\n/**\n * Universal Chat Model\n */\nexport { initChatModel } from \"./chat_models/universal.js\";\n\n/**\n * LangChain Tools\n */\nexport { tool, DynamicStructuredTool } from \"@langchain/core/tools\";\n\n/**\n * LangChain Agents\n */\nexport {\n createAgent,\n toolStrategy,\n providerStrategy,\n ToolNode,\n type AgentState,\n type AgentRuntime,\n type HumanInterrupt,\n type HumanInterruptConfig,\n type ActionRequest,\n type HumanResponse,\n} from \"./agents/index.js\";\n\n/**\n * LangChain Memory\n * Check in what we want to export here\n */\nexport { MemorySaver, InMemoryStore } from \"@langchain/langgraph\";\n\n/**\n * LangChain Context\n */\nexport {\n setContextVariable,\n getContextVariable,\n} from \"@langchain/core/context\";\n\n/**\n * LangChain Documents\n */\nexport { Document } from \"@langchain/core/documents\";\n"],"mappings":""}
package/dist/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { initChatModel } from "./chat_models/universal.cjs";
2
2
  import { providerStrategy, toolStrategy } from "./agents/responses.cjs";
3
3
  import { ToolNode } from "./agents/nodes/ToolNode.cjs";
4
- import { AgentState } from "./agents/types.cjs";
4
+ import { AgentRuntime, AgentState } from "./agents/types.cjs";
5
5
  import { ActionRequest, HumanInterrupt, HumanInterruptConfig, HumanResponse } from "./agents/interrupt.cjs";
6
- import { createReactAgent } from "./agents/index.cjs";
6
+ import { createAgent } from "./agents/index.cjs";
7
7
  import { Document } from "@langchain/core/documents";
8
- import { AIMessage, BaseMessage, HumanMessage, SystemMessage, ToolMessage } from "@langchain/core/messages";
8
+ import { AIMessage, AIMessageChunk, BaseMessage, BaseMessageChunk, ContentBlock, HumanMessage, HumanMessageChunk, SystemMessage, SystemMessageChunk, ToolMessage, ToolMessageChunk, filterMessages, trimMessages } from "@langchain/core/messages";
9
9
  import { DynamicStructuredTool, tool } from "@langchain/core/tools";
10
10
  import { InMemoryStore, MemorySaver } from "@langchain/langgraph";
11
11
  import { getContextVariable, setContextVariable } from "@langchain/core/context";
12
- export { AIMessage, type ActionRequest, type AgentState, BaseMessage, Document, DynamicStructuredTool, type HumanInterrupt, type HumanInterruptConfig, HumanMessage, type HumanResponse, InMemoryStore, MemorySaver, SystemMessage, ToolMessage, ToolNode, createReactAgent, getContextVariable, initChatModel, providerStrategy, setContextVariable, tool, toolStrategy };
12
+ export { AIMessage, AIMessageChunk, type ActionRequest, type AgentRuntime, type AgentState, BaseMessage, BaseMessageChunk, type ContentBlock, Document, DynamicStructuredTool, type HumanInterrupt, type HumanInterruptConfig, HumanMessage, HumanMessageChunk, type HumanResponse, InMemoryStore, MemorySaver, SystemMessage, SystemMessageChunk, ToolMessage, ToolMessageChunk, ToolNode, createAgent, filterMessages, getContextVariable, initChatModel, providerStrategy, setContextVariable, tool, toolStrategy, trimMessages };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { initChatModel } from "./chat_models/universal.js";
2
2
  import { providerStrategy, toolStrategy } from "./agents/responses.js";
3
3
  import { ToolNode } from "./agents/nodes/ToolNode.js";
4
- import { AgentState } from "./agents/types.js";
4
+ import { AgentRuntime, AgentState } from "./agents/types.js";
5
5
  import { ActionRequest, HumanInterrupt, HumanInterruptConfig, HumanResponse } from "./agents/interrupt.js";
6
- import { createReactAgent } from "./agents/index.js";
6
+ import { createAgent } from "./agents/index.js";
7
7
  import { Document } from "@langchain/core/documents";
8
- import { AIMessage, BaseMessage, HumanMessage, SystemMessage, ToolMessage } from "@langchain/core/messages";
8
+ import { AIMessage, AIMessageChunk, BaseMessage, BaseMessageChunk, ContentBlock, HumanMessage, HumanMessageChunk, SystemMessage, SystemMessageChunk, ToolMessage, ToolMessageChunk, filterMessages, trimMessages } from "@langchain/core/messages";
9
9
  import { DynamicStructuredTool, tool } from "@langchain/core/tools";
10
10
  import { InMemoryStore, MemorySaver } from "@langchain/langgraph";
11
11
  import { getContextVariable, setContextVariable } from "@langchain/core/context";
12
- export { AIMessage, type ActionRequest, type AgentState, BaseMessage, Document, DynamicStructuredTool, type HumanInterrupt, type HumanInterruptConfig, HumanMessage, type HumanResponse, InMemoryStore, MemorySaver, SystemMessage, ToolMessage, ToolNode, createReactAgent, getContextVariable, initChatModel, providerStrategy, setContextVariable, tool, toolStrategy };
12
+ export { AIMessage, AIMessageChunk, type ActionRequest, type AgentRuntime, type AgentState, BaseMessage, BaseMessageChunk, type ContentBlock, Document, DynamicStructuredTool, type HumanInterrupt, type HumanInterruptConfig, HumanMessage, HumanMessageChunk, type HumanResponse, InMemoryStore, MemorySaver, SystemMessage, SystemMessageChunk, ToolMessage, ToolMessageChunk, ToolNode, createAgent, filterMessages, getContextVariable, initChatModel, providerStrategy, setContextVariable, tool, toolStrategy, trimMessages };
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@ import { __export } from "./_virtual/rolldown_runtime.js";
2
2
  import { initChatModel } from "./chat_models/universal.js";
3
3
  import { providerStrategy, toolStrategy } from "./agents/responses.js";
4
4
  import { ToolNode } from "./agents/nodes/ToolNode.js";
5
- import { createReactAgent } from "./agents/index.js";
5
+ import { createAgent } from "./agents/index.js";
6
6
  import { Document } from "@langchain/core/documents";
7
- import { AIMessage, BaseMessage, HumanMessage, SystemMessage, ToolMessage } from "@langchain/core/messages";
7
+ import { AIMessage, AIMessageChunk, BaseMessage, BaseMessageChunk, HumanMessage, HumanMessageChunk, SystemMessage, SystemMessageChunk, ToolMessage, ToolMessageChunk, filterMessages, trimMessages } from "@langchain/core/messages";
8
8
  import { DynamicStructuredTool, tool } from "@langchain/core/tools";
9
9
  import { InMemoryStore, MemorySaver } from "@langchain/langgraph";
10
10
  import { getContextVariable, setContextVariable } from "@langchain/core/context";
@@ -13,24 +13,31 @@ import { getContextVariable, setContextVariable } from "@langchain/core/context"
13
13
  var src_exports = {};
14
14
  __export(src_exports, {
15
15
  AIMessage: () => AIMessage,
16
+ AIMessageChunk: () => AIMessageChunk,
16
17
  BaseMessage: () => BaseMessage,
18
+ BaseMessageChunk: () => BaseMessageChunk,
17
19
  Document: () => Document,
18
20
  DynamicStructuredTool: () => DynamicStructuredTool,
19
21
  HumanMessage: () => HumanMessage,
22
+ HumanMessageChunk: () => HumanMessageChunk,
20
23
  InMemoryStore: () => InMemoryStore,
21
24
  MemorySaver: () => MemorySaver,
22
25
  SystemMessage: () => SystemMessage,
26
+ SystemMessageChunk: () => SystemMessageChunk,
23
27
  ToolMessage: () => ToolMessage,
28
+ ToolMessageChunk: () => ToolMessageChunk,
24
29
  ToolNode: () => ToolNode,
25
- createReactAgent: () => createReactAgent,
30
+ createAgent: () => createAgent,
31
+ filterMessages: () => filterMessages,
26
32
  getContextVariable: () => getContextVariable,
27
33
  initChatModel: () => initChatModel,
28
34
  providerStrategy: () => providerStrategy,
29
35
  setContextVariable: () => setContextVariable,
30
36
  tool: () => tool,
31
- toolStrategy: () => toolStrategy
37
+ toolStrategy: () => toolStrategy,
38
+ trimMessages: () => trimMessages
32
39
  });
33
40
 
34
41
  //#endregion
35
- export { AIMessage, BaseMessage, Document, DynamicStructuredTool, HumanMessage, InMemoryStore, MemorySaver, SystemMessage, ToolMessage, ToolNode, createReactAgent, getContextVariable, initChatModel, providerStrategy, setContextVariable, src_exports, tool, toolStrategy };
42
+ export { AIMessage, AIMessageChunk, BaseMessage, BaseMessageChunk, Document, DynamicStructuredTool, HumanMessage, HumanMessageChunk, InMemoryStore, MemorySaver, SystemMessage, SystemMessageChunk, ToolMessage, ToolMessageChunk, ToolNode, createAgent, filterMessages, getContextVariable, initChatModel, providerStrategy, setContextVariable, src_exports, tool, toolStrategy, trimMessages };
36
43
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * LangChain Messages\n */\nexport {\n BaseMessage,\n AIMessage,\n SystemMessage,\n HumanMessage,\n ToolMessage,\n} from \"@langchain/core/messages\";\n\n/**\n * Universal Chat Model\n */\nexport { initChatModel } from \"./chat_models/universal.js\";\n\n/**\n * LangChain Tools\n */\nexport { tool, DynamicStructuredTool } from \"@langchain/core/tools\";\n\n/**\n * LangChain Agents\n */\nexport {\n createReactAgent,\n toolStrategy,\n providerStrategy,\n ToolNode,\n type AgentState,\n type HumanInterrupt,\n type HumanInterruptConfig,\n type ActionRequest,\n type HumanResponse,\n} from \"./agents/index.js\";\n\n/**\n * LangChain Memory\n * Check in what we want to export here\n */\nexport { MemorySaver, InMemoryStore } from \"@langchain/langgraph\";\n\n/**\n * LangChain Context\n */\nexport {\n setContextVariable,\n getContextVariable,\n} from \"@langchain/core/context\";\n\n/**\n * LangChain Documents\n */\nexport { Document } from \"@langchain/core/documents\";\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * LangChain Messages\n */\nexport {\n BaseMessage,\n BaseMessageChunk,\n AIMessage,\n AIMessageChunk,\n SystemMessage,\n SystemMessageChunk,\n HumanMessage,\n HumanMessageChunk,\n ToolMessage,\n ToolMessageChunk,\n type ContentBlock,\n filterMessages,\n trimMessages,\n} from \"@langchain/core/messages\";\n\n/**\n * Universal Chat Model\n */\nexport { initChatModel } from \"./chat_models/universal.js\";\n\n/**\n * LangChain Tools\n */\nexport { tool, DynamicStructuredTool } from \"@langchain/core/tools\";\n\n/**\n * LangChain Agents\n */\nexport {\n createAgent,\n toolStrategy,\n providerStrategy,\n ToolNode,\n type AgentState,\n type AgentRuntime,\n type HumanInterrupt,\n type HumanInterruptConfig,\n type ActionRequest,\n type HumanResponse,\n} from \"./agents/index.js\";\n\n/**\n * LangChain Memory\n * Check in what we want to export here\n */\nexport { MemorySaver, InMemoryStore } from \"@langchain/langgraph\";\n\n/**\n * LangChain Context\n */\nexport {\n setContextVariable,\n getContextVariable,\n} from \"@langchain/core/context\";\n\n/**\n * LangChain Documents\n */\nexport { Document } from \"@langchain/core/documents\";\n"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.4",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "author": "LangChain",
6
6
  "license": "MIT",
@@ -46,9 +46,9 @@
46
46
  "typeorm": "^0.3.20",
47
47
  "typescript": "~5.8.3",
48
48
  "vitest": "^3.2.4",
49
- "@langchain/anthropic": "1.0.0-alpha.1",
50
- "@langchain/core": "1.0.0-alpha.1",
51
- "@langchain/cohere": "0.3.4"
49
+ "@langchain/core": "1.0.0-alpha.2",
50
+ "@langchain/cohere": "0.3.4",
51
+ "@langchain/anthropic": "1.0.0-alpha.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@langchain/core": "^1.0.0-alpha.1 <2.0.0",
@@ -77,8 +77,8 @@
77
77
  "uuid": "^10.0.0",
78
78
  "yaml": "^2.2.1",
79
79
  "zod": "^3.25.32",
80
- "@langchain/openai": "1.0.0-alpha.1",
81
- "@langchain/textsplitters": "1.0.0-alpha.1"
80
+ "@langchain/textsplitters": "1.0.0-alpha.1",
81
+ "@langchain/openai": "1.0.0-alpha.1"
82
82
  },
83
83
  "optionalDependencies": {
84
84
  "langsmith": "^0.3.64"