From 4a70d3015f3accd9c32533b82deb18696d735806 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 10:20:19 -0700 Subject: [PATCH 01/16] chore(deps): bump certifi from 2023.11.17 to 2024.7.4 in /.kokoro (#88) Bumps [certifi](https://github.com/certifi/python-certifi) from 2023.11.17 to 2024.7.4. - [Commits](https://github.com/certifi/python-certifi/compare/2023.11.17...2024.07.04) --- updated-dependencies: - dependency-name: certifi dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .kokoro/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 7d69372..53bff9f 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -20,9 +20,9 @@ cachetools==4.2.4 \ --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 # via google-auth -certifi==2023.11.17 \ - --hash=sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1 \ - --hash=sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474 +certifi==2024.7.4 \ + --hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \ + --hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90 # via requests cffi==1.16.0 \ --hash=sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc \ From 59f438c663dc27bc2704a934f8b60949ff96fa3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 09:28:28 -0700 Subject: [PATCH 02/16] chore(deps): bump zipp from 3.18.1 to 3.19.1 in /.kokoro (#89) Bumps [zipp](https://github.com/jaraco/zipp) from 3.18.1 to 3.19.1. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.18.1...v3.19.1) --- updated-dependencies: - dependency-name: zipp dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .kokoro/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 53bff9f..caa74d3 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -516,9 +516,9 @@ wheel==0.43.0 \ --hash=sha256:465ef92c69fa5c5da2d1cf8ac40559a8c940886afcef87dcf14b9470862f1d85 \ --hash=sha256:55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81 # via -r requirements.in -zipp==3.18.1 \ - --hash=sha256:206f5a15f2af3dbaee80769fb7dc6f249695e940acca08dfb2a4769fe61e538b \ - --hash=sha256:2884ed22e7d8961de1c9a05142eb69a247f120291bc0206a00a7642f09b5b715 +zipp==3.19.1 \ + --hash=sha256:2828e64edb5386ea6a52e7ba7cdb17bb30a73a858f5eb6eb93d8d36f5ea26091 \ + --hash=sha256:35427f6d5594f4acf82d25541438348c26736fa9b3afa2754bcd63cdb99d8e8f # via importlib-metadata # WARNING: The following packages were not pinned, but pip requires them to be From 79b5c90dc74fcced5d8312ec88807190a0827e80 Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Fri, 19 Jul 2024 14:06:31 -0700 Subject: [PATCH 03/16] chore(ci): remove pull_request_target (#90) Similar to https://github.com/googleapis/langchain-google-alloydb-pg-python/pull/189 --- .github/workflows/lint.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2352d4b..cd8cab7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,12 +19,6 @@ on: - "*.md" - ".kokoro/**" - ".github/**" - pull_request_target: - types: [labeled] - paths-ignore: - - "*.md" - - ".kokoro/**" - - ".github/**" jobs: lint: @@ -34,33 +28,10 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - # run job on proper workflow event triggers (skip job for pull_request event from forks and only run pull_request_target for "tests: run" label) - if: "${{ (github.event.action != 'labeled' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) || github.event.label.name == 'tests: run' }}" steps: - - name: Remove PR label - if: "${{ github.event.action == 'labeled' && github.event.label.name == 'tests: run' }}" - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - try { - await github.rest.issues.removeLabel({ - name: 'tests: run', - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number - }); - } catch (e) { - console.log('Failed to remove label. Another job may have already removed it!'); - } - - name: Checkout Repository uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Python uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 From 1e5e00ccf38c4e4ada82d70c7f2faa755b2925f5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Jul 2024 23:12:59 +0200 Subject: [PATCH 04/16] chore(deps): update python-nonmajor (#92) --- pyproject.toml | 6 +++--- requirements.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8811816..40d02c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,9 +41,9 @@ Changelog = "https://github.com/googleapis/langchain-google-cloud-sql-mysql-pyth test = [ "black[jupyter]==24.4.2", "isort==5.13.2", - "mypy==1.10.0", - "pytest-asyncio==0.23.7", - "pytest==8.2.2", + "mypy==1.11.0", + "pytest-asyncio==0.23.8", + "pytest==8.3.2", "pytest-cov==5.0.0" ] diff --git a/requirements.txt b/requirements.txt index d7f23de..70626b5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -langchain==0.2.5 +langchain==0.2.11 langchain-community==0.2.5 numpy===1.24.4; python_version <= "3.8" numpy==1.26.4; python_version > "3.8" SQLAlchemy==2.0.31 -cloud-sql-python-connector[pymysql]==1.10.0 +cloud-sql-python-connector[pymysql]==1.11.0 From 3b89fc372f5808baae8f4ea650c2ff4687ea212f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 6 Aug 2024 21:18:21 +0200 Subject: [PATCH 05/16] chore(deps): update dependency test/mypy to v1.11.1 (#93) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 40d02c8..7b4d583 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ Changelog = "https://github.com/googleapis/langchain-google-cloud-sql-mysql-pyth test = [ "black[jupyter]==24.4.2", "isort==5.13.2", - "mypy==1.11.0", + "mypy==1.11.1", "pytest-asyncio==0.23.8", "pytest==8.3.2", "pytest-cov==5.0.0" From fbc3e5c9f65f49a9a9f6a505e5992c8c2a80fe61 Mon Sep 17 00:00:00 2001 From: Wenxin Du <117315983+duwenxin99@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:54:44 -0400 Subject: [PATCH 06/16] docs: Update README.rst (#94) change chat message history title size --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 9013f03..fa23109 100644 --- a/README.rst +++ b/README.rst @@ -112,7 +112,7 @@ See the full `Document Loader`_ tutorial. .. _`Document Loader`: https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/blob/main/docs/document_loader.ipynb Chat Message History Usage --------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~ Use ``ChatMessageHistory`` to store messages and provide conversation history to LLMs. From 68bd452be9589361fd1734286396f760a7ea4988 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:06:25 -0400 Subject: [PATCH 07/16] chore(deps): bump langchain-community from 0.2.5 to 0.2.9 (#91) Bumps [langchain-community](https://github.com/langchain-ai/langchain) from 0.2.5 to 0.2.9. - [Release notes](https://github.com/langchain-ai/langchain/releases) - [Commits](https://github.com/langchain-ai/langchain/compare/langchain-community==0.2.5...langchain-community==0.2.9) --- updated-dependencies: - dependency-name: langchain-community dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Averi Kitsch --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 70626b5..9f8ca58 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ langchain==0.2.11 -langchain-community==0.2.5 +langchain-community==0.2.9 numpy===1.24.4; python_version <= "3.8" numpy==1.26.4; python_version > "3.8" SQLAlchemy==2.0.31 From 16fd2267401ebac0e7d2d1ee945646eac0d24339 Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Thu, 26 Sep 2024 09:10:33 -0700 Subject: [PATCH 08/16] chore(ci): rotate Kokoro release keys (#98) --- .kokoro/release.sh | 2 +- .kokoro/release/common.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/release.sh b/.kokoro/release.sh index c1628a3..d69cc0d 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -23,7 +23,7 @@ python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source / export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-2") cd github/langchain-google-cloud-sql-mysql-python python3 -m build --wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 4f3d373..591d4e0 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -28,7 +28,7 @@ before_action { fetch_keystore { keystore_resource { keystore_config_id: 73713 - keyname: "google-cloud-pypi-token-keystore-1" + keyname: "google-cloud-pypi-token-keystore-2" } } } From ba02bf528830dafb599afae43bd1bf3b2ac7c493 Mon Sep 17 00:00:00 2001 From: Jack Wotherspoon Date: Thu, 26 Sep 2024 12:16:24 -0400 Subject: [PATCH 09/16] feat: remove support for Python 3.8 (#97) * feat: remove support for Python 3.8 * chore: Update sync-repo-settings.yaml --------- Co-authored-by: Averi Kitsch --- .github/sync-repo-settings.yaml | 1 - DEVELOPER.md | 8 ++++---- README.rst | 2 +- integration.cloudbuild.yaml | 11 +++++++++-- pyproject.toml | 5 ++--- requirements.txt | 3 +-- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index e2c1a6e..b827043 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -27,7 +27,6 @@ branchProtectionRules: requiredStatusCheckContexts: - "cla/google" - "lint" - - "mysql-integration-test-pr-py38 (langchain-cloud-sql-testing)" - "mysql-integration-test-pr-py39 (langchain-cloud-sql-testing)" - "mysql-integration-test-pr-py310 (langchain-cloud-sql-testing)" - "mysql-integration-test-pr-py311 (langchain-cloud-sql-testing)" diff --git a/DEVELOPER.md b/DEVELOPER.md index f8b9caa..d255836 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -34,11 +34,11 @@ These tests are registered as required tests in `.github/sync-repo-settings.yaml #### Trigger Setup -Cloud Build triggers (for Python versions 3.8 to 3.11) were created with the following specs: +Cloud Build triggers (for Python versions 3.9 to 3.11) were created with the following specs: ```YAML -name: mysql-integration-test-pr-py38 -description: Run integration tests on PR for Python 3.8 +name: mysql-integration-test-pr-py39 +description: Run integration tests on PR for Python 3.9 filename: integration.cloudbuild.yaml github: name: langchain-google-cloud-sql-mysql-python @@ -55,7 +55,7 @@ substitutions: _INSTANCE_ID: _DB_NAME: _REGION: us-central1 - _VERSION: "3.8" + _VERSION: "3.9" ``` Use `gcloud builds triggers import --source=trigger.yaml` to create triggers via the command line diff --git a/README.rst b/README.rst index fa23109..d40d297 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,7 @@ With `virtualenv`_, it’s possible to install this library without needing syst Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.8 +Python >= 3.9 Mac/Linux ^^^^^^^^^ diff --git a/integration.cloudbuild.yaml b/integration.cloudbuild.yaml index cd6e9d2..3024a3b 100644 --- a/integration.cloudbuild.yaml +++ b/integration.cloudbuild.yaml @@ -26,7 +26,14 @@ steps: - id: Run integration tests name: python:${_VERSION} entrypoint: python - args: ["-m", "pytest", "--cov=langchain_google_cloud_sql_mysql", "--cov-config=.coveragerc", "tests/"] + args: + [ + "-m", + "pytest", + "--cov=langchain_google_cloud_sql_mysql", + "--cov-config=.coveragerc", + "tests/", + ] env: - "PROJECT_ID=$PROJECT_ID" - "INSTANCE_ID=$_INSTANCE_ID" @@ -46,7 +53,7 @@ substitutions: _INSTANCE_ID: test-instance _REGION: us-central1 _DB_NAME: test - _VERSION: "3.8" + _VERSION: "3.9" options: dynamicSubstitutions: true diff --git a/pyproject.toml b/pyproject.toml index 7b4d583..2921fbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] description = "LangChain integrations for Google Cloud SQL for MySQL" readme = "README.rst" license = {file = "LICENSE"} -requires-python = ">=3.8" +requires-python = ">=3.9" authors = [ {name = "Google LLC", email = "googleapis-packages@google.com"} ] @@ -21,7 +21,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -55,7 +54,7 @@ build-backend = "setuptools.build_meta" profile = "black" [tool.mypy] -python_version = "3.8" +python_version = "3.9" warn_unused_configs = true exclude = [ diff --git a/requirements.txt b/requirements.txt index 9f8ca58..43ae327 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ langchain==0.2.11 langchain-community==0.2.9 -numpy===1.24.4; python_version <= "3.8" -numpy==1.26.4; python_version > "3.8" +numpy==1.26.4 SQLAlchemy==2.0.31 cloud-sql-python-connector[pymysql]==1.11.0 From 1da3e1dad10957845bafb017347b448ca9abcdc1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 26 Sep 2024 18:22:45 +0200 Subject: [PATCH 10/16] chore(deps): update python-nonmajor (#96) --- pyproject.toml | 8 ++++---- requirements.txt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2921fbe..5e95916 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,11 +38,11 @@ Changelog = "https://github.com/googleapis/langchain-google-cloud-sql-mysql-pyth [project.optional-dependencies] test = [ - "black[jupyter]==24.4.2", + "black[jupyter]==24.8.0", "isort==5.13.2", - "mypy==1.11.1", - "pytest-asyncio==0.23.8", - "pytest==8.3.2", + "mypy==1.11.2", + "pytest-asyncio==0.24.0", + "pytest==8.3.3", "pytest-cov==5.0.0" ] diff --git a/requirements.txt b/requirements.txt index 43ae327..875a478 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -langchain==0.2.11 -langchain-community==0.2.9 +langchain==0.3.1 +langchain-community==0.3.1 numpy==1.26.4 -SQLAlchemy==2.0.31 -cloud-sql-python-connector[pymysql]==1.11.0 +SQLAlchemy==2.0.35 +cloud-sql-python-connector[pymysql]==1.12.1 From 84ae054ee49d4e0bb71faa8904d2bf1b0e20ec24 Mon Sep 17 00:00:00 2001 From: dishaprakash <57954147+dishaprakash@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:28:07 +0000 Subject: [PATCH 11/16] chore(ci): update kokoro secret (#102) --- .kokoro/release.sh | 2 +- .kokoro/release/common.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/release.sh b/.kokoro/release.sh index d69cc0d..e24441a 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -23,7 +23,7 @@ python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source / export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-2") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-3") cd github/langchain-google-cloud-sql-mysql-python python3 -m build --wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 591d4e0..c557815 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -28,7 +28,7 @@ before_action { fetch_keystore { keystore_resource { keystore_config_id: 73713 - keyname: "google-cloud-pypi-token-keystore-2" + keyname: "google-cloud-pypi-token-keystore-3" } } } From 6c4e591bcd9c7bd24918d12940850f2490a93e85 Mon Sep 17 00:00:00 2001 From: Jack Wotherspoon Date: Thu, 19 Dec 2024 11:48:49 -0500 Subject: [PATCH 12/16] ci: make builds green (#105) * chore: update test coverage value * chore: update docs GitHub Action --- .coveragerc | 2 +- .github/workflows/docs.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.coveragerc b/.coveragerc index 1f19666..b3d3d91 100644 --- a/.coveragerc +++ b/.coveragerc @@ -5,4 +5,4 @@ omit = [report] show_missing = true -fail_under = 89 \ No newline at end of file +fail_under = 85 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ada322c..2833fe9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel @@ -35,4 +35,4 @@ jobs: python -m pip install nox - name: Run docfx run: | - nox -s docfx \ No newline at end of file + nox -s docfx From 3ac0aabe6b242b6131f1fe0eb3c368ffbcc04a97 Mon Sep 17 00:00:00 2001 From: Julia Offerman <59590610+juliaofferman@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:09:19 -0800 Subject: [PATCH 13/16] docs: update README to reflect supported maintenance version (#104) --- README.rst | 5 +++ docs/vector_store.ipynb | 66 +++++++++++++++-------------- samples/langchain_quick_start.ipynb | 4 +- 3 files changed, 41 insertions(+), 34 deletions(-) diff --git a/README.rst b/README.rst index d40d297..b46d280 100644 --- a/README.rst +++ b/README.rst @@ -31,6 +31,11 @@ steps: .. _Enable the Google Cloud SQL Admin API.: https://console.cloud.google.com/flows/enableapi?apiid=sqladmin.googleapis.com .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html +Supported Cloud SQL Maintenance Versions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This LangChain integration is only supported for Cloud SQL maintenance versions between **MYSQL_8_0_36.R20240401.03_00** and **MYSQL_8_0_36.R20241208.01_00** + Installation ~~~~~~~~~~~~ diff --git a/docs/vector_store.ipynb b/docs/vector_store.ipynb index 58fa822..a6aff77 100644 --- a/docs/vector_store.ipynb +++ b/docs/vector_store.ipynb @@ -29,7 +29,9 @@ "\n", " * [Create a Google Cloud Project](https://developers.google.com/workspace/guides/create-project)\n", " * [Enable the Cloud SQL Admin API.](https://console.cloud.google.com/flows/enableapi?apiid=sqladmin.googleapis.com)\n", - " * [Create a Cloud SQL instance.](https://cloud.google.com/sql/docs/mysql/connect-instance-auth-proxy#create-instance) (version must be >= **8.0.36** with **cloudsql_vector** database flag configured to \"On\")\n", + " * [Create a Cloud SQL instance.](https://cloud.google.com/sql/docs/mysql/connect-instance-auth-proxy#create-instance) \n", + " * Database version must be >= **8.0.36** with **cloudsql_vector** database flag configured to \"On\"\n", + " * Cloud SQL maintenance version must be between **MYSQL_8_0_36.R20240401.03_00** and **MYSQL_8_0_36.R20241208.01_00**\n", " * [Create a Cloud SQL database.](https://cloud.google.com/sql/docs/mysql/create-manage-databases)\n", " * [Add a User to the database.](https://cloud.google.com/sql/docs/mysql/create-manage-users)" ] @@ -379,16 +381,16 @@ "cell_type": "code", "execution_count": 17, "metadata": { - "id": "fpqeZgUeLL54", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "fpqeZgUeLL54", "outputId": "f674a3af-452c-4d58-bb62-cbf514a9e1e3" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Pineapple\n" ] @@ -415,16 +417,16 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "N-NC5jgGLL55", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "N-NC5jgGLL55", "outputId": "69a1f9de-a830-450d-8a5e-118b36815a46" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "[Document(page_content='Pineapple', metadata={'len': 9}), Document(page_content='Banana', metadata={'len': 6})]\n" ] @@ -490,12 +492,12 @@ }, { "cell_type": "markdown", - "source": [ - "## Advanced Usage" - ], "metadata": { "id": "K8XAZZTDqwIp" - } + }, + "source": [ + "## Advanced Usage" + ] }, { "cell_type": "markdown", @@ -560,16 +562,16 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "Sqfgk6EOLL5-", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "Sqfgk6EOLL5-", "outputId": "a10c74e2-fe48-4cf9-ba2f-85aecb2490d0" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "[Document(page_content='Pineapple', metadata={'len': 9}), Document(page_content='Banana', metadata={'len': 6}), Document(page_content='Apples and oranges', metadata={'len': 18}), Document(page_content='Cars and airplanes', metadata={'len': 18})]\n" ] @@ -593,6 +595,7 @@ }, { "cell_type": "markdown", + "metadata": {}, "source": [ "## Example Workflow\n", "\n", @@ -601,11 +604,13 @@ "Load the document, split it into chunks, embed each chunk and load it into the vector store.\n", "\n", "You can download the `state_of_the_union.txt` file [here](https://github.com/langchain-ai/langchain/blob/master/docs/docs/modules/state_of_the_union.txt).\n" - ], - "metadata": {} + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "from langchain_community.document_loaders import TextLoader\n", "from langchain_google_vertexai import VertexAIEmbeddings\n", @@ -623,13 +628,13 @@ "embeddings = VertexAIEmbeddings(\n", " model_name=\"textembedding-gecko@003\", project=PROJECT_ID\n", ")" - ], - "metadata": {}, - "execution_count": null, - "outputs": [] + ] }, { "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "import uuid\n", "\n", @@ -653,30 +658,22 @@ "\n", "ids = [str(uuid.uuid4()) for _ in documents]\n", "db = MySQLVectorStore.from_documents(documents, embeddings, engine, table_name, ids)" - ], - "metadata": {}, - "execution_count": null, - "outputs": [] + ] }, { "cell_type": "code", - "source": [ - "query = \"What did the president say about Ketanji Brown Jackson\"\n", - "docs = db.similarity_search(query)\n", - "print(docs[0].page_content)" - ], + "execution_count": null, "metadata": { - "id": "EUp4DpizYy2N", - "outputId": "18d0c336-6fea-4bba-9ba4-6fcc60fb5194", "colab": { "base_uri": "https://localhost:8080/" - } + }, + "id": "EUp4DpizYy2N", + "outputId": "18d0c336-6fea-4bba-9ba4-6fcc60fb5194" }, - "execution_count": null, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. \n", "\n", @@ -687,6 +684,11 @@ "And I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation’s top legal minds, who will continue Justice Breyer’s legacy of excellence.\n" ] } + ], + "source": [ + "query = \"What did the president say about Ketanji Brown Jackson\"\n", + "docs = db.similarity_search(query)\n", + "print(docs[0].page_content)" ] } ], @@ -714,4 +716,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/samples/langchain_quick_start.ipynb b/samples/langchain_quick_start.ipynb index 96daea5..441b060 100644 --- a/samples/langchain_quick_start.ipynb +++ b/samples/langchain_quick_start.ipynb @@ -271,9 +271,9 @@ "\n", "A database named `langchain_db` will be created and used for the rest of the quickstart.\n", "\n", - "**Note:** MySQL vector support is only available on MySQL instances with version **>= 8.0.36**.\n", + "**Note:** MySQL vector support is only available on MySQL instances with version **>= 8.0.36**. This LangChain integration is only supported for maintenance versions between **MYSQL_8_0_36.R20240401.03_00** and **MYSQL_8_0_36.R20241208.01_00**\n", "\n", - "> For existing instances, you may need to perform a [self-service maintenance update](https://cloud.google.com/sql/docs/mysql/self-service-maintenance) to update your maintenance version to **MYSQL_8_0_36.R20240401.03_00** or greater. Once updated, [configure your database flags](https://cloud.google.com/sql/docs/mysql/flags) to have thew new **cloudsql_vector** flag to \"On\".\n", + "> On the instance, [configure your database flags](https://cloud.google.com/sql/docs/mysql/flags) to have thew new **cloudsql_vector** flag to \"On\".\n", "\n", "> ⏳ - Creating a Cloud SQL instance may take a few minutes." ] From 7db170196365b136073fec4f95b45193fa84da93 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 3 Jan 2025 17:45:15 +0100 Subject: [PATCH 14/16] chore(deps): update python-nonmajor (#99) Co-authored-by: Jack Wotherspoon --- pyproject.toml | 4 ++-- requirements.txt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5e95916..4e1d48c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,9 +38,9 @@ Changelog = "https://github.com/googleapis/langchain-google-cloud-sql-mysql-pyth [project.optional-dependencies] test = [ - "black[jupyter]==24.8.0", + "black[jupyter]==24.10.0", "isort==5.13.2", - "mypy==1.11.2", + "mypy==1.13.0", "pytest-asyncio==0.24.0", "pytest==8.3.3", "pytest-cov==5.0.0" diff --git a/requirements.txt b/requirements.txt index 875a478..d29d620 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -langchain==0.3.1 -langchain-community==0.3.1 +langchain==0.3.4 +langchain-community==0.3.3 numpy==1.26.4 -SQLAlchemy==2.0.35 -cloud-sql-python-connector[pymysql]==1.12.1 +SQLAlchemy==2.0.36 +cloud-sql-python-connector[pymysql]==1.13.0 From f9f9f657e64868365c9294360b31f0977b8292c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 12:13:26 -0500 Subject: [PATCH 15/16] chore(deps): bump jinja2 from 3.1.4 to 3.1.5 in /.kokoro (#106) --- .kokoro/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index caa74d3..4b06960 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -276,9 +276,9 @@ jeepney==0.8.0 \ # via # keyring # secretstorage -jinja2==3.1.4 \ - --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ - --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d +jinja2==3.1.5 \ + --hash=sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb \ + --hash=sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb # via gcp-releasetool keyring==23.13.1 \ --hash=sha256:771ed2a91909389ed6148631de678f82ddc73737d85a927f382a8a1b157898cd \ From b7531d40de4d1aed1f80c546b870cc5a61b3beb8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:34:24 -0800 Subject: [PATCH 16/16] chore(main): release 0.3.0 (#95) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ src/langchain_google_cloud_sql_mysql/version.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dff5020..d9d7007 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.3.0](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/compare/v0.2.3...v0.3.0) (2025-01-06) + + +### Features + +* Remove support for Python 3.8 ([#97](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/issues/97)) ([ba02bf5](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/commit/ba02bf528830dafb599afae43bd1bf3b2ac7c493)) + + +### Documentation + +* Update README to reflect supported maintenance version ([#104](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/issues/104)) ([3ac0aab](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/commit/3ac0aabe6b242b6131f1fe0eb3c368ffbcc04a97)) + ## [0.2.3](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/compare/v0.2.2...v0.2.3) (2024-07-03) diff --git a/src/langchain_google_cloud_sql_mysql/version.py b/src/langchain_google_cloud_sql_mysql/version.py index f6bd330..2b5d97a 100644 --- a/src/langchain_google_cloud_sql_mysql/version.py +++ b/src/langchain_google_cloud_sql_mysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.2.3" +__version__ = "0.3.0"