1515
1616
1717@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 ]:
1919
2020 # replace newlines, which can negatively affect performance.
2121 text = text .replace ("\n " , " " )
@@ -25,7 +25,7 @@ def get_embedding(text: str, engine="text-similarity-davinci-001", **kwargs) ->
2525
2626@retry (wait = wait_random_exponential (min = 1 , max = 20 ), stop = stop_after_attempt (6 ))
2727async def aget_embedding (
28- text : str , engine = "text-similarity-davinci-001 " , ** kwargs
28+ text : str , engine = "text-embedding-ada-002 " , ** kwargs
2929) -> List [float ]:
3030
3131 # replace newlines, which can negatively affect performance.
@@ -38,9 +38,9 @@ async def aget_embedding(
3838
3939@retry (wait = wait_random_exponential (min = 1 , max = 20 ), stop = stop_after_attempt (6 ))
4040def 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
4242) -> 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 ."
4444
4545 # replace newlines, which can negatively affect performance.
4646 list_of_text = [text .replace ("\n " , " " ) for text in list_of_text ]
@@ -51,9 +51,9 @@ def get_embeddings(
5151
5252@retry (wait = wait_random_exponential (min = 1 , max = 20 ), stop = stop_after_attempt (6 ))
5353async 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
5555) -> 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 ."
5757
5858 # replace newlines, which can negatively affect performance.
5959 list_of_text = [text .replace ("\n " , " " ) for text in list_of_text ]
0 commit comments