Skip to content

Commit

Permalink
Merge pull request openai#390 from acatav/agent_with_langchain_pineco…
Browse files Browse the repository at this point in the history
…ne_docs

[Pinecone]: Add link for creating Pinecone API key and environment variable to pinecone init
  • Loading branch information
colin-openai authored May 3, 2023
2 parents abdb53c + 7164818 commit 21d1834
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions examples/How_to_build_a_tool-using_agent_with_Langchain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
Expand All @@ -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"
]
},
{
Expand Down Expand Up @@ -109,15 +111,29 @@
"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,
"id": "af825644",
"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()"
]
},
{
Expand Down

0 comments on commit 21d1834

Please sign in to comment.