Skip to content

Commit 3ac0aab

Browse files
docs: update README to reflect supported maintenance version (#104)
1 parent 6c4e591 commit 3ac0aab

File tree

3 files changed

+41
-34
lines changed

3 files changed

+41
-34
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ steps:
3131
.. _Enable the Google Cloud SQL Admin API.: https://console.cloud.google.com/flows/enableapi?apiid=sqladmin.googleapis.com
3232
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
3333

34+
Supported Cloud SQL Maintenance Versions
35+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36+
37+
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**
38+
3439
Installation
3540
~~~~~~~~~~~~
3641

docs/vector_store.ipynb

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"\n",
3030
" * [Create a Google Cloud Project](https://developers.google.com/workspace/guides/create-project)\n",
3131
" * [Enable the Cloud SQL Admin API.](https://console.cloud.google.com/flows/enableapi?apiid=sqladmin.googleapis.com)\n",
32-
" * [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",
32+
" * [Create a Cloud SQL instance.](https://cloud.google.com/sql/docs/mysql/connect-instance-auth-proxy#create-instance) \n",
33+
" * Database version must be >= **8.0.36** with **cloudsql_vector** database flag configured to \"On\"\n",
34+
" * Cloud SQL maintenance version must be between **MYSQL_8_0_36.R20240401.03_00** and **MYSQL_8_0_36.R20241208.01_00**\n",
3335
" * [Create a Cloud SQL database.](https://cloud.google.com/sql/docs/mysql/create-manage-databases)\n",
3436
" * [Add a User to the database.](https://cloud.google.com/sql/docs/mysql/create-manage-users)"
3537
]
@@ -379,16 +381,16 @@
379381
"cell_type": "code",
380382
"execution_count": 17,
381383
"metadata": {
382-
"id": "fpqeZgUeLL54",
383384
"colab": {
384385
"base_uri": "https://localhost:8080/"
385386
},
387+
"id": "fpqeZgUeLL54",
386388
"outputId": "f674a3af-452c-4d58-bb62-cbf514a9e1e3"
387389
},
388390
"outputs": [
389391
{
390-
"output_type": "stream",
391392
"name": "stdout",
393+
"output_type": "stream",
392394
"text": [
393395
"Pineapple\n"
394396
]
@@ -415,16 +417,16 @@
415417
"cell_type": "code",
416418
"execution_count": null,
417419
"metadata": {
418-
"id": "N-NC5jgGLL55",
419420
"colab": {
420421
"base_uri": "https://localhost:8080/"
421422
},
423+
"id": "N-NC5jgGLL55",
422424
"outputId": "69a1f9de-a830-450d-8a5e-118b36815a46"
423425
},
424426
"outputs": [
425427
{
426-
"output_type": "stream",
427428
"name": "stdout",
429+
"output_type": "stream",
428430
"text": [
429431
"[Document(page_content='Pineapple', metadata={'len': 9}), Document(page_content='Banana', metadata={'len': 6})]\n"
430432
]
@@ -490,12 +492,12 @@
490492
},
491493
{
492494
"cell_type": "markdown",
493-
"source": [
494-
"## Advanced Usage"
495-
],
496495
"metadata": {
497496
"id": "K8XAZZTDqwIp"
498-
}
497+
},
498+
"source": [
499+
"## Advanced Usage"
500+
]
499501
},
500502
{
501503
"cell_type": "markdown",
@@ -560,16 +562,16 @@
560562
"cell_type": "code",
561563
"execution_count": null,
562564
"metadata": {
563-
"id": "Sqfgk6EOLL5-",
564565
"colab": {
565566
"base_uri": "https://localhost:8080/"
566567
},
568+
"id": "Sqfgk6EOLL5-",
567569
"outputId": "a10c74e2-fe48-4cf9-ba2f-85aecb2490d0"
568570
},
569571
"outputs": [
570572
{
571-
"output_type": "stream",
572573
"name": "stdout",
574+
"output_type": "stream",
573575
"text": [
574576
"[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"
575577
]
@@ -593,6 +595,7 @@
593595
},
594596
{
595597
"cell_type": "markdown",
598+
"metadata": {},
596599
"source": [
597600
"## Example Workflow\n",
598601
"\n",
@@ -601,11 +604,13 @@
601604
"Load the document, split it into chunks, embed each chunk and load it into the vector store.\n",
602605
"\n",
603606
"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"
604-
],
605-
"metadata": {}
607+
]
606608
},
607609
{
608610
"cell_type": "code",
611+
"execution_count": null,
612+
"metadata": {},
613+
"outputs": [],
609614
"source": [
610615
"from langchain_community.document_loaders import TextLoader\n",
611616
"from langchain_google_vertexai import VertexAIEmbeddings\n",
@@ -623,13 +628,13 @@
623628
"embeddings = VertexAIEmbeddings(\n",
624629
" model_name=\"textembedding-gecko@003\", project=PROJECT_ID\n",
625630
")"
626-
],
627-
"metadata": {},
628-
"execution_count": null,
629-
"outputs": []
631+
]
630632
},
631633
{
632634
"cell_type": "code",
635+
"execution_count": null,
636+
"metadata": {},
637+
"outputs": [],
633638
"source": [
634639
"import uuid\n",
635640
"\n",
@@ -653,30 +658,22 @@
653658
"\n",
654659
"ids = [str(uuid.uuid4()) for _ in documents]\n",
655660
"db = MySQLVectorStore.from_documents(documents, embeddings, engine, table_name, ids)"
656-
],
657-
"metadata": {},
658-
"execution_count": null,
659-
"outputs": []
661+
]
660662
},
661663
{
662664
"cell_type": "code",
663-
"source": [
664-
"query = \"What did the president say about Ketanji Brown Jackson\"\n",
665-
"docs = db.similarity_search(query)\n",
666-
"print(docs[0].page_content)"
667-
],
665+
"execution_count": null,
668666
"metadata": {
669-
"id": "EUp4DpizYy2N",
670-
"outputId": "18d0c336-6fea-4bba-9ba4-6fcc60fb5194",
671667
"colab": {
672668
"base_uri": "https://localhost:8080/"
673-
}
669+
},
670+
"id": "EUp4DpizYy2N",
671+
"outputId": "18d0c336-6fea-4bba-9ba4-6fcc60fb5194"
674672
},
675-
"execution_count": null,
676673
"outputs": [
677674
{
678-
"output_type": "stream",
679675
"name": "stdout",
676+
"output_type": "stream",
680677
"text": [
681678
"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",
682679
"\n",
@@ -687,6 +684,11 @@
687684
"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"
688685
]
689686
}
687+
],
688+
"source": [
689+
"query = \"What did the president say about Ketanji Brown Jackson\"\n",
690+
"docs = db.similarity_search(query)\n",
691+
"print(docs[0].page_content)"
690692
]
691693
}
692694
],
@@ -714,4 +716,4 @@
714716
},
715717
"nbformat": 4,
716718
"nbformat_minor": 0
717-
}
719+
}

samples/langchain_quick_start.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@
271271
"\n",
272272
"A database named `langchain_db` will be created and used for the rest of the quickstart.\n",
273273
"\n",
274-
"**Note:** MySQL vector support is only available on MySQL instances with version **>= 8.0.36**.\n",
274+
"**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",
275275
"\n",
276-
"> 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",
276+
"> 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",
277277
"\n",
278278
"> ⏳ - Creating a Cloud SQL instance may take a few minutes."
279279
]

0 commit comments

Comments
 (0)