svpino/youtube-rag

UnauthorizedException issue when Pinecone.from_documents()

yanliu1111 opened this issue · 0 comments

Hi I found the pinecode connection has unauthorized issue, took some time and got solutions, hope it can help other learners.

  1. If you use free tier in Pinecone, the ENV set like this:
    PINECONE_API_ENV="us-central1-gcp"
  2. from langchain_pinecone import PineconeVectorStore caused UnauthorizedException issue, when I changed the following, it works well.
from langchain_pinecone import Pinecone

import os 
os.environ['PINECONE_API_KEY'] = "PINECONE_API_KEY"
index_name = "youtube-index"

pinecone = Pinecone.from_documents(         index_name = index_name, 
                                            documents = documents, 
                                            embedding = embeddings)

Thank you for this tutorial.