For this code
docsearch = Pinecone.from_texts([t.page_content for t in text_chunks], embedding, index_name="testforpractical")
I got below error
PineconeConfigurationError: You haven't specified an Api-Key.
and i tried another method:
from langchain_openai import OpenAIEmbeddings
from langchain.vectorstores import Pinecone
from pinecone import Pinecone as PineconeClient
import os
model_name = 'text-embedding-ada-002'
embedding = OpenAIEmbeddings(
model= "gpt-3.5-turbo",
openai_api_key="-------"
)
PINECONE_API_KEY = os.environ.get('PINECONE_API_KEY', '----')
PINECONE_API_ENV = os.environ.get('PINECONE_API_ENV', '-----')
Create a Pinecone instance with the API key and environment
pinecone_instance = PineconeClient(api_key=PINECONE_API_KEY, environment=PINECONE_API_ENV)
index_name = "testforpractical"
Create a PineconeVectorStore instance with the Pinecone instance and index name
docsearch = Pinecone.from_texts(
[t.page_content for t in text_chunks],
embedding,
index_name=index_name,
pinecone_index=pinecone_instance
)
and got another error as :
PineconeConfigurationError
PineconeConfigurationError: You haven't specified an Api-Key.
but i have specified all api key that of open ai and of pinecode both .
I was unable to solve this error since yesterday. So can anyone help me with this ?