Files
langchain/libs/langchain
Mohammad Mohtashim 2d8100c4fa fix(langchain-classic): fix Chain.save() regression from dict-to-model_dump migration (#35667)
Fixes #35665

---

Fixes a regression introduced in #33035 where `Chain.save()` stopped
working for chain types that support saving, including `LLMChain`.

`Chain.save()` now calls `self.model_dump()`, but the `_type` injection
still lived in the deprecated `dict()` override. As a result, serialized
chains no longer included `_type`, and `save()` always raised the "does
not support saving" error.

This moves the override to `model_dump()` so saved chain output includes
`_type` again. Pydantic v2's `dict()` method delegates to
`model_dump()`, so existing `dict()` callers continue to get the same
serialized shape.
2026-07-06 12:15:21 -04:00
..

🦜🔗 LangChain Classic

PyPI - Version PyPI - License PyPI - Downloads Twitter

Looking for the JS/TS version? Check out LangChain.js.

To help you ship LangChain apps to production faster, check out LangSmith. LangSmith is a unified developer platform for building, testing, and monitoring LLM applications.

Quick Install

uv add langchain-classic

🤔 What is this?

Legacy chains, langchain-community re-exports, indexing API, deprecated functionality, and more.

In most cases, you should be using the main langchain package.

📖 Documentation

For full documentation, see the API reference. For conceptual guides, tutorials, and examples on using LangChain, see the LangChain Docs.

📕 Releases & Versioning

See our Releases and Versioning policies.

💁 Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

For detailed information on how to contribute, see the Contributing Guide.

Resources

  • LangChain Academy — comprehensive, free courses on LangChain libraries and products, made by the LangChain team
  • Code of Conduct — community guidelines and standards