Docs: Update AI guides to reference pooler connection string (#20846)

docs(ai): update guides to reference pooler connection string
This commit is contained in:
Greg Richardson authored and GitHub committed 2024-01-29 13:44:23 -07:00
1 parent d29771a630
commit d42536b23e
10 files changed
+105 -15

No files matched your search

+19 -1
View File
@@ -21,6 +21,16 @@
"We'll start by loading a dataset of celebrity faces. Then we'll create embeddings for the faces using python's `face_recognition` library and store them in PostgreSQL with `vecs`. Finally we'll query the database with a user defined face to see which celebrities they look most like."
]
},
{
"cell_type": "markdown",
"id": "69e93981",
"metadata": {},
"source": [
"## Setup GPU on Google Colab\n",
"\n",
"If you are running this in Google Colab, you must first ensure that the GPU is enabled. You can set this by navigating to **Runtime** > **Change runtime type**, then choose one of the available GPUs under **Hardware Accelerator**."
]
},
{
"cell_type": "markdown",
"id": "3cab93f5-10d0-47c5-9f4e-64921461e7e2",
@@ -189,7 +199,15 @@
"## Initialize the Vecs Collection\n",
"\n",
"The [`vecs`](https://supabase.github.io/vecs/api/) library wraps a pythonic interface around PostgreSQL and pgvector.\n",
"A collection in `vecs` maps 1:1 with a PostgreSQL table."
"A collection in `vecs` maps 1:1 with a PostgreSQL table.\n",
"\n",
"First you will need to establish a connection to your database. You can find the Postgres connection string in the [Database Settings](https://supabase.com/dashboard/project/_/settings/database) of your Supabase project.\n",
"\n",
"> **Note:** SQLAlchemy requires the connection string to start with `postgresql://` (instead of `postgres://`). Don't forget to rename this after copying the string from the dashboard.\n",
"\n",
"> **Note:** You must use the \"connection pooling\" string (domain ending in `*.pooler.supabase.com`) with Google Colab since Colab does not support IPv6.\n",
"\n",
"This will also work with any other Postgres provider that supports pgvector."
]
},
{
+8 -2
View File
@@ -69,7 +69,7 @@
"source": [
"# Set up OpenAI\n",
"\n",
"LlamaIndex uses OpenAI GPT-3 `text-davinci-003` model. Let's store that in an environment variable:"
"OpenAI requires an [API key](https://platform.openai.com/api-keys) to run their models. Let's store that in an environment variable:"
]
},
{
@@ -116,7 +116,13 @@
"source": [
"## Create an index in Supabase\n",
"\n",
"Let's store Paul Graham's essays in Supabase. You can find the Postgres connection string in the [Database Settings](https://supabase.com/dashboard/_/settings/database) of your Supabase project. This will work with all Postgres providers that support pgvector."
"Let's store Paul Graham's essays in Supabase. You can find the Postgres connection string in the [Database Settings](https://supabase.com/dashboard/project/_/settings/database) of your Supabase project.\n",
"\n",
"> **Note:** SQLAlchemy requires the connection string to start with `postgresql://` (instead of `postgres://`). Don't forget to rename this after copying the string from the dashboard.\n",
"\n",
"> **Note:** You must use the \"connection pooling\" string (domain ending in `*.pooler.supabase.com`) with Google Colab since Colab does not support IPv6.\n",
"\n",
"This will also work with any other Postgres provider that supports pgvector."
]
},
{
@@ -138,7 +138,15 @@
"## Initialize the Vecs Collection\n",
"\n",
"The [`vecs`](https://supabase.github.io/vecs/api/) library wraps a pythonic interface around PostgreSQL and pgvector.\n",
"A collection in `vecs` maps 1:1 with a PostgreSQL table."
"A collection in `vecs` maps 1:1 with a PostgreSQL table.\n",
"\n",
"First you will need to establish a connection to your database. You can find the Postgres connection string in the [Database Settings](https://supabase.com/dashboard/project/_/settings/database) of your Supabase project.\n",
"\n",
"> **Note:** SQLAlchemy requires the connection string to start with `postgresql://` (instead of `postgres://`). Don't forget to rename this after copying the string from the dashboard.\n",
"\n",
"> **Note:** You must use the \"connection pooling\" string (domain ending in `*.pooler.supabase.com`) with Google Colab since Colab does not support IPv6.\n",
"\n",
"This will also work with any other Postgres provider that supports pgvector."
]
},
{
+10 -3
View File
@@ -52,12 +52,19 @@
"id": "AeGQKpZegfCv"
},
"source": [
"##Usage\n",
"###Connecting\n",
"## Usage\n",
"\n",
"### Connecting\n",
"\n",
"Before you can interact with vecs, create the client to communicate with Postgres.\n",
"\n",
"Note: In Supabase go to [Database Settings](https://supabase.com/dashboard/project/_/settings/database) to get your Postgres connection string."
"In Supabase, you can find the Postgres connection string in the [Database Settings](https://supabase.com/dashboard/project/_/settings/database) of your Supabase project.\n",
"\n",
"> **Note:** SQLAlchemy requires the connection string to start with `postgresql://` (instead of `postgres://`). Don't forget to rename this after copying the string from the dashboard.\n",
"\n",
"> **Note:** You must use the \"connection pooling\" string (domain ending in `*.pooler.supabase.com`) with Google Colab since Colab does not support IPv6.\n",
"\n",
"This will also work with any other Postgres provider that supports pgvector."
]
},
{