DATE:
AUTHOR:
The LangChain Team
LangChain

🚀 LangChain v0.3: Migrating to Pydantic 2 for Python & peer dependencies for JavaScript

DATE:
AUTHOR: The LangChain Team

We’re excited to announce the release of LangChain v0.3 for both Python and JavaScript! Here's a quick rundown of the key changes and new features:

What's Changed?

Python:

  • Upgrade to Pydantic 2: All packages now use Pydantic 2, eliminating the need for compatibility bridges. Pydantic 1 is no longer supported.

  • End of Python 3.8 Support: Python 3.8 support ends in October 2024, so make sure to upgrade if you're still on this version.

JavaScript:

  • Peer Dependency for @langchain/core: You’ll need to install @langchain/core explicitly in your projects to avoid type errors.

  • Non-blocking Callbacks by Default: Callbacks are now backgrounded, especially useful in serverless environments. Remember to await them to ensure they finish properly.

  • Deprecated Entry Points Removed: Older document loaders, self-query entry points, and Google PaLM entry points have been deprecated in favor of newer packages.

What's New?

  • Modular Integrations: Moved more integrations into standalone packages, streamlining dependency management and versioning. Check out the API references for Python and JavaScript

  • Simplified Tool Definitions: We’ve made defining and using tools easier than ever. Learn more here.

  • Chat Model Utilities: New utilities for interacting with chat models, such as trimming, filtering, and message merging.

  • Custom Event Dispatching: Now you can dispatch custom events across Python and JavaScript ecosystems.

LangGraph Update

LangGraph remains the recommended tool for building agents and workflows with LLMs. We’ve streamlined the experience to make migration easier. See here for migration documentation.

How to Update Your Code:

Check out our migration guides for both Python and JavaScript to get started with v0.3.


For full details, read more in our blog post and updated documentation.

Powered by LaunchNotes