Skip to content

Commit

Permalink
semantic-search-with-openai-qa db syntax, notes and tags updated
Browse files Browse the repository at this point in the history
  • Loading branch information
demenskyi committed Jan 26, 2024
1 parent 3b72b6a commit 0d8fee0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
2 changes: 1 addition & 1 deletion notebooks/semantic-search-with-openai-qa/meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ description="""\
Provide context to chatGPT using data stored in SingleStoreDB. \
"""
icon="crystal-ball"
tags=["openai", "vectordb"]
tags=["starter", "openai", "vectordb", "genai"]
destinations=["spaces"]
54 changes: 49 additions & 5 deletions notebooks/semantic-search-with-openai-qa/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
"</div>"
]
},
{
"cell_type": "markdown",
"id": "7002feac",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Note</b></p>\n",
" <p> This notebook can be run on a Free Starter Workspace. To create a Free Starter Workspace navigate to <tt>Start</tt> using the left nav. You can also use your existing Standard or Premium workspace with this Notebook. </p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "f801cd94-180c-4dea-b85c-67659aad0ea6",
Expand Down Expand Up @@ -230,6 +244,20 @@
"## 3. Set up the database"
]
},
{
"cell_type": "markdown",
"id": "117daa30",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you have a Free Starter Workspace deployed already, select the database from drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "ca811e5f-6dcd-471b-a4de-03eab42acf4f",
Expand All @@ -245,9 +273,10 @@
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS winter_wikipedia;\n",
"CREATE DATABASE winter_wikipedia;"
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS winter_wikipedia;\n",
" %sql CREATE DATABASE winter_wikipedia;"
]
},
{
Expand Down Expand Up @@ -488,15 +517,30 @@
"## Clean up"
]
},
{
"cell_type": "markdown",
"id": "1202b364",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you created a new database in your Standard or Premium Workspace, you can drop the database by running the cell below. Note: this will not drop your database for Free Starter Workspaces. To drop a Free Starter Workspace, terminate the Workspace using the UI. </p>\n",
" </div>\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "5f448b09-8855-4dc7-984e-7d5dfdb68fc5",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"DROP DATABASE IF EXISTS winter_wikipedia"
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS winter_wikipedia;"
]
},
{
Expand Down

0 comments on commit 0d8fee0

Please sign in to comment.