mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 14:31:55 +00:00
cr
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user