Upgrade to LangChain 0.2

Proprietary

Migrate to LangChain 0.2 by updating imports from langchain to langchain_community and provider-specific packages.

org.openrewrite.python.migrate.langchain.UpgradeToLangChain02
mod run . --recipe=org.openrewrite.python.migrate.langchain.UpgradeToLangChain02

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Replace langchain imports with langchain_community
  2. Replace langchain_community imports with provider packages