Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Dec 19, 2024
1 parent 7526de8 commit 604219b
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions libs/langchain-google-vertexai/src/tests/embeddings.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,27 @@ const testModelsLocations = [
["text-multilingual-embedding-002", "us-central1"],
["text-embedding-005", "europe-west9"],
["text-multilingual-embedding-002", "europe-west9"],
]
];

test.each(testModelsLocations)("VertexAIEmbeddings.embedDocuments %s %s", async (model, location) => {
const embeddings = new VertexAIEmbeddings({
model,
location,
});
const res = await embeddings.embedDocuments([
"Hello world",
"Bye bye",
"we need",
"at least",
"six documents",
"to test pagination",
]);
// console.log(res);
expect(res).toHaveLength(6);
res.forEach((r) => {
expect(typeof r[0]).toBe("number");
});
});
test.each(testModelsLocations)(
"VertexAIEmbeddings.embedDocuments %s %s",
async (model, location) => {
const embeddings = new VertexAIEmbeddings({
model,
location,
});
const res = await embeddings.embedDocuments([
"Hello world",
"Bye bye",
"we need",
"at least",
"six documents",
"to test pagination",
]);
// console.log(res);
expect(res).toHaveLength(6);
res.forEach((r) => {
expect(typeof r[0]).toBe("number");
});
}
);

0 comments on commit 604219b

Please sign in to comment.