Update MIGRATE.md (#27169)

Upgrade the content of MIGRATE.md so it's in sync
This commit is contained in:
Eugene Yurtsev 2024-10-07 14:53:40 -04:00 committed by GitHub
parent 780ce00dea
commit 8f8392137a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,70 +1,11 @@
# Migrating # Migrating
## 🚨Breaking Changes for select chains (SQLDatabase) on 7/28/23 Please see the following guides for migratin LangChain code:
In an effort to make `langchain` leaner and safer, we are moving select chains to `langchain_experimental`. * Migrate to [LangChain v0.3](https://python.langchain.com/docs/versions/v0_3/)
This migration has already started, but we are remaining backwards compatible until 7/28. * Migrate to [LangChain v0.2](https://python.langchain.com/docs/versions/v0_2/)
On that date, we will remove functionality from `langchain`. * Migrating from [LangChain 0.0.x Chains](https://python.langchain.com/docs/versions/migrating_chains/)
Read more about the motivation and the progress [here](https://github.com/langchain-ai/langchain/discussions/8043). * Upgrate to [LangGraph Memory](https://python.langchain.com/docs/versions/migrating_memory/)
### Migrating to `langchain_experimental` The [LangChain CLI](https://python.langchain.com/docs/versions/v0_3/#migrate-using-langchain-cli) can help automatically upgrade your code to use non deprecated imports.
This will be especially helpful if you're still on either version 0.0.x or 0.1.x of LangChain.
We are moving any experimental components of LangChain, or components with vulnerability issues, into `langchain_experimental`.
This guide covers how to migrate.
### Installation
Previously:
`pip install -U langchain`
Now (only if you want to access things in experimental):
`pip install -U langchain langchain_experimental`
### Things in `langchain.experimental`
Previously:
`from langchain.experimental import ...`
Now:
`from langchain_experimental import ...`
### PALChain
Previously:
`from langchain.chains import PALChain`
Now:
`from langchain_experimental.pal_chain import PALChain`
### SQLDatabaseChain
Previously:
`from langchain.chains import SQLDatabaseChain`
Now:
`from langchain_experimental.sql import SQLDatabaseChain`
Alternatively, if you are just interested in using the query generation part of the SQL chain, you can check out this [`SQL question-answering tutorial`](https://python.langchain.com/v0.2/docs/tutorials/sql_qa/#convert-question-to-sql-query)
`from langchain.chains import create_sql_query_chain`
### `load_prompt` for Python files
Note: this only applies if you want to load Python files as prompts.
If you want to load json/yaml files, no change is needed.
Previously:
`from langchain.prompts import load_prompt`
Now:
`from langchain_experimental.prompts import load_prompt`