|
45 | 45 | },
|
46 | 46 | {
|
47 | 47 | "cell_type": "code",
|
48 |
| - "execution_count": 52, |
| 48 | + "execution_count": 1, |
49 | 49 | "metadata": {
|
50 | 50 | "colab": {
|
51 | 51 | "base_uri": "https://localhost:8080/"
|
|
65 | 65 | ],
|
66 | 66 | "source": [
|
67 | 67 | "!pip install -qU datasets transformers sentence-transformers \\\n",
|
68 |
| - " pinecone-client==3.1.0 pinecone-text" |
| 68 | + " pinecone-client==3.1.0 pinecone-text \\\n", |
| 69 | + " pinecone-notebooks" |
69 | 70 | ]
|
70 | 71 | },
|
71 | 72 | {
|
|
83 | 84 | "id": "AwPHT3yIdn5y"
|
84 | 85 | },
|
85 | 86 | "source": [
|
86 |
| - "Let's initiate a connection and create an index. For this, we need a [free API key](https://app.pinecone.io/), and then we initialize the connection like so:" |
| 87 | + "Let's initiate a connection and create an index. For this, we need to create or login to a Pinecone account and create an API key:" |
| 88 | + ] |
| 89 | + }, |
| 90 | + { |
| 91 | + "cell_type": "code", |
| 92 | + "execution_count": null, |
| 93 | + "metadata": {}, |
| 94 | + "outputs": [], |
| 95 | + "source": [ |
| 96 | + "from pinecone_notebooks.colab import Authenticate\n", |
| 97 | + "\n", |
| 98 | + "Authenticate()" |
| 99 | + ] |
| 100 | + }, |
| 101 | + { |
| 102 | + "cell_type": "markdown", |
| 103 | + "metadata": {}, |
| 104 | + "source": [ |
| 105 | + "The API key has been saved to the `PINECONE_API_KEY` environment variable and is ready for us to use to initialize a collection like so:" |
87 | 106 | ]
|
88 | 107 | },
|
89 | 108 | {
|
|
97 | 116 | "import os\n",
|
98 | 117 | "from pinecone import Pinecone\n",
|
99 | 118 | "\n",
|
100 |
| - "# initialize connection to pinecone (get API key at app.pinecone.io)\n", |
101 |
| - "api_key = os.environ.get('PINECONE_API_KEY') or 'PINECONE_API_KEY'\n", |
| 119 | + "# initialize connection to pinecone\n", |
| 120 | + "api_key = os.environ.get('PINECONE_API_KEY') \n", |
102 | 121 | "\n",
|
103 | 122 | "# configure client\n",
|
104 | 123 | "pc = Pinecone(api_key=api_key)"
|
|
2541 | 2560 | "name": "python",
|
2542 | 2561 | "nbconvert_exporter": "python",
|
2543 | 2562 | "pygments_lexer": "ipython3",
|
2544 |
| - "version": "3.9.12" |
| 2563 | + "version": "3.11.6" |
2545 | 2564 | },
|
2546 | 2565 | "vscode": {
|
2547 | 2566 | "interpreter": {
|
|
0 commit comments