Hi, I’m trying to use the batch create embeddings API as per the documentation but above the code snippet it first says “use the batches.create_embeddings API…” and then in the JS snippet it uses “client.batches.createEmbeddings” - however when I try either createEmbeddings and create_embeddings I get an error: “TypeError: Cannot read properties of undefined (reading ‘createEmbeddings’)”
Here’s the entire relevant code snippet:
…
const genAI = new GoogleGenerativeAI(‘API_KEY_HIDDEN’);
let batchJob;
batchJob = await genAI.batches.createEmbeddings({
model: ‘gemini-embedding-001’,
// For a predefined a list of requests inlinedRequests
src: {inlinedRequests: inlinedRequests},
config: {displayName: ‘Inlined embeddings batch’},
});
console.log(Created batch job: ${batchJob.name});
…