LangChain has introduced the discharge of model 0.3, bringing vital upgrades and enhancements to each Python and JavaScript ecosystems, in keeping with the LangChain Weblog.
What’s Modified
Python
All packages have been upgraded from Pydantic 1 to Pydantic 2 internally, totally supporting the usage of Pydantic 2 in person code with out the necessity for bridges like langchain_core.pydantic_v1
or pydantic.v1
. Pydantic 1, which reached its end-of-life in June 2024, will not be supported. Moreover, Python 3.8 help can be discontinued as its end-of-life is scheduled for October 2024.
JavaScript
All LangChain packages now record @langchain/core
as a peer dependency as an alternative of a direct dependency to keep away from sort errors associated to core model conflicts. Customers should explicitly set up @langchain/core
somewhat than counting on an internally resolved model from different packages. Different modifications embrace making callbacks backgrounded and non-blocking by default, and the removing of deprecated doc loader and self-query entrypoints from langchain
in favor of entrypoints in @langchain/neighborhood
and integration packages. Deprecated Google PaLM entrypoints have additionally been eliminated in favor of entrypoints in @langchain/google-vertexai
and @langchain/google-genai
. Moreover, objects with a "sort"
as a BaseMessageLike
are deprecated in favor of the extra OpenAI-like MessageWithRole
.
What’s New
LangChain v0.3 introduces a number of new options and enhancements:
- Extra integrations have been moved from
langchain-community
to their very ownlangchain-{identify}
packages, permitting higher dependency administration, testing, and versioning. The legacy implementations stay inlangchain-community
however are marked as deprecated. - Revamped integration docs and API references.
- Simplified software definition and utilization.
- New utilities for interacting with chat fashions, together with a common mannequin constructor, message trimming, filtering and merging utilities, and a fee limiter.
- Skill to dispatch customized occasions.
The way to Replace Your Code
To help customers in migrating to LangChain v0.3, detailed how-to guides for each Python and JavaScript can be found.
Documentation
LangChain documentation is versioned, and former variations will stay accessible at their respective URLs.
LangGraph
LangGraph is a library for constructing stateful, multi-actor functions with LLMs. As of LangChain v0.2, LangGraph is the really helpful strategy to construct brokers. It features a pre-built LangGraph object equal to the LangChain AgentExecutor, simplifying the usage of out-of-the-box agent options.
What’s Coming
The LangChain group is planning additional enhancements to LangChain’s multi-modal capabilities and continues to work on enhancing documentation and integration reliability.
Picture supply: Shutterstock