A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://python.langchain.com/docs/versions/migrating_chains/ below:

Website Navigation


How to migrate from v0.0 chains

How to migrate from v0.0 chains

LangChain has evolved since its initial release, and many of the original "Chain" classes have been deprecated in favor of the more flexible and powerful frameworks of LCEL and LangGraph.

This guide will help you migrate your existing v0.0 chains to the new abstractions.

How deprecated implementations work

Even though many of these implementations are deprecated, they are still supported in the codebase. However, they are not recommended for new development, and we recommend re-implementing them using the following guides!

To see the planned removal version for each deprecated implementation, check their API reference.

LangChain maintains a number of legacy abstractions. Many of these can be reimplemented via short combinations of LCEL and LangGraph primitives.

LCEL

LCEL is designed to streamline the process of building useful apps with LLMs and combining related components. It does this by providing:

  1. A unified interface: Every LCEL object implements the Runnable interface, which defines a common set of invocation methods (invoke, batch, stream, ainvoke, ...). This makes it possible to also automatically and consistently support useful operations like streaming of intermediate steps and batching, since every chain composed of LCEL objects is itself an LCEL object.
  2. Composition primitives: LCEL provides a number of primitives that make it easy to compose chains, parallelize components, add fallbacks, dynamically configure chain internals, and more.
LangGraph

LangGraph, built on top of LCEL, allows for performant orchestrations of application components while maintaining concise and readable code. It includes built-in persistence, support for cycles, and prioritizes controllability. If LCEL grows unwieldy for larger or more complex chains, they may benefit from a LangGraph implementation.

Advantages

Using these frameworks for existing v0.0 chains confers some advantages:

The below pages assist with migration from various specific chains to LCEL and LangGraph:

Check out the LCEL conceptual docs and LangGraph docs for more background information.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4