From 437dbe724620675295f298164a076cbd8019d304 Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Wed, 19 Mar 2025 10:47:09 +0100 Subject: [PATCH] fix: VertexAI outputDimensionality configuration VertexAI's API documentation [1] is an absolute mess. In it, they describe the parameter to configure output dimensionality as `output_dimensionality`. In the API example, they switch to using snake case `outputDimensionality`, which is the correct variant. [1]: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api#generative-ai-get-text-embedding-drest --- litellm/llms/vertex_ai/vertex_embeddings/transformation.py | 2 +- tests/local_testing/test_amazing_vertex_completion.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/litellm/llms/vertex_ai/vertex_embeddings/transformation.py b/litellm/llms/vertex_ai/vertex_embeddings/transformation.py index 0e9c073f8dd..d9e84fca038 100644 --- a/litellm/llms/vertex_ai/vertex_embeddings/transformation.py +++ b/litellm/llms/vertex_ai/vertex_embeddings/transformation.py @@ -79,7 +79,7 @@ class VertexAITextEmbeddingConfig(BaseModel): ): for param, value in non_default_params.items(): if param == "dimensions": - optional_params["output_dimensionality"] = value + optional_params["outputDimensionality"] = value if "input_type" in kwargs: optional_params["task_type"] = kwargs.pop("input_type") diff --git a/tests/local_testing/test_amazing_vertex_completion.py b/tests/local_testing/test_amazing_vertex_completion.py index 8595b54f709..25993d6d5bb 100644 --- a/tests/local_testing/test_amazing_vertex_completion.py +++ b/tests/local_testing/test_amazing_vertex_completion.py @@ -2174,9 +2174,6 @@ async def test_vertexai_multimodal_embedding_base64image_in_input(): print("Response:", response) -@pytest.mark.skip( - reason="new test - works locally running into vertex version issues on ci/cd" -) def test_vertexai_embedding_embedding_latest(): try: load_vertex_ai_credentials()