I am getting this pinecone error... could anybody please help me to figure out where it is coming from?

Error I get:

⨯ PineconeArgumentError: The argument to upsert had type errors: item at index unknown of the ‘unknown’ array must be string, item at index unknown of the ‘unknown’ array must be string, item at index unknown of the ‘unknown’ array must be string, and 179 other errors.

This is how the code for inserting information looks like:

let insertBatches = ;
while (vector.length) {
let batch = vector.splice(0, 250);

let index = pinecone.index("test1");
let indexResults = await index.upsert(batch);
insertBatches.push(indexResults);

}

And this is how one of the vectors looks like:

{
id: 99,
metadata: { information: ‘company’ },
values: [
-0.0026398662, -0.019662911, 0.0041843797, -0.025086243, -0.010926808,
0.021092214, -0.047020007, -0.037428994, 0.018928224, -0.030162266,
0.016457003, 0.0048856726, 0.026849493, -0.012750169, -0.004491613,
-0.020597968, 0.0045517236, 0.03302087, 0.026515543, -0.0022491459,
-0.024685504, 0.012262604, -0.006939458, 0.013959064, -0.027624253,
-0.012229209, 0.008622561, -0.019662911, -0.008575808, -0.006565436,
-0.0019369037, -0.0017482225, -0.032539982, -0.031658355, -0.0015587065,
0.0035665743, -0.00294042, 0.0035532163, 0.0171249, -0.009924961,
0.020865127, 0.012603232, 0.009016621, 0.002359349, -0.002007033,
0.002574746, 0.00464189, 0.025633918, 0.0015737342, 0.012442936,
0.00568715, 0.019756418, -0.010445922, 0.002594783, -0.0022691828,
-0.010739797, -0.0029070254, 0.025673993, -0.014894121, -0.004104232,
-0.019502617, -0.031711787, -0.029334072, 0.003282718, -0.007968021,
0.0024394968, -0.023429856, -0.0066121886, -0.01522807, -0.017405417,
0.029307356, 0.027276948, 0.01235611, -0.0028285473, 0.025139675,
-0.002007033, 0.0028853186, 0.014493383, 0.021412805, 0.022387935,
0.026462112, -0.017205048, -0.036039766, 0.013905632, 0.0050760233,
0.018260326, -0.0030940366, 0.010866698, -0.020250661, 0.0072333333,
0.018888151, 0.010766513, -0.026916282, 0.033101015, -0.0074804556,
-0.0047420748, -0.023322992, 0.03157821, -0.02150631, -0.022147492,
… 1436 more items
]
},

Strange error message with all of the ‘unknown’ comments, but I’m pretty sure Pinecone requires the id field to be a string, not a number, so that could be the problem.

2 Likes

Thanks… that did it :slight_smile:

1 Like

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