Skip to content

Commit

Permalink
Test different embedding models over different regions.
Browse files Browse the repository at this point in the history
  • Loading branch information
afirstenberg committed Dec 19, 2024
1 parent 886cb68 commit 7526de8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libs/langchain-google-vertexai/src/tests/embeddings.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7526de8

Please sign in to comment.