TypeError: Pinecone.init() got an unexpected keyword argument 'api_key'

here is my code:

from langchain.vectorstores import Pinecone

Your existing code

def chunk_data(docs, chunk_size=800, chunk_overlap=50):
text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
docs = text_splitter.split_documents(docs)
return docs

documents = chunk_data(docs=doc)

embeddings = OpenAIEmbeddings(openai_api_key=os.getenv(“OPENAI_API_KEY”))

configure client

pc = Pinecone(api_key=api_key)

index_name = “auction-data”
index = pc.Index(index_name)

Upsert documents to Pinecone index

docsearch = Pinecone.from_documents(documents, embeddings, index_name=index_name)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.