Skip to content

Commit

Permalink
chore: Merge branch 'main' into CloudSQLEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Jan 24, 2024
2 parents 48c7552 + 0628097 commit 7b1e464
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 174 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
python-version: "3.11"

- name: Install requirements
run: pip install .[test]
run: pip install -e .[test]

- name: Run linters
run: |
Expand Down
3 changes: 1 addition & 2 deletions .repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
"name": "langchain-google-cloud-sql-mysql",
"name_pretty": "Cloud SQL for MySQL for LangChain - Python",
"issue_tracker": "https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/issues",
"client_documentation": "",
"release_level": "preview",
"language": "python",
"library_type": "OTHER",
"repo": "googleapis/langchain-google-cloud-sql-mysql-python",
"distribution_name": "langchain-google-cloud-sql-mysql",
"requires_billing": true,
"codeowner_team": "@googleapis/senseai-eco"
}
}
341 changes: 170 additions & 171 deletions docs/document_loader.ipynb
Original file line number Diff line number Diff line change
@@ -1,173 +1,172 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Google DATABASE\n",
"\n",
"[Google DATABASE](https://cloud.google.com/DATABASE).\n",
"\n",
"Load documents from `DATABASE`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pre-reqs"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%pip install PACKAGE_NAME"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from PACKAGE import LOADER"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Basic Usage"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Load from table"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"loader = LOADER()\n",
"\n",
"data = loader.load()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Load from query"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"loader = LOADER()\n",
"\n",
"data = loader.load()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Customize Document Page Content & Metadata"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"loader = LOADER(\n",
"\n",
")\n",
"\n",
"data = loader.load()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Customize Page Content Format"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Save Documents to table"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"saver = SAVER()\n",
"saver.add_documents(docs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Customize Connection & Authentication"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from google.cloud.DATABASE import Client\n",
"creds = \"\"\n",
"client = Client(creds=creds)\n",
"loader = LOADER(\n",
" client=client,\n",
")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Google DATABASE\n",
"\n",
"[Google DATABASE](https://cloud.google.com/DATABASE).\n",
"\n",
"Load documents from `DATABASE`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pre-reqs"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%pip install PACKAGE_NAME"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from PACKAGE import LOADER"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Basic Usage"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Load from table"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"loader = LOADER()\n",
"\n",
"data = loader.load()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Load from query"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"loader = LOADER()\n",
"\n",
"data = loader.load()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Customize Document Page Content & Metadata"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"loader = LOADER()\n",
"\n",
"data = loader.load()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Customize Page Content Format"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Save Documents to table"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"saver = SAVER()\n",
"saver.add_documents(docs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Customize Connection & Authentication"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from google.cloud.DATABASE import Client\n",
"\n",
"creds = \"\"\n",
"client = Client(creds=creds)\n",
"loader = LOADER(\n",
" client=client,\n",
")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changelog = "https://github.com/googleapis/langchain-google-cloud-sql-mysql-pyth
[project.optional-dependencies]
test = [
"black==23.12.0",
"black[jupyter]==23.12.0",
"isort==5.13.2",
"mypy==1.7.1",
"pytest-asyncio==0.23.0",
Expand Down

0 comments on commit 7b1e464

Please sign in to comment.