@@ -21,15 +21,16 @@ class TestEmbeddings:
21
21
def test_method_create (self , client : OpenAI ) -> None :
22
22
embedding = client .embeddings .create (
23
23
input = "The quick brown fox jumped over the lazy dog" ,
24
- model = "text-embedding-ada-002 " ,
24
+ model = "text-embedding-3-small " ,
25
25
)
26
26
assert_matches_type (CreateEmbeddingResponse , embedding , path = ["response" ])
27
27
28
28
@parametrize
29
29
def test_method_create_with_all_params (self , client : OpenAI ) -> None :
30
30
embedding = client .embeddings .create (
31
31
input = "The quick brown fox jumped over the lazy dog" ,
32
- model = "text-embedding-ada-002" ,
32
+ model = "text-embedding-3-small" ,
33
+ dimensions = 1 ,
33
34
encoding_format = "float" ,
34
35
user = "user-1234" ,
35
36
)
@@ -39,7 +40,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
39
40
def test_raw_response_create (self , client : OpenAI ) -> None :
40
41
response = client .embeddings .with_raw_response .create (
41
42
input = "The quick brown fox jumped over the lazy dog" ,
42
- model = "text-embedding-ada-002 " ,
43
+ model = "text-embedding-3-small " ,
43
44
)
44
45
45
46
assert response .is_closed is True
@@ -51,7 +52,7 @@ def test_raw_response_create(self, client: OpenAI) -> None:
51
52
def test_streaming_response_create (self , client : OpenAI ) -> None :
52
53
with client .embeddings .with_streaming_response .create (
53
54
input = "The quick brown fox jumped over the lazy dog" ,
54
- model = "text-embedding-ada-002 " ,
55
+ model = "text-embedding-3-small " ,
55
56
) as response :
56
57
assert not response .is_closed
57
58
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
@@ -69,15 +70,16 @@ class TestAsyncEmbeddings:
69
70
async def test_method_create (self , async_client : AsyncOpenAI ) -> None :
70
71
embedding = await async_client .embeddings .create (
71
72
input = "The quick brown fox jumped over the lazy dog" ,
72
- model = "text-embedding-ada-002 " ,
73
+ model = "text-embedding-3-small " ,
73
74
)
74
75
assert_matches_type (CreateEmbeddingResponse , embedding , path = ["response" ])
75
76
76
77
@parametrize
77
78
async def test_method_create_with_all_params (self , async_client : AsyncOpenAI ) -> None :
78
79
embedding = await async_client .embeddings .create (
79
80
input = "The quick brown fox jumped over the lazy dog" ,
80
- model = "text-embedding-ada-002" ,
81
+ model = "text-embedding-3-small" ,
82
+ dimensions = 1 ,
81
83
encoding_format = "float" ,
82
84
user = "user-1234" ,
83
85
)
@@ -87,7 +89,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
87
89
async def test_raw_response_create (self , async_client : AsyncOpenAI ) -> None :
88
90
response = await async_client .embeddings .with_raw_response .create (
89
91
input = "The quick brown fox jumped over the lazy dog" ,
90
- model = "text-embedding-ada-002 " ,
92
+ model = "text-embedding-3-small " ,
91
93
)
92
94
93
95
assert response .is_closed is True
@@ -99,7 +101,7 @@ async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None:
99
101
async def test_streaming_response_create (self , async_client : AsyncOpenAI ) -> None :
100
102
async with async_client .embeddings .with_streaming_response .create (
101
103
input = "The quick brown fox jumped over the lazy dog" ,
102
- model = "text-embedding-ada-002 " ,
104
+ model = "text-embedding-3-small " ,
103
105
) as response :
104
106
assert not response .is_closed
105
107
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
0 commit comments