I am trying to use pinecone for the first time for studying the application, I have installed the pinecone-client (3.0.0) and tried to run the following query. However, I am getting an error given below. Please guide me if possible.
docsearch = Pinecone.from_texts([t.page_content for t in text_chunks], embedding, index_name=index_name)
Error - type object ‘Pinecone’ has no attribute ‘from_texts’
Hi @girishsawant9999! Without seeing the rest of your code, it’s hard to know exactly what’s happening, but I suspect you’re not calling the query operation the right way. Do the examples on this docs page help? You might also want to run through the Quickstart, if you haven’t already.
Thank you for the response. Here is the full code. (I am running this each line in Jupyter Notebook). Let me also have a look at the URLs shared by you.
from langchain.document_loaders import PyPDFDirectoryLoader
(skipping the VertexAI Authentication piece)
embedding = VertexAIEmbeddings(model_name=‘textembedding-gecko@003’)
abc = len(embedding.embed_query(“How are you”))
print(abc)
embedding.embed_query(“How are you”)
from langchain.vectorstores import Chroma, Pinecone
from langchain.embeddings.vertexai import VertexAIEmbeddings
import pinecone
pinecone( api_key=PINECONE_API_KEY, # find at app.pinecone.io
environment=PINECONE_API_ENV # next to api key in console
)
index_name = “testing”
index = pinecone.Index(‘testing’)
docsearch = Pinecone.from_texts([t.page_content for t in text_chunks], embedding, index_name=index_name)