Skip to content

Commit f58b30f

Browse files
authored
docs: add docloader codelab (#15)
* docs: document_loader.ipynb * feat: update doc * docs: fix error * docs: fix lint * docs: update readme * docs: update readme * docs: refine doc * docs: sync with mysql loader doc * docs: fix lint * docs: minor refine
1 parent a546889 commit f58b30f

File tree

3 files changed

+510
-39
lines changed

3 files changed

+510
-39
lines changed

README.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,25 @@ source <your-env>/bin/activate
3333
<your-env>/bin/pip install langchain-google-cloud-sql-mssql
3434
```
3535

36-
## Usage
36+
## Document Loader Usage
37+
38+
39+
Use a [document loader](https://python.langchain.com/docs/modules/data_connection/document_loaders/) to load data as LangChain `Document`s.
3740

3841
```python
39-
from langchain_google_cloud_sql_mssql import CloudSQLVectorstore, CloudSQLLoader, CloudSQLChatMessageHistory
42+
from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLLoader
43+
44+
45+
engine = MSSQLEngine.from_instance("project-id", "region", "my-instance", "my-database", "db_user", "db_pass")
46+
loader = MSSQLLoader(
47+
engine,
48+
table_name="my-table-name"
49+
)
50+
docs = loader.lazy_load()
4051
```
4152

53+
See the full [Document Loader][loader] tutorial.
54+
4255
## Contributing
4356

4457
Contributions to this library are always welcome and highly encouraged.
@@ -61,4 +74,5 @@ This is not an officially supported Google product.
6174
[billing]: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
6275
[api]: https://console.cloud.google.com/flows/enableapi?apiid=sqladmin.googleapis.com
6376
[auth]: https://googleapis.dev/python/google-api-core/latest/auth.html
64-
[venv]: https://virtualenv.pypa.io/en/latest/
77+
[venv]: https://virtualenv.pypa.io/en/latest/
78+
[loader]: ./docs/document_loader.ipynb

0 commit comments

Comments
 (0)