Skip to content

Commit 7265960

Browse files
authored
Merge pull request #363 from pinecone-io/james/pinecone-connect-all-docs
feat: add pinecone-connect to docs
2 parents 7c0b4a7 + 33c9f32 commit 7265960

10 files changed

+369
-257
lines changed

docs/gen-qa-openai.ipynb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
" openai==0.27.7 \\\n",
6666
" pinecone-client==3.1.0 \\\n",
6767
" pinecone-datasets==0.7.0 \\\n",
68-
" tqdm"
68+
" tqdm \\\n",
69+
" pinecone-notebooks==0.1.1"
6970
]
7071
},
7172
{
@@ -438,6 +439,19 @@
438439
"We begin by initializing our connection to Pinecone. To do this we need a [free API key](https://app.pinecone.io)."
439440
]
440441
},
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+
},
441455
{
442456
"cell_type": "code",
443457
"execution_count": 4,
@@ -446,11 +460,9 @@
446460
},
447461
"outputs": [],
448462
"source": [
449-
"import os\n",
450463
"from pinecone import Pinecone\n",
451464
"\n",
452-
"# initialize connection to pinecone (get API key at app.pinecone.io)\n",
453-
"api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n",
465+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
454466
"\n",
455467
"# configure client\n",
456468
"pc = Pinecone(api_key=api_key)"

docs/gpt-4-langchain-docs.ipynb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"!pip install -qU \\\n",
6363
" openai==0.27.7 \\\n",
6464
" pinecone-client==3.1.0 \\\n",
65-
" pinecone-datasets==0.7.0"
65+
" pinecone-datasets==0.7.0 \\\n",
66+
" pinecone-notebooks==0.1.1"
6667
]
6768
},
6869
{
@@ -333,10 +334,21 @@
333334
"outputs": [],
334335
"source": [
335336
"import os\n",
337+
"\n",
338+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
339+
" from pinecone_notebooks.colab import Authenticate\n",
340+
" Authenticate()"
341+
]
342+
},
343+
{
344+
"cell_type": "code",
345+
"execution_count": null,
346+
"metadata": {},
347+
"outputs": [],
348+
"source": [
336349
"from pinecone import Pinecone\n",
337350
"\n",
338-
"# initialize connection to pinecone (get API key at app.pinecone.io)\n",
339-
"api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n",
351+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
340352
"\n",
341353
"# configure client\n",
342354
"pc = Pinecone(api_key=api_key)"

docs/it-threat-detection.ipynb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
"source": [
8585
"!pip install -qU \\\n",
8686
" pinecone-client==3.1.0 \\\n",
87-
" pinecone-datasets==0.7.0"
87+
" pinecone-datasets==0.7.0 \\\n",
88+
" pinecone-notebooks==0.1.1"
8889
]
8990
},
9091
{
@@ -103,10 +104,21 @@
103104
"outputs": [],
104105
"source": [
105106
"import os\n",
107+
"\n",
108+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
109+
" from pinecone_notebooks.colab import Authenticate\n",
110+
" Authenticate()"
111+
]
112+
},
113+
{
114+
"cell_type": "code",
115+
"execution_count": null,
116+
"metadata": {},
117+
"outputs": [],
118+
"source": [
106119
"from pinecone import Pinecone\n",
107120
"\n",
108-
"# initialize connection to pinecone (get API key at app.pinecone.io)\n",
109-
"api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n",
121+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
110122
"\n",
111123
"# configure client\n",
112124
"pc = Pinecone(api_key=api_key)"

docs/langchain-retrieval-agent.ipynb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
" pinecone-datasets==0.7.0 \\\n",
5353
" langchain==0.1.1 \\\n",
5454
" langchain-community==0.0.13 \\\n",
55-
" tiktoken==0.4.0"
55+
" tiktoken==0.4.0 \\\n",
56+
" pinecone-notebooks==0.1.1"
5657
]
5758
},
5859
{
@@ -515,10 +516,21 @@
515516
"outputs": [],
516517
"source": [
517518
"import os\n",
519+
"\n",
520+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
521+
" from pinecone_notebooks.colab import Authenticate\n",
522+
" Authenticate()"
523+
]
524+
},
525+
{
526+
"cell_type": "code",
527+
"execution_count": null,
528+
"metadata": {},
529+
"outputs": [],
530+
"source": [
518531
"from pinecone import Pinecone\n",
519532
"\n",
520-
"# initialize connection to pinecone (get API key at app.pinecone.io)\n",
521-
"api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n",
533+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
522534
"\n",
523535
"# configure client\n",
524536
"pc = Pinecone(api_key=api_key)"

docs/langchain-retrieval-augmentation.ipynb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
" openai==0.27.7 \\\n",
4747
" tiktoken==0.4.0 \\\n",
4848
" pinecone-client==3.1.0 \\\n",
49-
" pinecone-datasets==0.7.0"
49+
" pinecone-datasets==0.7.0 \\\n",
50+
" pinecone-notebooks==0.1.1"
5051
]
5152
},
5253
{
@@ -165,10 +166,21 @@
165166
"outputs": [],
166167
"source": [
167168
"import os\n",
169+
"\n",
170+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
171+
" from pinecone_notebooks.colab import Authenticate\n",
172+
" Authenticate()"
173+
]
174+
},
175+
{
176+
"cell_type": "code",
177+
"execution_count": null,
178+
"metadata": {},
179+
"outputs": [],
180+
"source": [
168181
"from pinecone import Pinecone\n",
169182
"\n",
170-
"# initialize connection to pinecone (get API key at app.pinecone.io)\n",
171-
"api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n",
183+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
172184
"\n",
173185
"# configure client\n",
174186
"pc = Pinecone(api_key=api_key)"

docs/onboarding-recommender.ipynb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@
117117
" pinecone-client==3.1.0 \\\n",
118118
" pinecone-datasets==0.7.0 \\\n",
119119
" transformers==4.30.2 \\\n",
120-
" tensorflow==2.11.1"
120+
" tensorflow==2.11.1 \\\n",
121+
" pinecone-notebooks==0.1.1"
121122
]
122123
},
123124
{
@@ -803,10 +804,21 @@
803804
"outputs": [],
804805
"source": [
805806
"import os\n",
807+
"\n",
808+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
809+
" from pinecone_notebooks.colab import Authenticate\n",
810+
" Authenticate()"
811+
]
812+
},
813+
{
814+
"cell_type": "code",
815+
"execution_count": null,
816+
"metadata": {},
817+
"outputs": [],
818+
"source": [
806819
"from pinecone import Pinecone\n",
807820
"\n",
808-
"# initialize connection to pinecone (get API key at app.pinecone.io)\n",
809-
"api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n",
821+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
810822
"\n",
811823
"# configure client\n",
812824
"pc = Pinecone(api_key=api_key)"

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: 239 additions & 226 deletions
Large diffs are not rendered by default.

docs/read-units-demonstrated.ipynb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
}
5151
],
5252
"source": [
53-
"!pip install \"pinecone-client[grpc]==3.1.0\""
53+
"!pip install -qU \\\n",
54+
" \"pinecone-client[grpc]==3.1.0\" \\\n",
55+
" pinecone-notebooks==0.1.1"
5456
]
5557
},
5658
{
@@ -87,6 +89,20 @@
8789
"## Connect to Pinecone and create an index"
8890
]
8991
},
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+
},
90106
{
91107
"cell_type": "code",
92108
"execution_count": 9,
@@ -99,11 +115,9 @@
99115
},
100116
"outputs": [],
101117
"source": [
102-
"import os\n",
103118
"from pinecone.grpc import PineconeGRPC\n",
104119
"\n",
105-
"# initialize connection to pinecone (get API key at app.pinecone.io)\n",
106-
"api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n",
120+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
107121
"\n",
108122
"# configure GRPC client\n",
109123
"pc = PineconeGRPC(api_key=api_key)"

docs/semantic-search.ipynb

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
"!pip install -qU \\\n",
6161
" pinecone-client==3.1.0 \\\n",
6262
" pinecone-datasets==0.7.0 \\\n",
63-
" sentence-transformers==2.2.2"
63+
" sentence-transformers==2.2.2 \\\n",
64+
" pinecone-notebooks==0.1.1"
6465
]
6566
},
6667
{
@@ -462,6 +463,20 @@
462463
"We begin by initializing our connection to Pinecone. To do this we need a [free API key](https://app.pinecone.io)."
463464
]
464465
},
466+
{
467+
"cell_type": "code",
468+
"execution_count": null,
469+
"metadata": {},
470+
"outputs": [],
471+
"source": [
472+
"import os\n",
473+
"\n",
474+
"# initialize connection to pinecone (orget API key at app.pinecone.io)\n",
475+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
476+
" from pinecone_notebooks.colab import Authenticate\n",
477+
" Authenticate()"
478+
]
479+
},
465480
{
466481
"cell_type": "code",
467482
"execution_count": 5,
@@ -470,11 +485,9 @@
470485
},
471486
"outputs": [],
472487
"source": [
473-
"import os\n",
474488
"from pinecone import Pinecone\n",
475489
"\n",
476-
"# initialize connection to pinecone (get API key at app.pinecone.io)\n",
477-
"api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n",
490+
"api_key = os.environ.get(\"PINECONE_API_KEY\")\n",
478491
"\n",
479492
"# configure client\n",
480493
"pc = Pinecone(api_key=api_key)"

0 commit comments

Comments
 (0)