[Documentation] Show how to initiate pinecone from an existing index (#3070)

## What is this PR for:
* This PR adds a commented line of code in the documentation that shows
how someone can use the Pinecone client with an already existing
Pinecone index
* The documentation currently only shows how to create a pinecone index
from langchain documents but not how to load one that already exists
This commit is contained in:
Hamza Kyamanywa 2023-04-18 23:27:46 +09:00 committed by GitHub
parent 894c272a56
commit 064a1db2b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,9 @@
"\n", "\n",
"docsearch = Pinecone.from_documents(docs, embeddings, index_name=index_name)\n", "docsearch = Pinecone.from_documents(docs, embeddings, index_name=index_name)\n",
"\n", "\n",
"# if you already have an index, you can load it like this\n",
"# docsearch = Pinecone.from_existing_index(index_name, embeddings)\n",
"\n",
"query = \"What did the president say about Ketanji Brown Jackson\"\n", "query = \"What did the president say about Ketanji Brown Jackson\"\n",
"docs = docsearch.similarity_search(query)" "docs = docsearch.similarity_search(query)"
] ]