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
25 changes: 25 additions & 0 deletions test/collection/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2429,6 +2429,31 @@ def test_config_with_named_vectors(
}
},
),
(
[
Configure.Vectors.text2vec_google_vertex(
name="test",
project_id="project",
source_properties=["prop"],
dimensions=768,
location="europe-west1",
)
],
{
"test": {
"vectorizer": {
"text2vec-palm": {
"projectId": "project",
"location": "europe-west1",
"properties": ["prop"],
"vectorizeClassName": True,
"dimensions": 768,
}
},
"vectorIndexType": "hnsw",
}
},
),
(
[
Configure.Vectors.text2vec_google_gemini(
Expand Down
5 changes: 5 additions & 0 deletions weaviate/collections/classes/config_named_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ def text2vec_palm(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=None,
location=None,
),
vector_index_config=vector_index_config,
)
Expand All @@ -1006,6 +1007,7 @@ def text2vec_google(
source_properties: Optional[List[str]] = None,
vector_index_config: Optional[_VectorIndexConfigCreate] = None,
vectorize_collection_name: bool = True,
location: Optional[str] = None,
) -> _NamedVectorConfigCreate:
"""Create a named vector using the `text2vec_palm` model.

Expand All @@ -1022,6 +1024,7 @@ def text2vec_google(
api_endpoint: The API endpoint to use without a leading scheme such as `http://`. Defaults to `None`, which uses the server-defined default
model_id: The model ID to use. Defaults to `None`, which uses the server-defined default.
title_property: The Weaviate property name for the `gecko-002` or `gecko-003` model to use as the title.
location: The Google Vertex AI region to run the model in. Defaults to `None`, which uses the server-defined default.

Raises:
pydantic.ValidationError: If `api_endpoint` is not a valid URL.
Expand All @@ -1037,6 +1040,7 @@ def text2vec_google(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=None,
location=location,
),
vector_index_config=vector_index_config,
)
Expand Down Expand Up @@ -1079,6 +1083,7 @@ def text2vec_google_aistudio(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=None,
location=None,
),
vector_index_config=vector_index_config,
)
Expand Down
6 changes: 6 additions & 0 deletions weaviate/collections/classes/config_vectorizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ class _Text2VecGoogleConfig(_VectorizerConfigCreate):
vectorizeClassName: bool
titleProperty: Optional[str]
taskType: Optional[str]
location: Optional[str]


class _Text2VecTransformersConfig(_VectorizerConfigCreate):
Expand Down Expand Up @@ -1199,6 +1200,7 @@ def text2vec_palm(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=None,
location=None,
)

@staticmethod
Expand Down Expand Up @@ -1228,6 +1230,7 @@ def text2vec_google_aistudio(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=None,
location=None,
)

@staticmethod
Expand All @@ -1237,6 +1240,7 @@ def text2vec_google(
model_id: Optional[str] = None,
title_property: Optional[str] = None,
vectorize_collection_name: bool = True,
location: Optional[str] = None,
) -> _VectorizerConfigCreate:
"""Create a `_Text2VecGoogleConfig` object for use when vectorizing using the `text2vec-google` model.

Expand All @@ -1250,6 +1254,7 @@ def text2vec_google(
title_property: The Weaviate property name for the `gecko-002` or `gecko-003` model to use as the title.
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.
location: The Google Vertex AI region to run the model in. Defaults to `None`, which uses the server-defined default.

Raises:
pydantic.ValidationError: If `api_endpoint` is not a valid URL.
Expand All @@ -1262,6 +1267,7 @@ def text2vec_google(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=None,
location=location,
)

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

Expand All @@ -1495,6 +1496,7 @@ def text2vec_google(
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`.
location: The Google Vertex AI region to run the model in. Defaults to `None`, which uses the server-defined default.

Raises:
pydantic.ValidationError: If `api_endpoint` is not a valid URL.
Expand All @@ -1510,6 +1512,7 @@ def text2vec_google(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=task_type,
location=location,
),
vector_index_config=_IndexWrappers.single(vector_index_config, quantizer),
)
Expand Down Expand Up @@ -1560,6 +1563,7 @@ def text2vec_google_aistudio(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=task_type,
location=None,
),
vector_index_config=_IndexWrappers.single(vector_index_config, quantizer),
)
Expand Down Expand Up @@ -1607,6 +1611,7 @@ def text2vec_google_gemini(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=task_type,
location=None,
),
vector_index_config=_IndexWrappers.single(vector_index_config, quantizer),
)
Expand All @@ -1625,6 +1630,7 @@ def text2vec_google_vertex(
source_properties: Optional[List[str]] = None,
vector_index_config: Optional[_VectorIndexConfigCreate] = None,
vectorize_collection_name: bool = True,
location: Optional[str] = None,
) -> _VectorConfigCreate:
"""Create a vector using the `text2vec-google` model.

Expand All @@ -1643,6 +1649,7 @@ def text2vec_google_vertex(
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`.
location: The Google Vertex AI region to run the model in. Defaults to `None`, which uses the server-defined default.

Raises:
pydantic.ValidationError: If `api_endpoint` is not a valid URL.
Expand All @@ -1658,6 +1665,7 @@ def text2vec_google_vertex(
vectorizeClassName=vectorize_collection_name,
titleProperty=title_property,
taskType=task_type,
location=location,
),
vector_index_config=_IndexWrappers.single(vector_index_config, quantizer),
)
Expand Down
Loading