Skip to content

Commit b4c2d35

Browse files
justin-cechmanektylerhutcherson
authored andcommitted
specifies azure openai deployment name
1 parent 12c6e67 commit b4c2d35

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/integration/test_vectorizers.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def bad_return_type(text: str) -> str:
248248
CohereTextVectorizer,
249249
CustomTextVectorizer,
250250
HFTextVectorizer,
251-
#MistralAITextVectorizer,
251+
# MistralAITextVectorizer,
252252
OpenAITextVectorizer,
253253
VertexAITextVectorizer,
254254
],
@@ -261,6 +261,10 @@ def test_dtypes(vector_class, skip_vectorizer):
261261
# test dtype defaults to float32
262262
if issubclass(vector_class, CustomTextVectorizer):
263263
vectorizer = vector_class(embed=lambda x, input_type=None: [1.0, 2.0, 3.0])
264+
elif issubclass(vector_class, AzureOpenAITextVectorizer):
265+
vectorizer = vector_class(
266+
model=os.getenv("AZURE_OPENAI_DEPLOYMENT_NAME", "text-embedding-ada-002")
267+
)
264268
else:
265269
vectorizer = vector_class()
266270
assert vectorizer.dtype == "float32"
@@ -279,6 +283,12 @@ def test_dtypes(vector_class, skip_vectorizer):
279283
for dtype in ["float16", "float32", "float64", "bfloat16"]:
280284
if issubclass(vector_class, CustomTextVectorizer):
281285
vectorizer = vector_class(embed=lambda x: [1.0, 2.0, 3.0], dtype=dtype)
286+
elif issubclass(vector_class, AzureOpenAITextVectorizer):
287+
vectorizer = vector_class(
288+
model=os.getenv(
289+
"AZURE_OPENAI_DEPLOYMENT_NAME", "text-embedding-ada-002"
290+
)
291+
)
282292
else:
283293
vectorizer = vector_class(dtype=dtype)
284294
assert vectorizer.dtype == dtype

0 commit comments

Comments
 (0)