15
15
16
16
17
17
@retry (wait = wait_random_exponential (min = 1 , max = 20 ), stop = stop_after_attempt (6 ))
18
- def get_embedding (text : str , engine = "text-similarity-davinci-001 " , ** kwargs ) -> List [float ]:
18
+ def get_embedding (text : str , engine = "text-embedding-ada-002 " , ** kwargs ) -> List [float ]:
19
19
20
20
# replace newlines, which can negatively affect performance.
21
21
text = text .replace ("\n " , " " )
@@ -25,7 +25,7 @@ def get_embedding(text: str, engine="text-similarity-davinci-001", **kwargs) ->
25
25
26
26
@retry (wait = wait_random_exponential (min = 1 , max = 20 ), stop = stop_after_attempt (6 ))
27
27
async def aget_embedding (
28
- text : str , engine = "text-similarity-davinci-001 " , ** kwargs
28
+ text : str , engine = "text-embedding-ada-002 " , ** kwargs
29
29
) -> List [float ]:
30
30
31
31
# replace newlines, which can negatively affect performance.
@@ -38,9 +38,9 @@ async def aget_embedding(
38
38
39
39
@retry (wait = wait_random_exponential (min = 1 , max = 20 ), stop = stop_after_attempt (6 ))
40
40
def get_embeddings (
41
- list_of_text : List [str ], engine = "text-similarity-babbage-001 " , ** kwargs
41
+ list_of_text : List [str ], engine = "text-embedding-ada-002 " , ** kwargs
42
42
) -> List [List [float ]]:
43
- assert len (list_of_text ) <= 2048 , "The batch size should not be larger than 2048 ."
43
+ assert len (list_of_text ) <= 8191 , "The batch size should not be larger than 8191 ."
44
44
45
45
# replace newlines, which can negatively affect performance.
46
46
list_of_text = [text .replace ("\n " , " " ) for text in list_of_text ]
@@ -51,9 +51,9 @@ def get_embeddings(
51
51
52
52
@retry (wait = wait_random_exponential (min = 1 , max = 20 ), stop = stop_after_attempt (6 ))
53
53
async def aget_embeddings (
54
- list_of_text : List [str ], engine = "text-similarity-babbage-001 " , ** kwargs
54
+ list_of_text : List [str ], engine = "text-embedding-ada-002 " , ** kwargs
55
55
) -> List [List [float ]]:
56
- assert len (list_of_text ) <= 2048 , "The batch size should not be larger than 2048 ."
56
+ assert len (list_of_text ) <= 8191 , "The batch size should not be larger than 8191 ."
57
57
58
58
# replace newlines, which can negatively affect performance.
59
59
list_of_text = [text .replace ("\n " , " " ) for text in list_of_text ]
0 commit comments