Skip to content

Commit

Permalink
fixed integration tests (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuligin authored Oct 29, 2024
1 parent 797731e commit 9a14132
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libs/vertexai/tests/integration_tests/test_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
VertexAIEmbeddings,
)

_EMBEDDING_MODELS = [
("textembedding-gecko@004", 768),
("multimodalembedding@001", 1408),
]


@pytest.mark.release
def test_initialization() -> None:
Expand All @@ -33,7 +38,7 @@ def test_initialization() -> None:
)
@pytest.mark.parametrize(
"model_name, embeddings_dim",
[("textembedding-gecko@001", 768), ("multimodalembedding@001", 1408)],
_EMBEDDING_MODELS,
)
def test_langchain_google_vertexai_embedding_documents(
number_of_docs: int, model_name: str, embeddings_dim: int
Expand All @@ -51,7 +56,7 @@ def test_langchain_google_vertexai_embedding_documents(
@pytest.mark.release
@pytest.mark.parametrize(
"model_name, embeddings_dim",
[("textembedding-gecko@001", 768), ("multimodalembedding@001", 1408)],
_EMBEDDING_MODELS,
)
def test_langchain_google_vertexai_embedding_query(model_name, embeddings_dim) -> None:
document = "foo bar"
Expand Down Expand Up @@ -95,7 +100,7 @@ def test_langchain_google_vertexai_image_embeddings(

@pytest.mark.release
def test_langchain_google_vertexai_text_model() -> None:
embeddings_model = VertexAIEmbeddings(model_name="textembedding-gecko@001")
embeddings_model = VertexAIEmbeddings(model_name="textembedding-gecko@004")
assert isinstance(embeddings_model.client, TextEmbeddingModel)
assert embeddings_model.model_type == GoogleEmbeddingModelType.TEXT

Expand Down

0 comments on commit 9a14132

Please sign in to comment.