fix(createReactAgent): update deprecation messages to contain reactAgent (#1600)

Co-authored-by: David Duong <david@duong.cz>
This commit is contained in:
Christian Bromann
2025-09-02 10:57:00 -07:00
committed by GitHub
parent 914446d85f
commit dc2e5f2e5b
3 changed files with 10 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@langchain/langgraph": patch
---
fix(createReactAgent): update deprecation messages to contain reactAgent
+3 -3
View File
@@ -28,7 +28,7 @@ export OPENAI_API_KEY=<your_api_key>
```ts
import { z } from "zod";
import { ChatOpenAI } from "@langchain/openai";
import { tool, createReactAgent } from "langchain";
import { tool, createAgent } from "langchain";
import { MemorySaver } from "@langchain/langgraph";
import { createSwarm, createHandoffTool } from "@langchain/langgraph-swarm";
@@ -48,14 +48,14 @@ const add = tool(
);
// Create agents with handoff tools
const alice = createReactAgent({
const alice = createAgent({
llm: model,
tools: [add, createHandoffTool({ agentName: "Bob" })],
name: "Alice",
prompt: "You are Alice, an addition expert."
});
const bob = createReactAgent({
const bob = createAgent({
llm: model,
tools: [createHandoffTool({
agentName: "Alice",
@@ -480,7 +480,7 @@ type ToAnnotationRoot<A extends AnyAnnotationRoot | InteropZodObject> =
/**
* @deprecated `CreateReactAgentParams` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
* Update your import to `import { CreateReactAgentParams } from "langchain";`
* Update your import to `import { CreateAgentParams } from "langchain";`
*/
export type CreateReactAgentParams<
A extends AnyAnnotationRoot | InteropZodObject = AnyAnnotationRoot,
@@ -623,7 +623,7 @@ export type CreateReactAgentParams<
/**
* @deprecated `createReactAgent` has been moved to {@link https://www.npmjs.com/package/langchain langchain} package.
* Update your import to `import { createReactAgent } from "langchain";`
* Update your import to `import { createAgent } from "langchain";`
*
* Creates a StateGraph agent that relies on a chat model utilizing tool calling.
*