Embeddings Documentation for Node.js?

I saw another question was posted here but did not receive an answer so I am asking again…

Is there any solid documentation for using Embeddings with Node.js?

I am trying to create embeddings of user messages and store them in pinecone and retrieve them based on the userId, effectively creating memory for each user.

Does anyone know of good documentation or tutorial for this specific thing I’m trying to achieve?

import OpenAI from “openai”;

const openai = new OpenAI({
apiKey: YOUR API KEY,
});

async function main() {
const embedding = await openai.embeddings.create({
model: “text-embedding-ada-002”,
input: “The quick brown fox jumped over the lazy dog”,
encoding_format: “float”,
});

console.log(embedding);
}

main();

1 Like