Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,24 @@ source <your-env>/bin/activate
<your-env>/bin/pip install langchain-google-cloud-sql-mysql
```

## Usage
## Document Loader Usage

Use a [document loader](https://python.langchain.com/docs/modules/data_connection/document_loaders/) to load data as LangChain `Document`s.

```python
from langchain_google_cloud_sql_mysql import CloudSQLVectorstore, CloudSQLLoader, CloudSQLChatMessageHistory
from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLLoader


engine = MySQLEngine.from_instance("project-id", "region", "my-instance", "my-database")
loader = MySQLLoader(
engine,
table_name="my-table-name"
)
docs = loader.lazy_load()
```

See the full [Document Loader][loader] tutorial.

## Contributing

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