langchain
@langchain/core
@langchain/anthropic
@langchain/openai
langchain
langchain
package now exports key primitives like tool
, message types, ToolNode
, createAgent
, and more directly from the root package.
createAgent
in core langchain
langchain
project. Import directly from langchain
:
@langchain/openai
for openai:gpt-4o-mini
).
ToolNode
exported from langchain
handleToolErrors
is true
(default), tool exceptions are caught and converted into a ToolMessage
so the agent can recover. Set it to false
to surface raw errors for strict workflows.
@langchain/core
features standard, typed message content. This includes standard types for reasoning, citations, server-side tool calls, and other modern LLM features.
There are no breaking changes associated with existing message content. The standard content can be lazily-parsed off of existing v0 messages using the contentBlocks
property:
Require Node.js ≥ 20
Removed legacy subpath exports
langchain/schema/*
exports removedlangchain/schema/prompt_template
→ use langchain/prompts
langchain/schema/query_constructor
→ use langchain/chains/query_constructor
langchain/runnables/remote
export removedIf you used this entrypoint, migrate off this subpath (no 1:1 replacement export in langchain
package).langchain/smith
export path removedUse the separate langsmith
package and opt-in (see fixes section below).Prebuilt Callbacks removed from `langchain`
./callbacks
entrypoint is gone. Prefer LCEL observability (runnables), agent/tool messages, or provider-native hooks instead.Agents imports removed from `langchain`
./agents
imports have been removed from the langchain
package. There is no direct replacement - use createAgent
instead for building agents.Removed `@langchain/azure-openai` package
@langchain/azure-openai
package has been removed as all its primitives were deprecated.Migration: Use @langchain/openai
with Azure OpenAI configuration instead:engines.node
to >=20
and update CI runners:
langchain/schema/*
exports removed:
createAgent
:
model
as a model name string to createAgent
. This requires you to have the specific model provider package installed (e.g. @langchain/openai
for openai:gpt-4o-mini
).
Use ToolNode
to encapsulate tool execution in graphs:
ToolNode
:
'v1'
label.