This commit is contained in:
Harrison Chase
2023-07-27 22:00:52 -07:00
parent a221a9ced0
commit 1b0bfa54cf
3 changed files with 7 additions and 268 deletions

View File

@@ -5,7 +5,9 @@ To set it up, follow the instructions on https://database.guide/2-sample-databas
```python
from langchain import OpenAI, SQLDatabase, SQLDatabaseChain
from langchain.llms import OpenAI
from langchain.utilities import SQLDatabase
from langchain_experimental.sql import SQLDatabaseChain
```
@@ -484,7 +486,7 @@ This is useful in cases where the number of tables in the database is large.
```python
from langchain.chains import SQLDatabaseSequentialChain
from langchain_experimental.sql import SQLDatabaseSequentialChain
db = SQLDatabase.from_uri("sqlite:///../../../../notebooks/Chinook.db")
```
@@ -567,7 +569,8 @@ local_llm = HuggingFacePipeline(pipeline=pipe)
```python
from langchain import SQLDatabase, SQLDatabaseChain
from langchain.utilities import SQLDatabase
from langchain_experimental.sql import SQLDatabaseChain
db = SQLDatabase.from_uri("sqlite:///../../../../notebooks/Chinook.db", include_tables=['Customer'])
local_chain = SQLDatabaseChain.from_llm(local_llm, db, verbose=True, return_intermediate_steps=True, use_query_checker=True)