From ce633119510d6b8ae71dec0310d4a5d08700e172 Mon Sep 17 00:00:00 2001 From: Marcin Antas Date: Thu, 5 Mar 2026 12:15:24 +0100 Subject: [PATCH 1/2] feat: add multi2vec_google_aistudio vectorizer config --- test/collection/test_config.py | 23 +++++++++ .../collections/classes/config_vectorizers.py | 3 +- .../collections/classes/config_vectors.py | 48 +++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/test/collection/test_config.py b/test/collection/test_config.py index 81fb485b2..094a8d63d 100644 --- a/test/collection/test_config.py +++ b/test/collection/test_config.py @@ -2563,6 +2563,29 @@ def test_config_with_named_vectors( } }, ), + ( + [ + Configure.Vectors.multi2vec_google_aistudio( + name="test", + image_fields=["image"], + text_fields=["text"], + dimensions=768, + ) + ], + { + "test": { + "vectorizer": { + "multi2vec-palm": { + "apiEndpoint": "generativelanguage.googleapis.com", + "imageFields": ["image"], + "textFields": ["text"], + "dimensions": 768, + } + }, + "vectorIndexType": "hnsw", + } + }, + ), ( [ Configure.Vectors.multi2vec_bind( diff --git a/weaviate/collections/classes/config_vectorizers.py b/weaviate/collections/classes/config_vectorizers.py index 2d8a83bf2..d5b1e9b5b 100644 --- a/weaviate/collections/classes/config_vectorizers.py +++ b/weaviate/collections/classes/config_vectorizers.py @@ -547,8 +547,9 @@ class _Multi2VecGoogleConfig(_Multi2VecBase, _VectorizerConfigCreate): default=Vectorizers.MULTI2VEC_PALM, frozen=True, exclude=True ) videoFields: Optional[List[Multi2VecField]] - projectId: str + projectId: Optional[str] location: Optional[str] + apiEndpoint: Optional[str] = None modelId: Optional[str] dimensions: Optional[int] videoIntervalSeconds: Optional[int] diff --git a/weaviate/collections/classes/config_vectors.py b/weaviate/collections/classes/config_vectors.py index 17ab43cc4..e764686b6 100644 --- a/weaviate/collections/classes/config_vectors.py +++ b/weaviate/collections/classes/config_vectors.py @@ -1073,6 +1073,54 @@ def multi2vec_google( vector_index_config=_IndexWrappers.single(vector_index_config, quantizer), ) + @staticmethod + @typing_deprecated( + "`multi2vec_google_aistudio` is deprecated and will be removed after Q3 '26. Use `multi2vec_google_gemini` instead." + ) + def multi2vec_google_aistudio( + *, + name: Optional[str] = None, + quantizer: Optional[_QuantizerConfigCreate] = None, + dimensions: Optional[int] = None, + image_fields: Optional[Union[List[str], List[Multi2VecField]]] = None, + model: Optional[str] = None, + text_fields: Optional[Union[List[str], List[Multi2VecField]]] = None, + video_fields: Optional[Union[List[str], List[Multi2VecField]]] = None, + video_interval_seconds: Optional[int] = None, + vector_index_config: Optional[_VectorIndexConfigCreate] = None, + ) -> _VectorConfigCreate: + """Create a vector using the `multi2vec-google` module with the Google AI Studio API endpoint. + + See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings-multimodal) + for detailed usage. + + Args: + name: The name of the vector. + quantizer: The quantizer to use for the vector index. If not provided, no quantization will be applied. + dimensions: The number of dimensions to use. Defaults to `None`, which uses the server-defined default. + image_fields: The image fields to use in vectorization. + model: The model to use. Defaults to `None`, which uses the server-defined default. + text_fields: The text fields to use in vectorization. + video_fields: The video fields to use in vectorization. + video_interval_seconds: Length of a video interval. Defaults to `None`, which uses the server-defined default. + vector_index_config: The configuration for Weaviate's vector index. Use `wvc.config.Configure.VectorIndex` to create a vector index configuration. None by default + """ + return _VectorConfigCreate( + name=name, + vectorizer=_Multi2VecGoogleConfig( + projectId=None, + location=None, + apiEndpoint="generativelanguage.googleapis.com", + imageFields=_map_multi2vec_fields(image_fields), + textFields=_map_multi2vec_fields(text_fields), + videoFields=_map_multi2vec_fields(video_fields), + dimensions=dimensions, + modelId=model, + videoIntervalSeconds=video_interval_seconds, + ), + vector_index_config=_IndexWrappers.single(vector_index_config, quantizer), + ) + @staticmethod def multi2vec_bind( *, From 2ccdaa109a8ba599bec569b489aca3497087869e Mon Sep 17 00:00:00 2001 From: Marcin Antas Date: Thu, 5 Mar 2026 12:43:19 +0100 Subject: [PATCH 2/2] chore: rename multi2vec_google_aistudio config to multi2vec_google_gemini --- test/collection/test_config.py | 2 +- weaviate/collections/classes/config_vectors.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/test/collection/test_config.py b/test/collection/test_config.py index 094a8d63d..d682e1dcd 100644 --- a/test/collection/test_config.py +++ b/test/collection/test_config.py @@ -2565,7 +2565,7 @@ def test_config_with_named_vectors( ), ( [ - Configure.Vectors.multi2vec_google_aistudio( + Configure.Vectors.multi2vec_google_gemini( name="test", image_fields=["image"], text_fields=["text"], diff --git a/weaviate/collections/classes/config_vectors.py b/weaviate/collections/classes/config_vectors.py index e764686b6..a7e824835 100644 --- a/weaviate/collections/classes/config_vectors.py +++ b/weaviate/collections/classes/config_vectors.py @@ -1074,10 +1074,7 @@ def multi2vec_google( ) @staticmethod - @typing_deprecated( - "`multi2vec_google_aistudio` is deprecated and will be removed after Q3 '26. Use `multi2vec_google_gemini` instead." - ) - def multi2vec_google_aistudio( + def multi2vec_google_gemini( *, name: Optional[str] = None, quantizer: Optional[_QuantizerConfigCreate] = None, @@ -1089,7 +1086,7 @@ def multi2vec_google_aistudio( video_interval_seconds: Optional[int] = None, vector_index_config: Optional[_VectorIndexConfigCreate] = None, ) -> _VectorConfigCreate: - """Create a vector using the `multi2vec-google` module with the Google AI Studio API endpoint. + """Create a vector using the `multi2vec-google` module with the Google Gemini API endpoint. See the [documentation](https://weaviate.io/developers/weaviate/model-providers/google/embeddings-multimodal) for detailed usage.