Skip to content

Commit af66f7c

Browse files
authored
docs: update colabs (#30)
* docs: update colabs * add links
1 parent a0cf20d commit af66f7c

File tree

4 files changed

+33
-20
lines changed

4 files changed

+33
-20
lines changed

docs/chat_message_history.ipynb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
"collapsed": false
77
},
88
"source": [
9-
"# Cloud Spanner\n",
10-
"> [Cloud Spanner](https://cloud.google.com/spanner) is a highly scalable database that combines unlimited scalability with relational semantics, such as secondary indexes, strong consistency, schemas, and SQL providing 99.999% availability in one easy solution.\n",
9+
"# Google Spanner\n",
10+
"> [Spanner](https://cloud.google.com/spanner) is a highly scalable database that combines unlimited scalability with relational semantics, such as secondary indexes, strong consistency, schemas, and SQL providing 99.999% availability in one easy solution.\n",
1111
"\n",
12-
"This notebook goes over how to use `Spanner` to store chat message history with the `SpannerChatMessageHistory` class."
12+
"This notebook goes over how to use `Spanner` to store chat message history with the `SpannerChatMessageHistory` class.\n",
13+
"\n",
14+
"Learn more about the package on [GitHub](https://github.com/googleapis/langchain-google-spanner-python/).\n",
15+
"\n",
16+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/googleapis/langchain-google-spanner-python/blob/main/samples/chat_message_history.ipynb)"
1317
]
1418
},
1519
{
@@ -146,7 +150,7 @@
146150
},
147151
"outputs": [],
148152
"source": [
149-
"# enable Cloud SQL Admin API\n",
153+
"# enable Spanner API\n",
150154
"!gcloud services enable spanner.googleapis.com"
151155
]
152156
},
@@ -167,8 +171,8 @@
167171
"id": "OMvzMWRrR6n7"
168172
},
169173
"source": [
170-
"### Set Cloud SQL database values\n",
171-
"Find your database values, in the [Cloud SQL Instances page](https://console.cloud.google.com/sql?_ga=2.223735448.2062268965.1707700487-2088871159.1707257687)."
174+
"### Set Spanner database values\n",
175+
"Find your database values, in the [Spanner Instances page](https://console.cloud.google.com/spanner)."
172176
]
173177
},
174178
{

docs/document_loader.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Spanner\n",
7+
"# Google Spanner\n",
88
"\n",
9-
"> [Spanner](https://cloud.google.com/spanner) is a highly scalable database that combines unlimited scalability with relational semantics, such as secondary indexes, strong consistency, schemas, and SQL providing 99.999% availability in one easy solution. Extend your database application to build AI-powered experiences leveraging Cloud SQL's Langchain integrations.\n",
9+
"> [Spanner](https://cloud.google.com/spanner) is a highly scalable database that combines unlimited scalability with relational semantics, such as secondary indexes, strong consistency, schemas, and SQL providing 99.999% availability in one easy solution.\n",
1010
"\n",
1111
"This notebook goes over how to use [Spanner](https://cloud.google.com/spanner) to [save, load and delete langchain documents](https://python.langchain.com/docs/modules/data_connection/document_loaders/) with `SpannerLoader` and `SpannerDocumentSaver`.\n",
1212
"\n",
13+
"Learn more about the package on [GitHub](https://github.com/googleapis/langchain-google-spanner-python/).\n",
14+
"\n",
1315
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/googleapis/langchain-google-spanner-python/blob/main/docs/document_loader.ipynb)"
1416
]
1517
},

docs/vector_store.ipynb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Cloud Spanner\n",
8-
"> [Cloud Spanner](https://cloud.google.com/spanner) is a highly scalable database that combines unlimited scalability with relational semantics, such as secondary indexes, strong consistency, schemas, and SQL providing 99.999% availability in one easy solution.\n",
7+
"# Google Spanner\n",
8+
"> [Spanner](https://cloud.google.com/spanner) is a highly scalable database that combines unlimited scalability with relational semantics, such as secondary indexes, strong consistency, schemas, and SQL providing 99.999% availability in one easy solution.\n",
99
"\n",
10-
"This notebook goes over how to use `Spanner` for Vector Search with `SpannerVectorStore` class."
10+
"This notebook goes over how to use `Spanner` for Vector Search with `SpannerVectorStore` class.\n",
11+
"\n",
12+
"Learn more about the package on [GitHub](https://github.com/googleapis/langchain-google-spanner-python/).\n",
13+
"\n",
14+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/googleapis/langchain-google-spanner-python/blob/main/docs/vector_store.ipynb)"
1115
]
1216
},
1317
{
@@ -135,7 +139,7 @@
135139
"metadata": {},
136140
"outputs": [],
137141
"source": [
138-
"# enable Cloud SQL Admin API\n",
142+
"# enable Spanner API\n",
139143
"!gcloud services enable spanner.googleapis.com"
140144
]
141145
},
@@ -150,8 +154,8 @@
150154
"cell_type": "markdown",
151155
"metadata": {},
152156
"source": [
153-
"### Set Cloud Spanner database values\n",
154-
"Find your database values, in the [Cloud Spanner Instances page](https://console.cloud.google.com/spanner?_ga=2.223735448.2062268965.1707700487-2088871159.1707257687)."
157+
"### Set Spanner database values\n",
158+
"Find your database values, in the [Spanner Instances page](https://console.cloud.google.com/spanner?_ga=2.223735448.2062268965.1707700487-2088871159.1707257687)."
155159
]
156160
},
157161
{

samples/langchain_quick_start.ipynb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"outputs": [],
108108
"source": [
109109
"%pip install langchain-google-spanner\n",
110-
"\n",
110+
"# Install additional dependencies\n",
111111
"%pip install langchain langchain-google-vertexai"
112112
]
113113
},
@@ -127,9 +127,7 @@
127127
"metadata": {},
128128
"outputs": [],
129129
"source": [
130-
"from google.colab import auth\n",
131-
"\n",
132-
"auth.authenticate_user()"
130+
"!gcloud auth login"
133131
]
134132
},
135133
{
@@ -367,7 +365,7 @@
367365
"database = instance.database(database_id)\n",
368366
"table_name = \"netflix_titles\"\n",
369367
"\n",
370-
"database.update_ddl(\n",
368+
"operation = database.update_ddl(\n",
371369
" [\n",
372370
" \"\"\"CREATE TABLE IF NOT EXISTS {} (\n",
373371
" show_id STRING(MAX) NOT NULL,\n",
@@ -386,7 +384,12 @@
386384
" table_name\n",
387385
" )\n",
388386
" ]\n",
389-
")"
387+
")\n",
388+
"\n",
389+
"print(\"Waiting for operation to complete...\")\n",
390+
"operation.result(240)\n",
391+
"\n",
392+
"print(\"Table created.\")"
390393
]
391394
},
392395
{

0 commit comments

Comments
 (0)