# Initialize Pinecone client
pc = Pinecone(
api_key=KEY
)
# Create or connect to an existing index
if NAME not in pc.list_indexes().names():
pc.create_index(
name=NAME ,
dimension=1536,
metric='cosine',
spec=ServerlessSpec(cloud='aws', region='us-east-1')
)
while not pc.describe_index(index_name).status['ready']:
time.sleep(1)
# Connect to the index
index = pinecone.Index(NAME , HOST)
This code here works I get no errors. The following line is where I get my error:
vectors = [(f'doc_{i}', embedding) for i, embedding in enumerate(document_embeddings)]
index.upsert(vectors)
Any idea what the 403 error might be related to?