mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
[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:
parent
894c272a56
commit
064a1db2b2
@ -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)"
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user