add links to pinecone and add env var to index

This commit is contained in:
Amnon Catav 2023-05-02 21:55:33 +03:00
parent ded5b0cb3e
commit d55f0c0823

View File

@ -54,7 +54,7 @@
"source": [
"# Setup\n",
"\n",
"Import libraries and set up a connection to a Pinecone vector database.\n",
"Import libraries and set up a connection to a [Pinecone](https://www.pinecone.io) vector database.\n",
"\n",
"You can substitute Pinecone for any other vectorstore or database - there are a [selection](https://python.langchain.com/en/latest/modules/indexes/vectorstores.html) that are supported by Langchain natively, while other connectors will need to be developed yourself."
]
@ -66,11 +66,13 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install openai\n",
"!pip install pinecone-client\n",
"!pip install pandas\n",
"!pip install typing\n",
"!pip install tqdm\n",
"!pip install langchain"
"!pip install langchain\n",
"!pip install wget"
]
},
{
@ -109,6 +111,15 @@
"index_name = 'podcasts'"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "9c85f298",
"metadata": {},
"source": [
"For acquiring an API key to connect with Pinecone, you can set up a [free account](https://app.pinecone.io/) and store it in the `api_key` variable below or in your environment variables under `PINECONE_API_KEY`"
]
},
{
"cell_type": "code",
"execution_count": 4,
@ -116,8 +127,13 @@
"metadata": {},
"outputs": [],
"source": [
"api_key = os.getenv(\"PINECONE_API_KEY\")\n",
"pinecone.init(api_key=api_key)"
"api_key = os.getenv(\"PINECONE_API_KEY\") or \"PINECONE_API_KEY\"\n",
"\n",
"# find environment next to your API key in the Pinecone console\n",
"env = os.getenv(\"PINECONE_ENVIRONMENT\") or \"PINECONE_ENVIRONMENT\"\n",
"\n",
"pinecone.init(api_key=api_key, environment=env)\n",
"pinecone.whoami()"
]
},
{