I am getting undefined metadata and ID from a vector that I want to upload to the database… how can I fix it?
I am new at this and fist time using Pinecone, and I am not sure if I am doing the right approach.
I want to create an Q&A bot from OpenAI, and I am using Pinecone as a database.
First I have a json file that looks like this:
[
{
“id:”: 1,
“question:”: "What are your hours of operations? ",
“answer:”: "We open at 10am and close at 8pm. "
},
{
“id:”: 2,
“question:”: “Do you offer vegetarian food?”,
“answer:”: “Yes, we have a vegetarian menu to choose from”
}
]
^^^ Now I am splitting maybe 20-30 questions into chunks <— Is that OK?
Once I get the chuncks I am trying to create vectors to then upsert it into Pinecone… but the vector is not looking as expected… and getting some of the metadata as undefined…
Could somebody be so awesome on a feedback on how to properly prepare this vector before uploading it into the Pinecone database?
code I have is:
let vector = embeddingResult.data.map((item, i) => {
return {
id: item.id,
metadata: {
question: item.question,
answer: item.answer,
},
values: embeddings[i],
};
});
console.log(vector);
and when I do console.log from the vector… I get undefined metadata and ID…
id: undefined,
metadata: { question: undefined, answer: undefined },
values: [
-0.014396188, 0.0010330598, -0.005212655, 0.016514925,
0.0033166655, 0.031767026, -0.043076314, -0.017469058,