2023-11-14 01:37:54 +00:00
# Migrating
## 🚨Breaking Changes for select chains (SQLDatabase) on 7/28/23
In an effort to make `langchain` leaner and safer, we are moving select chains to `langchain_experimental` .
This migration has already started, but we are remaining backwards compatible until 7/28.
On that date, we will remove functionality from `langchain` .
Read more about the motivation and the progress [here ](https://github.com/langchain-ai/langchain/discussions/8043 ).
### Migrating to `langchain_experimental`
2023-07-21 20:32:39 +00:00
2023-07-22 15:27:29 +00:00
We are moving any experimental components of LangChain, or components with vulnerability issues, into `langchain_experimental` .
2023-07-21 20:32:39 +00:00
This guide covers how to migrate.
2023-11-14 01:37:54 +00:00
### Installation
2023-07-21 20:32:39 +00:00
Previously:
`pip install -U langchain`
2023-07-22 15:27:29 +00:00
Now (only if you want to access things in experimental):
2023-07-21 20:32:39 +00:00
2023-07-22 01:44:32 +00:00
`pip install -U langchain langchain_experimental`
2023-07-21 20:32:39 +00:00
2023-11-14 01:37:54 +00:00
### Things in `langchain.experimental`
2023-07-22 15:27:29 +00:00
Previously:
`from langchain.experimental import ...`
Now:
`from langchain_experimental import ...`
2023-11-14 01:37:54 +00:00
### PALChain
2023-07-21 20:32:39 +00:00
Previously:
`from langchain.chains import PALChain`
Now:
2023-07-22 01:44:32 +00:00
`from langchain_experimental.pal_chain import PALChain`
2023-07-21 20:32:39 +00:00
2023-11-14 01:37:54 +00:00
### SQLDatabaseChain
2023-07-21 20:32:39 +00:00
Previously:
`from langchain.chains import SQLDatabaseChain`
Now:
2023-07-22 01:44:32 +00:00
`from langchain_experimental.sql import SQLDatabaseChain`
2023-07-21 20:32:39 +00:00
2024-08-08 13:26:13 +00:00
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 )
2023-07-29 00:47:00 +00:00
`from langchain.chains import create_sql_query_chain`
2023-11-14 01:37:54 +00:00
### `load_prompt` for Python files
2023-07-21 20:32:39 +00:00
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:
2023-07-22 01:44:32 +00:00
`from langchain_experimental.prompts import load_prompt`