← All recipes
Moderne licensed

Replace langchain legacy imports with langchain_classic

Recipe IDorg.openrewrite.python.migrate.langchain.ReplaceLangchainClassicImportsArtifactopenrewrite-migrate-python

Migrate legacy chain, retriever, and indexing imports from langchain to langchain_classic. These were moved in LangChain v1.0.

Single recipepython1.0langchainmigrationProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.python.migrate.langchain.ReplaceLangchainClassicImports

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-migrate-python