From 7526de8941da4ddabda456076e9d1aad9b5e5a47 Mon Sep 17 00:00:00 2001 From: afirstenberg Date: Wed, 18 Dec 2024 20:49:31 -0500 Subject: [PATCH] Test different embedding models over different regions. --- .../src/tests/embeddings.int.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/langchain-google-vertexai/src/tests/embeddings.int.test.ts b/libs/langchain-google-vertexai/src/tests/embeddings.int.test.ts index 5bf57a82b24b..d24ec35c943d 100644 --- a/libs/langchain-google-vertexai/src/tests/embeddings.int.test.ts +++ b/libs/langchain-google-vertexai/src/tests/embeddings.int.test.ts @@ -9,9 +9,17 @@ test("Test VertexAIEmbeddings.embedQuery", async () => { expect(typeof res[0]).toBe("number"); }); -test("Test VertexAIEmbeddings.embedDocuments", async () => { +const testModelsLocations = [ + ["text-embedding-005", "us-central1"], + ["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: "text-embedding-004", + model, + location, }); const res = await embeddings.embedDocuments([ "Hello world",