Getting the following error while upserting-
[PineconeError: PineconeClient: Error calling upsert: PineconeError: PineconeClient: Error calling upsertRaw: RequiredError: Required parameter requestParameters.upsertRequest was null or undefined when calling upsert.]
Here is the code -
import { PineconeClient } from "@pinecone-database/pinecone";
const pinecone = new PineconeClient();
await pinecone.init({
environment: "<env>",
apiKey: "<api_key>",
});
const pineconeIndex = pinecone.Index("<index_name>");
let vectors = data.map( async (item,i) => {
let openai_embedding = await createEmbedding(item.subtitle_text);
//console.log(item.subtitle_embedding.length)
return {
id: item.video_id,
metadata:{
subtitle: item.subtitle_text
},
values: openai_embedding
}
});
vectors = await Promise.all(vectors);
//console.log(vectors)
let insertBatches = [];
while(vectors.length) {
let batchedVectors = vectors.splice(0, 250);
//console.log(batchedVectors)
let pineconeResult = await pineconeIndex.upsert({
namespace: "example-namespace",
vectors: batchedVectors
});
insertBatches.push(pineconeResult);
}
I have checked already-
- API key and environment is correct.
- Tried with creating new account.
- checked the openai vectors dimensions is same as pinecone index dimensions.
There is lots of similar posts are available but none of them solved my query.
Thanks a lot.