mirror of
https://github.com/james-m-jordan/openai-cookbook.git
synced 2025-05-09 19:32:38 +00:00
Merge pull request #390 from acatav/agent_with_langchain_pinecone_docs
[Pinecone]: Add link for creating Pinecone API key and environment variable to pinecone init
This commit is contained in:
commit
21d1834e5f
@ -54,7 +54,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# Setup\n",
|
"# Setup\n",
|
||||||
"\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",
|
"\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."
|
"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": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
"!pip install openai\n",
|
||||||
"!pip install pinecone-client\n",
|
"!pip install pinecone-client\n",
|
||||||
"!pip install pandas\n",
|
"!pip install pandas\n",
|
||||||
"!pip install typing\n",
|
"!pip install typing\n",
|
||||||
"!pip install tqdm\n",
|
"!pip install tqdm\n",
|
||||||
"!pip install langchain"
|
"!pip install langchain\n",
|
||||||
|
"!pip install wget"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -109,6 +111,15 @@
|
|||||||
"index_name = 'podcasts'"
|
"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",
|
"cell_type": "code",
|
||||||
"execution_count": 4,
|
"execution_count": 4,
|
||||||
@ -116,8 +127,13 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"api_key = os.getenv(\"PINECONE_API_KEY\")\n",
|
"api_key = os.getenv(\"PINECONE_API_KEY\") or \"PINECONE_API_KEY\"\n",
|
||||||
"pinecone.init(api_key=api_key)"
|
"\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()"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user