Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit b38125a

Browse files
chore: add additional details and update link in notebooks (#62)
1 parent ad32137 commit b38125a

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

docs/vector_store.ipynb

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
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)\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",
3333
" * [Create a Cloud SQL database.](https://cloud.google.com/sql/docs/mysql/create-manage-databases)\n",
3434
" * [Add a User to the database.](https://cloud.google.com/sql/docs/mysql/create-manage-users)"
3535
]
@@ -154,7 +154,11 @@
154154
},
155155
"source": [
156156
"### Set Cloud SQL database values\n",
157-
"Find your database values, in the [Cloud SQL Instances page](https://console.cloud.google.com/sql?_ga=2.223735448.2062268965.1707700487-2088871159.1707257687)."
157+
"Find your database values, in the [Cloud SQL Instances page](https://console.cloud.google.com/sql?_ga=2.223735448.2062268965.1707700487-2088871159.1707257687).\n",
158+
"\n",
159+
"**Note:** MySQL vector support is only available on MySQL instances with version **>= 8.0.36**.\n",
160+
"\n",
161+
"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 the new **cloudsql_vector** flag to \"On\"."
158162
]
159163
},
160164
{
@@ -237,7 +241,7 @@
237241
"source": [
238242
"engine.init_vectorstore_table(\n",
239243
" table_name=TABLE_NAME,\n",
240-
" vector_size=768, # Vector size for VertexAI model(textembedding-gecko@latest),\n",
244+
" vector_size=768, # Vector size for VertexAI model(textembedding-gecko@latest)\n",
241245
")"
242246
]
243247
},
@@ -439,7 +443,16 @@
439443
},
440444
"source": [
441445
"### Add an index\n",
442-
"Speed up vector search queries by applying a vector index. Learn more about [MySQL vector indexes](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/blob/main/src/langchain_google_cloud_sql_mysql/indexes.py)."
446+
"Speed up vector search queries by applying a vector index. Learn more about [MySQL vector indexes](https://github.com/googleapis/langchain-google-cloud-sql-mysql-python/blob/main/src/langchain_google_cloud_sql_mysql/indexes.py).\n",
447+
"\n",
448+
"**Note:** For IAM database authentication (default usage), the IAM database user will need to be granted the following permissions by a privileged database user for full control of vector indexes.\n",
449+
"\n",
450+
"```\n",
451+
"GRANT EXECUTE ON PROCEDURE mysql.create_vector_index TO '<IAM_DB_USER>'@'%';\n",
452+
"GRANT EXECUTE ON PROCEDURE mysql.alter_vector_index TO '<IAM_DB_USER>'@'%';\n",
453+
"GRANT EXECUTE ON PROCEDURE mysql.drop_vector_index TO '<IAM_DB_USER>'@'%';\n",
454+
"GRANT SELECT ON mysql.vector_indexes TO '<IAM_DB_USER>'@'%';\n",
455+
"```"
443456
]
444457
},
445458
{

samples/langchain_quick_start.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
"\n",
274274
"**Note:** MySQL vector support is only available on MySQL instances with version **>= 8.0.36**.\n",
275275
"\n",
276-
"> For existing instances, you may need to perform a [self-service maintenance update](MYSQL_8_0_36.R20240401.03_00) 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+
"> 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",
277277
"\n",
278278
"> ⏳ - Creating a Cloud SQL instance may take a few minutes."
279279
]
@@ -287,7 +287,7 @@
287287
},
288288
"outputs": [],
289289
"source": [
290-
"#@markdown Please fill in the both the Google Cloud region and name of your Cloud SQL instance. Once filled in, run the cell.\n",
290+
"#@markdown Please fill in both the Google Cloud region and name of your Cloud SQL instance. Once filled in, run the cell.\n",
291291
"\n",
292292
"# Please fill in these values.\n",
293293
"REGION = \"us-central1\" #@param {type:\"string\"}\n",

0 commit comments

Comments
 (0)