diff --git a/test/collection/test_config.py b/test/collection/test_config.py index 5a79110a0..3739f6136 100644 --- a/test/collection/test_config.py +++ b/test/collection/test_config.py @@ -1,5 +1,6 @@ +import inspect import warnings -from typing import List, Union +from typing import Callable, List, Union import pytest from pydantic import ValidationError @@ -2197,6 +2198,36 @@ def test_config_with_named_vectors( } +MULTI2VEC_FACTORIES_WITH_VECTORIZE_COLLECTION_NAME = [ + Configure.Vectorizer.multi2vec_cohere, + Configure.Vectorizer.multi2vec_clip, + Configure.Vectorizer.multi2vec_google, + Configure.Vectorizer.multi2vec_bind, + Configure.Vectorizer.multi2vec_voyageai, + Configure.Vectorizer.multi2vec_nvidia, + Configure.Vectorizer.multi2vec_jinaai, + Configure.NamedVectors.multi2vec_cohere, + Configure.NamedVectors.multi2vec_clip, + Configure.NamedVectors.multi2vec_google, + Configure.NamedVectors.multi2vec_bind, + Configure.NamedVectors.multi2vec_voyageai, + Configure.NamedVectors.multi2vec_nvidia, + Configure.NamedVectors.multi2vec_jinaai, + Configure.Vectors.multi2vec_cohere, +] + + +@pytest.mark.parametrize("factory", MULTI2VEC_FACTORIES_WITH_VECTORIZE_COLLECTION_NAME) +def test_multi2vec_vectorize_collection_name_deprecated(factory: Callable) -> None: + """`vectorize_collection_name` must be documented as having no effect in `multi2vec_*` factories. + + No `multi2vec-*` module reads `vectorizeClassName` server-side, so the argument is kept + for backwards compatibility only and must not be documented as functional. + """ + assert "vectorize_collection_name" in inspect.signature(factory).parameters + assert "vectorize_collection_name: Deprecated, has no effect." in (factory.__doc__ or "") + + TEST_CONFIG_WITH_VECTORS_PARAMETERS = [ ( [Configure.Vectors.text2vec_contextionary(name="test", source_properties=["prop"])], diff --git a/weaviate/collections/classes/config_named_vectors.py b/weaviate/collections/classes/config_named_vectors.py index f23c9e38a..ec5189f9b 100644 --- a/weaviate/collections/classes/config_named_vectors.py +++ b/weaviate/collections/classes/config_named_vectors.py @@ -235,7 +235,7 @@ def multi2vec_cohere( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. model: The model to use. Defaults to `None`, which uses the server-defined default. truncate: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. @@ -530,7 +530,7 @@ def multi2vec_clip( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. image_fields: The image fields to use in vectorization. text_fields: The text fields to use in vectorization. inference_url: The inference url to use where API requests should go. Defaults to `None`, which uses the server-defined default. @@ -569,7 +569,7 @@ def multi2vec_google( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. location: Where the model runs. REQUIRED. project_id: The project ID to use, REQUIRED. audio_fields: The audio fields to use in vectorization. @@ -625,7 +625,7 @@ def multi2vec_bind( thermal_fields: The thermal fields to use in vectorization. video_fields: The video fields to use in vectorization. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. """ return _NamedVectorConfigCreate( name=name, @@ -662,7 +662,7 @@ def multi2vec_voyageai( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. model: The model to use. Defaults to `None`, which uses the server-defined default. truncation: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. @@ -707,7 +707,7 @@ def multi2vec_nvidia( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. model: The model to use. Defaults to `None`, which uses the server-defined default. truncation: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. @@ -1073,7 +1073,7 @@ def multi2vec_jinaai( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. model: The model to use. Defaults to `None`, which uses the server-defined default. base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. dimensions: The number of dimensions for the generated embeddings (only available for some models). Defaults to `None`, which uses the server-defined default. diff --git a/weaviate/collections/classes/config_vectors.py b/weaviate/collections/classes/config_vectors.py index edf1c3b89..c543d2d33 100644 --- a/weaviate/collections/classes/config_vectors.py +++ b/weaviate/collections/classes/config_vectors.py @@ -468,6 +468,7 @@ def multi2vec_cohere( text_fields: The text fields to use in vectorization. truncate: The truncation strategy to use. 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 + vectorize_collection_name: Deprecated, has no effect. Raises: pydantic.ValidationError: If `model` is not a valid value from the `CohereMultimodalModel` type or if `truncate` is not a valid value from the `CohereTruncation` type.