Skip to content

Commit 6530e0b

Browse files
authored
Merge pull request #357 from pinecone-io/james/pinecone-connect-test2
fix: test diff authenticate method
2 parents eab12c5 + f3d0fb3 commit 6530e0b

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed

docs/pinecone-quickstart.ipynb

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
},
4141
"outputs": [
4242
{
43-
"output_type": "stream",
4443
"name": "stdout",
44+
"output_type": "stream",
4545
"text": [
4646
"\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/215.5 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m\u001b[90m━━━━━━━━━━━━━\u001b[0m \u001b[32m143.4/215.5 kB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m215.5/215.5 kB\u001b[0m \u001b[31m3.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
4747
"\u001b[?25h"
@@ -67,34 +67,37 @@
6767
},
6868
{
6969
"cell_type": "code",
70-
"source": [
71-
"import os\n",
72-
"from pinecone_notebooks.colab import Authenticate\n",
73-
"\n",
74-
"api_key = os.environ.get(\"PINECONE_API_KEY\") or Authenticate()"
75-
],
70+
"execution_count": 3,
7671
"metadata": {
77-
"id": "89S8G8oP61-t",
78-
"outputId": "998abdfd-c528-4500-ff45-8344b6818e0a",
7972
"colab": {
8073
"base_uri": "https://localhost:8080/",
8174
"height": 247
82-
}
75+
},
76+
"id": "89S8G8oP61-t",
77+
"outputId": "998abdfd-c528-4500-ff45-8344b6818e0a"
8378
},
84-
"execution_count": 3,
8579
"outputs": [
8680
{
87-
"output_type": "display_data",
8881
"data": {
89-
"text/plain": [
90-
"<IPython.core.display.HTML object>"
91-
],
9282
"text/html": [
9383
"<script type=\"text/javascript\" src=\"https://connect.pinecone.io/embed.js\"></script>"
84+
],
85+
"text/plain": [
86+
"<IPython.core.display.HTML object>"
9487
]
9588
},
96-
"metadata": {}
89+
"metadata": {},
90+
"output_type": "display_data"
9791
}
92+
],
93+
"source": [
94+
"import os\n",
95+
"\n",
96+
"if not os.environ.get(\"PINECONE_API_KEY\"):\n",
97+
" from pinecone_notebooks import Authenticate\n",
98+
" Authenticate()\n",
99+
"\n",
100+
"api_key = os.environ.get(\"PINECONE_API_KEY\")"
98101
]
99102
},
100103
{
@@ -112,28 +115,28 @@
112115
},
113116
{
114117
"cell_type": "markdown",
115-
"source": [
116-
"Now we setup our index specification, this allows us to define the cloud provider and region where we want to deploy our index."
117-
],
118118
"metadata": {
119119
"id": "qXBdv9IG06IU"
120-
}
120+
},
121+
"source": [
122+
"Now we setup our index specification, this allows us to define the cloud provider and region where we want to deploy our index."
123+
]
121124
},
122125
{
123126
"cell_type": "code",
127+
"execution_count": 5,
128+
"metadata": {
129+
"id": "XYWFv-gw08WG"
130+
},
131+
"outputs": [],
124132
"source": [
125133
"from pinecone import ServerlessSpec\n",
126134
"\n",
127135
"cloud = os.environ.get('PINECONE_CLOUD') or 'aws'\n",
128136
"region = os.environ.get('PINECONE_REGION') or 'us-east-1'\n",
129137
"\n",
130138
"spec = ServerlessSpec(cloud=cloud, region=region)"
131-
],
132-
"metadata": {
133-
"id": "XYWFv-gw08WG"
134-
},
135-
"execution_count": 5,
136-
"outputs": []
139+
]
137140
},
138141
{
139142
"cell_type": "markdown",
@@ -150,14 +153,14 @@
150153
},
151154
{
152155
"cell_type": "code",
153-
"source": [
154-
"index_name = \"docs-quickstart-notebook\""
155-
],
156+
"execution_count": 6,
156157
"metadata": {
157158
"id": "Buo2K1h8O_fN"
158159
},
159-
"execution_count": 6,
160-
"outputs": []
160+
"outputs": [],
161+
"source": [
162+
"index_name = \"docs-quickstart-notebook\""
163+
]
161164
},
162165
{
163166
"cell_type": "code",
@@ -208,8 +211,8 @@
208211
},
209212
"outputs": [
210213
{
211-
"output_type": "stream",
212214
"name": "stdout",
215+
"output_type": "stream",
213216
"text": [
214217
"{'upserted_count': 3}\n",
215218
"{'upserted_count': 3}\n"
@@ -275,8 +278,8 @@
275278
},
276279
"outputs": [
277280
{
278-
"output_type": "stream",
279281
"name": "stdout",
282+
"output_type": "stream",
280283
"text": [
281284
"{'dimension': 2,\n",
282285
" 'index_fullness': 0.0,\n",
@@ -312,8 +315,8 @@
312315
},
313316
"outputs": [
314317
{
315-
"output_type": "stream",
316318
"name": "stdout",
319+
"output_type": "stream",
317320
"text": [
318321
"{'matches': [], 'namespace': 'ns1', 'usage': {'read_units': 1}}\n",
319322
"{'matches': [], 'namespace': 'ns2', 'usage': {'read_units': 1}}\n"
@@ -405,4 +408,4 @@
405408
},
406409
"nbformat": 4,
407410
"nbformat_minor": 0
408-
}
411+
}

0 commit comments

Comments
 (0)