Skip to content

Commit c73c2bc

Browse files
committed
Make form of openai endpoint parameter clearer in docstrings+test
1 parent cf33f1d commit c73c2bc

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

test/collection/test_config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ def test_basic_config():
323323
Configure.Vectorizer.text2vec_openai(
324324
vectorize_collection_name=False,
325325
model="ada",
326-
endpoint="https://api.custom.com/v1/embeddings",
326+
endpoint="/api/v3/embeddings",
327327
),
328328
{
329329
"text2vec-openai": {
330330
"vectorizeClassName": False,
331331
"model": "ada",
332-
"endpoint": "https://api.custom.com/v1/embeddings",
332+
"endpoint": "/api/v3/embeddings",
333333
"isAzure": False,
334334
}
335335
},
@@ -1779,7 +1779,7 @@ def test_vector_config_flat_pq() -> None:
17791779
Configure.NamedVectors.text2vec_openai(
17801780
name="test",
17811781
source_properties=["prop"],
1782-
endpoint="https://api.custom.com/v1/embeddings",
1782+
endpoint="/api/v3/embeddings",
17831783
)
17841784
],
17851785
{
@@ -1788,7 +1788,7 @@ def test_vector_config_flat_pq() -> None:
17881788
"text2vec-openai": {
17891789
"properties": ["prop"],
17901790
"vectorizeClassName": True,
1791-
"endpoint": "https://api.custom.com/v1/embeddings",
1791+
"endpoint": "/api/v3/embeddings",
17921792
"isAzure": False,
17931793
}
17941794
},
@@ -2403,7 +2403,7 @@ def test_config_with_named_vectors(
24032403
Configure.Vectors.text2vec_openai(
24042404
name="test",
24052405
source_properties=["prop"],
2406-
endpoint="https://api.custom.com/v1/embeddings",
2406+
endpoint="/api/v3/embeddings",
24072407
)
24082408
],
24092409
{
@@ -2412,7 +2412,7 @@ def test_config_with_named_vectors(
24122412
"text2vec-openai": {
24132413
"properties": ["prop"],
24142414
"vectorizeClassName": True,
2415-
"endpoint": "https://api.custom.com/v1/embeddings",
2415+
"endpoint": "/api/v3/embeddings",
24162416
"isAzure": False,
24172417
}
24182418
},
@@ -2472,7 +2472,7 @@ def test_config_with_named_vectors(
24722472
Configure.Vectors.text2vec_morph(
24732473
name="test",
24742474
source_properties=["prop"],
2475-
endpoint="https://api.custom.com/v1/embeddings",
2475+
endpoint="/api/v3/embeddings",
24762476
)
24772477
],
24782478
{
@@ -2481,7 +2481,7 @@ def test_config_with_named_vectors(
24812481
"text2vec-morph": {
24822482
"vectorizeClassName": True,
24832483
"properties": ["prop"],
2484-
"endpoint": "https://api.custom.com/v1/embeddings",
2484+
"endpoint": "/api/v3/embeddings",
24852485
}
24862486
},
24872487
"vectorIndexType": "hnsw",

weaviate/collections/classes/config_named_vectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def text2vec_openai(
425425
vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`.
426426
base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default.
427427
dimensions: Number of dimensions. Applicable to v3 OpenAI models only. Defaults to `None`, which uses the server-defined default.
428-
endpoint: The endpoint to use. Defaults to `None`, which uses the server-defined default of `/v1/embeddings`.
428+
endpoint: The API path to append to `base_url`, e.g. `/api/v3/embeddings`. Defaults to `None`, which uses the server-defined default.
429429
430430
Raises:
431431
pydantic.ValidationError: If `type_` is not a valid value from the `OpenAIType` type.

weaviate/collections/classes/config_vectorizers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ def text2vec_openai(
11531153
vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`.
11541154
base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default.
11551155
dimensions: Number of dimensions. Applicable to v3 OpenAI models only. Defaults to `None`, which uses the server-defined default.
1156-
endpoint: The endpoint to use. Defaults to `None`, which uses the server-defined default of `/v1/embeddings`.
1156+
endpoint: The API path to append to `base_url`, e.g. `/api/v3/embeddings`. Defaults to `None`, which uses the server-defined default.
11571157
11581158
Raises:
11591159
pydantic.ValidationError: If `type_` is not a valid value from the `OpenAIType` type.

weaviate/collections/classes/config_vectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ def text2vec_morph(
679679
quantizer: The quantizer to use for the vector index. If not provided, no quantization will be applied.
680680
base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default.
681681
model: The model to use. Defaults to `None`, which uses the server-defined default.
682-
endpoint: The endpoint to use. Defaults to `None`, which uses the server-defined default of `/v1/embeddings`.
682+
endpoint: The API path to append to `base_url`, e.g. `/api/v3/embeddings`. Defaults to `None`, which uses the server-defined default.
683683
source_properties: Which properties should be included when vectorizing. By default all text properties are included.
684684
vector_index_config: The configuration for Weaviate's vector index. Use `wvc.config.Configure.VectorIndex` to create a vector index configuration. None by default
685685
vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`.
@@ -760,7 +760,7 @@ def text2vec_openai(
760760
quantizer: The quantizer to use for the vector index. If not provided, no quantization will be applied.
761761
base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default.
762762
dimensions: Number of dimensions. Applicable to v3 OpenAI models only. Defaults to `None`, which uses the server-defined default.
763-
endpoint: The endpoint to use. Defaults to `None`, which uses the server-defined default of `/v1/embeddings`.
763+
endpoint: The API path to append to `base_url`, e.g. `/api/v3/embeddings`. Defaults to `None`, which uses the server-defined default.
764764
model: The model to use. Defaults to `None`, which uses the server-defined default.
765765
model_version: The model version to use. Defaults to `None`, which uses the server-defined default.
766766
type_: The type of model to use. Defaults to `None`, which uses the server-defined default.

0 commit comments

Comments
 (0)