Title: ValueError with langchain_community.vectorstores Pinecone Integration
Hi everyone,
I’m getting this error when trying to initialize a Pinecone vector store using the community package:
ValueError: client should be an instance of pinecone.Index, got <class 'pinecone.data.index.Index'>
Here’s my current code:
from langchain_community.vectorstores import Pinecone as LangChainPinecone
dense_retriever = LangChainPinecone.from_existing_index(
index_name="sage",
embedding=embeddings,
namespace=namespace
).as_retriever(search_kwargs={"k": top_k})
I notice there are different ways to initialize Pinecone with LangChain. Could someone help clarify:
- What’s causing this specific error?
- Is there a difference between using
langchain_community.vectorstores
vslangchain_pinecone
?
Thanks in advance!