Error:
PineconeArgumentError: The argument to query accepts multiple types. Either 1) had type errors: argument must be object. 2) had type errors: argument must be object.
The code is below…
First I run message coming from the user into the openai embedding
then I get the sample of the answer which is a vector, and put it in a variable.
then I create a pinecone query and put the variable of the answer from the the openai into the the pinecone query…
const embeddingResult2 = await openai.embeddings.create({
input: message,
model: “text-embedding-ada-002”,
});const vector2 = embeddingResult2.data[0].embedding;
console.log(vector2);let index2 = pinecone.index(“test1”);
const pineconeResult2 = await index2.query(“test1”, {
vector: vector2 ,
topK: 5,
includeValues: true,
});const matches = pineconeResult2.matches;
OH… and this is the sample of the vector… which is in an array apparently…
[
-0.012257241, 0.0067729033, 0.0015281879, -0.020096542, 0.0006335711,
0.0028960984, -0.017849488, -0.022610199, -0.032220483, -0.00851215,
0.019741077, 0.0032594993, -0.008334416, 0.007052198, -0.0057541113,
-0.0076552215, 0.012492103, -0.020299667, 0.028488088, -0.011578047,
0.004741667, -0.0016329235, 0.0074457503, -0.0012282631, 0.0064586964,
-0.0018201781, 0.008689882, -0.014459862, -0.00022633208, -0.025758615,
0.00632857, -0.013101473, -0.013685454, -0.0255301, -0.01792566,
-0.016148329, -0.0062873107, -0.010206962, 0.010549733, 0.010460867,
0.010130791, 0.0247303, 0.01710047, -0.0010568775, -0.04989224,
-0.0013687041, 0.025695138, -0.021239113, -0.014650291, 0.032118924,
0.014967672, 0.011635175, -0.014320215, -0.01763367, -0.0062619206,
-0.018979363, -0.015018453, 0.017113166, -0.00014986318, 0.010378348,
-0.005427209, -0.00066134194, 0.00065063033, 0.034531016, 0.01122258,
-0.0064555225, -0.020693218, 0.017278204, -0.021645362, 0.009635677,
-0.018090697, 0.0101054, 0.012968173, -0.018611202, 0.01188908,
-0.0017170294, -0.0051955213, -0.015754776, 0.0008331242, -0.0055858996,
0.0068490747, -0.037146233, -0.026228337, 0.025987128, 0.0072934073,
0.007521922, 0.010219657, 0.004056125, -0.015602433, -0.008055121,
0.008410587, 0.009559506, 0.015792862, 0.025898261, -0.0025866523,
0.03196658, 0.0046147145, 0.032779075, 0.0027167783, -0.016871955,
… 1436 more items
]