Skip to content

Commit 22aa8fc

Browse files
committed
Remove oudated constructors for text2vec-digitalocean configuration and make model required
1 parent 9eaf424 commit 22aa8fc

4 files changed

Lines changed: 8 additions & 87 deletions

File tree

test/collection/test_config.py

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -329,20 +329,6 @@ def test_basic_config():
329329
}
330330
},
331331
),
332-
(
333-
Configure.Vectorizer.text2vec_digitalocean(
334-
vectorize_collection_name=False,
335-
model="qwen3-embedding-0.6b",
336-
base_url="https://inference.do-ai.run",
337-
),
338-
{
339-
"text2vec-digitalocean": {
340-
"vectorizeClassName": False,
341-
"model": "qwen3-embedding-0.6b",
342-
"baseURL": "https://inference.do-ai.run/",
343-
}
344-
},
345-
),
346332
(
347333
Configure.Vectorizer.text2vec_palm(
348334
project_id="project",
@@ -1785,20 +1771,6 @@ def test_vector_config_flat_pq() -> None:
17851771
}
17861772
},
17871773
),
1788-
(
1789-
[Configure.NamedVectors.text2vec_digitalocean(name="test", source_properties=["prop"])],
1790-
{
1791-
"test": {
1792-
"vectorizer": {
1793-
"text2vec-digitalocean": {
1794-
"vectorizeClassName": True,
1795-
"properties": ["prop"],
1796-
}
1797-
},
1798-
"vectorIndexType": "hnsw",
1799-
}
1800-
},
1801-
),
18021774
(
18031775
[
18041776
Configure.NamedVectors.text2vec_palm(
@@ -2402,13 +2374,18 @@ def test_config_with_named_vectors(
24022374
},
24032375
),
24042376
(
2405-
[Configure.Vectors.text2vec_digitalocean(name="test", source_properties=["prop"])],
2377+
[
2378+
Configure.Vectors.text2vec_digitalocean(
2379+
name="test", source_properties=["prop"], model="qwen2"
2380+
)
2381+
],
24062382
{
24072383
"test": {
24082384
"vectorizer": {
24092385
"text2vec-digitalocean": {
24102386
"vectorizeClassName": True,
24112387
"properties": ["prop"],
2388+
"model": "qwen2",
24122389
}
24132390
},
24142391
"vectorIndexType": "hnsw",

weaviate/collections/classes/config_named_vectors.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
_Text2VecCohereConfig,
4949
_Text2VecContextionaryConfig,
5050
_Text2VecDatabricksConfig,
51-
_Text2VecDigitalOceanConfig,
5251
_Text2VecGoogleConfig,
5352
_Text2VecGPT4AllConfig,
5453
_Text2VecHuggingFaceConfig,
@@ -359,40 +358,6 @@ def text2vec_mistral(
359358
vector_index_config=vector_index_config,
360359
)
361360

362-
@staticmethod
363-
def text2vec_digitalocean(
364-
name: str,
365-
*,
366-
base_url: Optional[AnyHttpUrl] = None,
367-
model: Optional[str] = None,
368-
source_properties: Optional[List[str]] = None,
369-
vector_index_config: Optional[_VectorIndexConfigCreate] = None,
370-
vectorize_collection_name: bool = True,
371-
) -> _NamedVectorConfigCreate:
372-
"""Create a named vector using the `text2vec-digitalocean` model.
373-
374-
See the [documentation](https://weaviate.io/developers/weaviate/model-providers/digitalocean/embeddings)
375-
for detailed usage.
376-
377-
Args:
378-
name: The name of the named vector.
379-
base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default of `https://inference.do-ai.run`.
380-
model: The model to use, e.g. `qwen3-embedding-0.6b`. This is a required field on the server.
381-
source_properties: Which properties should be included when vectorizing. By default all text properties are included.
382-
vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default
383-
vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`.
384-
"""
385-
return _NamedVectorConfigCreate(
386-
name=name,
387-
source_properties=source_properties,
388-
vectorizer=_Text2VecDigitalOceanConfig(
389-
baseURL=base_url,
390-
model=model,
391-
vectorizeClassName=vectorize_collection_name,
392-
),
393-
vector_index_config=vector_index_config,
394-
)
395-
396361
@staticmethod
397362
def text2vec_ollama(
398363
name: str,

weaviate/collections/classes/config_vectorizers.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class _Text2VecDigitalOceanConfig(_VectorizerConfigCreate):
291291
vectorizer: Union[Vectorizers, _EnumLikeStr] = Field(
292292
default=Vectorizers.TEXT2VEC_DIGITALOCEAN, frozen=True, exclude=True
293293
)
294-
model: Optional[str]
294+
model: str
295295
vectorizeClassName: bool
296296
baseURL: Optional[AnyHttpUrl]
297297

@@ -1100,27 +1100,6 @@ def text2vec_mistral(
11001100
baseURL=base_url, model=model, vectorizeClassName=vectorize_collection_name
11011101
)
11021102

1103-
@staticmethod
1104-
def text2vec_digitalocean(
1105-
*,
1106-
base_url: Optional[AnyHttpUrl] = None,
1107-
model: Optional[str] = None,
1108-
vectorize_collection_name: bool = True,
1109-
) -> _VectorizerConfigCreate:
1110-
"""Create a `_Text2VecDigitalOceanConfig` object for use when vectorizing using the `text2vec-digitalocean` model.
1111-
1112-
See the [documentation](https://weaviate.io/developers/weaviate/model-providers/digitalocean/embeddings)
1113-
for detailed usage.
1114-
1115-
Args:
1116-
base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default of `https://inference.do-ai.run`.
1117-
model: The model to use, e.g. `qwen3-embedding-0.6b`. This is a required field on the server.
1118-
vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`.
1119-
"""
1120-
return _Text2VecDigitalOceanConfig(
1121-
baseURL=base_url, model=model, vectorizeClassName=vectorize_collection_name
1122-
)
1123-
11241103
@staticmethod
11251104
def text2vec_ollama(
11261105
*,

weaviate/collections/classes/config_vectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ def text2vec_digitalocean(
627627
name: Optional[str] = None,
628628
quantizer: Optional[_QuantizerConfigCreate] = None,
629629
base_url: Optional[AnyHttpUrl] = None,
630-
model: Optional[str] = None,
630+
model: str,
631631
source_properties: Optional[List[str]] = None,
632632
vector_index_config: Optional[_VectorIndexConfigCreate] = None,
633633
vectorize_collection_name: bool = True,

0 commit comments

Comments
 (0)