Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion test/collection/test_config.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"])],
Expand Down
14 changes: 7 additions & 7 deletions weaviate/collections/classes/config_named_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions weaviate/collections/classes/config_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading