Skip to content
Merged
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
2 changes: 2 additions & 0 deletions test/collection/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,15 @@ def test_basic_config():
model="cohere.embed-english-v3",
region="us-east-1",
service="bedrock",
dimensions=512,
),
{
"text2vec-aws": {
"vectorizeClassName": False,
"model": "cohere.embed-english-v3",
"region": "us-east-1",
"service": "bedrock",
"dimensions": 512,
}
},
),
Expand Down
3 changes: 3 additions & 0 deletions weaviate/collections/classes/config_named_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ def text2vec_aws(
source_properties: Optional[List[str]] = None,
vector_index_config: Optional[_VectorIndexConfigCreate] = None,
vectorize_collection_name: bool = True,
dimensions: Optional[int] = None,
) -> _NamedVectorConfigCreate:
"""Create a named vector using the `text2vec_aws` model.

Expand All @@ -468,6 +469,7 @@ def text2vec_aws(
source_properties: Which properties should be included when vectorizing. By default all text properties are included.
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`.
dimensions: The dimensionality of the vectors. Defaults to `None`, which uses the server-defined default.
"""
return _NamedVectorConfigCreate(
name=name,
Expand All @@ -480,6 +482,7 @@ def text2vec_aws(
vectorizeClassName=vectorize_collection_name,
targetModel=None,
targetVariant=None,
dimensions=dimensions,
),
vector_index_config=vector_index_config,
)
Expand Down
4 changes: 4 additions & 0 deletions weaviate/collections/classes/config_vectorizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class _Text2VecAWSConfig(_VectorizerConfigCreate):
service: str
targetModel: Optional[str]
targetVariant: Optional[str]
dimensions: Optional[int]
vectorizeClassName: bool

@field_validator("region")
Expand Down Expand Up @@ -770,6 +771,7 @@ def text2vec_aws(
endpoint: Optional[str] = None,
service: Union[AWSService, str] = "bedrock",
vectorize_collection_name: bool = True,
dimensions: Optional[int] = None,
) -> _VectorizerConfigCreate:
"""Create a `_Text2VecAWSConfigCreate` object for use when vectorizing using the `text2vec-aws` model.

Expand All @@ -782,6 +784,7 @@ def text2vec_aws(
endpoint: The model to use, REQUIRED for service "sagemaker".
service: The AWS service to use, options are "bedrock" and "sagemaker".
vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`.
dimensions: The dimensionality of the vectors. Defaults to `None`, which uses the server-defined default.
"""
return _Text2VecAWSConfig(
model=model,
Expand All @@ -791,6 +794,7 @@ def text2vec_aws(
endpoint=endpoint,
targetModel=None,
targetVariant=None,
dimensions=dimensions,
)

@staticmethod
Expand Down
9 changes: 9 additions & 0 deletions weaviate/collections/classes/config_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ def text2vec_aws(
source_properties: Optional[List[str]] = None,
vector_index_config: Optional[_VectorIndexConfigCreate] = None,
vectorize_collection_name: bool = True,
dimensions: Optional[int] = None,
) -> _VectorConfigCreate:
"""Create a vector using the `text2vec-aws` module.

Expand All @@ -811,6 +812,7 @@ def text2vec_aws(
source_properties: Which properties should be included when vectorizing. By default all text properties are included.
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`.
dimensions: The dimensionality of the vectors. Defaults to `None`, which uses the server-defined default.
"""
return _VectorConfigCreate(
name=name,
Expand All @@ -823,6 +825,7 @@ def text2vec_aws(
vectorizeClassName=vectorize_collection_name,
targetModel=None,
targetVariant=None,
dimensions=dimensions,
),
vector_index_config=_IndexWrappers.single(vector_index_config, quantizer),
)
Expand All @@ -837,6 +840,7 @@ def text2vec_aws_bedrock(
source_properties: Optional[List[str]] = None,
vector_index_config: Optional[_VectorIndexConfigCreate] = None,
vectorize_collection_name: bool = True,
dimensions: Optional[int] = None,
) -> _VectorConfigCreate:
"""Create a vector using the `text2vec-aws` module.

Expand All @@ -851,6 +855,7 @@ def text2vec_aws_bedrock(
source_properties: Which properties should be included when vectorizing. By default all text properties are included.
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`.
dimensions: The dimensionality of the vectors. Defaults to `None`, which uses the server-defined default.
"""
return _VectorConfigCreate(
name=name,
Expand All @@ -863,6 +868,7 @@ def text2vec_aws_bedrock(
vectorizeClassName=vectorize_collection_name,
targetModel=None,
targetVariant=None,
dimensions=dimensions,
),
vector_index_config=_IndexWrappers.single(vector_index_config, quantizer),
)
Expand All @@ -879,6 +885,7 @@ def text2vec_aws_sagemaker(
source_properties: Optional[List[str]] = None,
vector_index_config: Optional[_VectorIndexConfigCreate] = None,
vectorize_collection_name: bool = True,
dimensions: Optional[int] = None,
) -> _VectorConfigCreate:
"""Create a vector using the `text2vec-aws` module.

Expand All @@ -895,6 +902,7 @@ def text2vec_aws_sagemaker(
source_properties: Which properties should be included when vectorizing. By default all text properties are included.
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`.
dimensions: The dimensionality of the vectors. Defaults to `None`, which uses the server-defined default.
"""
return _VectorConfigCreate(
name=name,
Expand All @@ -907,6 +915,7 @@ def text2vec_aws_sagemaker(
targetVariant=target_variant,
service="sagemaker",
vectorizeClassName=vectorize_collection_name,
dimensions=dimensions,
),
vector_index_config=_IndexWrappers.single(vector_index_config, quantizer),
)
Expand Down
Loading