Skip to content

Commit 33c9f32

Browse files
committed
fix: order for auth blocks
1 parent 1f95d2e commit 33c9f32

10 files changed

+108
-43
lines changed

docs/gen-qa-openai.ipynb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,19 @@
439439
"We begin by initializing our connection to Pinecone. To do this we need a [free API key](https://app.pinecone.io)."
440440
]
441441
},
442+
{
443+
"cell_type": "code",
444+
"execution_count": null,
445+
"metadata": {},
446+
"outputs": [],
447+
"source": [
448+
"import os\n",
449+
"\n",
450+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
451+
" from pinecone_notebooks.colab import Authenticate\n",
452+
" Authenticate()"
453+
]
454+
},
442455
{
443456
"cell_type": "code",
444457
"execution_count": 4,
@@ -447,14 +460,8 @@
447460
},
448461
"outputs": [],
449462
"source": [
450-
"import os\n",
451463
"from pinecone import Pinecone\n",
452464
"\n",
453-
"# initialize connection to pinecone (or get API key at app.pinecone.io)\n",
454-
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
455-
" from pinecone_notebooks.colab import Authenticate\n",
456-
" Authenticate()\n",
457-
"\n",
458465
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
459466
"\n",
460467
"# configure client\n",

docs/gpt-4-langchain-docs.ipynb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,19 @@
334334
"outputs": [],
335335
"source": [
336336
"import os\n",
337-
"from pinecone import Pinecone\n",
338337
"\n",
339-
"# initialize connection to pinecone (or get API key at app.pinecone.io)\n",
340338
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
341339
" from pinecone_notebooks.colab import Authenticate\n",
342-
" Authenticate()\n",
340+
" Authenticate()"
341+
]
342+
},
343+
{
344+
"cell_type": "code",
345+
"execution_count": null,
346+
"metadata": {},
347+
"outputs": [],
348+
"source": [
349+
"from pinecone import Pinecone\n",
343350
"\n",
344351
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
345352
"\n",

docs/it-threat-detection.ipynb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,19 @@
104104
"outputs": [],
105105
"source": [
106106
"import os\n",
107-
"from pinecone import Pinecone\n",
108107
"\n",
109-
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
110108
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
111109
" from pinecone_notebooks.colab import Authenticate\n",
112-
" Authenticate()\n",
110+
" Authenticate()"
111+
]
112+
},
113+
{
114+
"cell_type": "code",
115+
"execution_count": null,
116+
"metadata": {},
117+
"outputs": [],
118+
"source": [
119+
"from pinecone import Pinecone\n",
113120
"\n",
114121
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
115122
"\n",

docs/langchain-retrieval-agent.ipynb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,19 @@
516516
"outputs": [],
517517
"source": [
518518
"import os\n",
519-
"from pinecone import Pinecone\n",
520519
"\n",
521-
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
522520
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
523521
" from pinecone_notebooks.colab import Authenticate\n",
524-
" Authenticate()\n",
522+
" Authenticate()"
523+
]
524+
},
525+
{
526+
"cell_type": "code",
527+
"execution_count": null,
528+
"metadata": {},
529+
"outputs": [],
530+
"source": [
531+
"from pinecone import Pinecone\n",
525532
"\n",
526533
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
527534
"\n",

docs/langchain-retrieval-augmentation.ipynb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,19 @@
166166
"outputs": [],
167167
"source": [
168168
"import os\n",
169-
"from pinecone import Pinecone\n",
170169
"\n",
171-
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
172170
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
173171
" from pinecone_notebooks.colab import Authenticate\n",
174-
" Authenticate()\n",
172+
" Authenticate()"
173+
]
174+
},
175+
{
176+
"cell_type": "code",
177+
"execution_count": null,
178+
"metadata": {},
179+
"outputs": [],
180+
"source": [
181+
"from pinecone import Pinecone\n",
175182
"\n",
176183
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
177184
"\n",

docs/onboarding-recommender.ipynb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,12 +804,19 @@
804804
"outputs": [],
805805
"source": [
806806
"import os\n",
807-
"from pinecone import Pinecone\n",
808807
"\n",
809-
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
810808
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
811809
" from pinecone_notebooks.colab import Authenticate\n",
812-
" Authenticate()\n",
810+
" Authenticate()"
811+
]
812+
},
813+
{
814+
"cell_type": "code",
815+
"execution_count": null,
816+
"metadata": {},
817+
"outputs": [],
818+
"source": [
819+
"from pinecone import Pinecone\n",
813820
"\n",
814821
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
815822
"\n",

docs/pinecone-quickstart.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"source": [
6363
"## Sign up or log in\n",
6464
"\n",
65-
"Sign up for a [free Pinecone account](https://www.pinecone.io/pricing/) and get an API key. Put your key in `PINECONE_API_KEY` below when initializing a new client instance:\n"
65+
"Sign up for a [free Pinecone account](https://www.pinecone.io/pricing/) and get an API key. Put your key in `PINECONE_API_KEY` below when initializing a new client instance:"
6666
]
6767
},
6868
{
@@ -82,9 +82,7 @@
8282
"\n",
8383
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
8484
" from pinecone_notebooks.colab import Authenticate\n",
85-
" Authenticate()\n",
86-
"\n",
87-
"api_key = os.environ.get(\"PINECONE_API_KEY\")"
85+
" Authenticate()"
8886
]
8987
},
9088
{
@@ -97,6 +95,8 @@
9795
"source": [
9896
"from pinecone import Pinecone\n",
9997
"\n",
98+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
99+
"\n",
100100
"pc = Pinecone(api_key=api_key)"
101101
]
102102
},

docs/rag-getting-started.ipynb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,26 @@
9595
},
9696
{
9797
"cell_type": "code",
98-
"execution_count": 1,
99-
"metadata": {
100-
"id": "3dkFBCjfk40i"
101-
},
98+
"execution_count": null,
99+
"metadata": {},
102100
"outputs": [],
103101
"source": [
104102
"import os\n",
105103
"\n",
106104
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
107105
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
108106
" from pinecone_notebooks.colab import Authenticate\n",
109-
" Authenticate()\n",
110-
"\n",
107+
" Authenticate()"
108+
]
109+
},
110+
{
111+
"cell_type": "code",
112+
"execution_count": 1,
113+
"metadata": {
114+
"id": "3dkFBCjfk40i"
115+
},
116+
"outputs": [],
117+
"source": [
111118
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
112119
"\n",
113120
"# available at platform.openai.com/api-keys\n",

docs/read-units-demonstrated.ipynb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,20 @@
8989
"## Connect to Pinecone and create an index"
9090
]
9191
},
92+
{
93+
"cell_type": "code",
94+
"execution_count": null,
95+
"metadata": {},
96+
"outputs": [],
97+
"source": [
98+
"import os\n",
99+
"\n",
100+
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
101+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
102+
" from pinecone_notebooks.colab import Authenticate\n",
103+
" Authenticate()"
104+
]
105+
},
92106
{
93107
"cell_type": "code",
94108
"execution_count": 9,
@@ -101,14 +115,8 @@
101115
},
102116
"outputs": [],
103117
"source": [
104-
"import os\n",
105118
"from pinecone.grpc import PineconeGRPC\n",
106119
"\n",
107-
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
108-
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
109-
" from pinecone_notebooks.colab import Authenticate\n",
110-
" Authenticate()\n",
111-
"\n",
112120
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
113121
"\n",
114122
"# configure GRPC client\n",

docs/semantic-search.ipynb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,19 +465,27 @@
465465
},
466466
{
467467
"cell_type": "code",
468-
"execution_count": 5,
469-
"metadata": {
470-
"id": "mc66NEBAcQHY"
471-
},
468+
"execution_count": null,
469+
"metadata": {},
472470
"outputs": [],
473471
"source": [
474472
"import os\n",
475-
"from pinecone import Pinecone\n",
476473
"\n",
477474
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
478475
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
479476
" from pinecone_notebooks.colab import Authenticate\n",
480-
" Authenticate()\n",
477+
" Authenticate()"
478+
]
479+
},
480+
{
481+
"cell_type": "code",
482+
"execution_count": 5,
483+
"metadata": {
484+
"id": "mc66NEBAcQHY"
485+
},
486+
"outputs": [],
487+
"source": [
488+
"from pinecone import Pinecone\n",
481489
"\n",
482490
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
483491
"\n",

0 commit comments

Comments
 (0)