langtest.embeddings.openai.OpenaiEmbeddings#
- class OpenaiEmbeddings(model='text-embedding-ada-002')#
Bases:
object
- __init__(model='text-embedding-ada-002')#
Methods
__init__
([model])get_embedding
(text[, convert_to_tensor])Get an embedding for the input text using OpenAI's text-embedding models.
Attributes
LIB_NAME
- get_embedding(text: str | list, convert_to_tensor: bool = False) ndarray | list #
Get an embedding for the input text using OpenAI’s text-embedding models.
- Parameters:
text (str) – The input text to embed.
- Returns:
A list of floating-point values representing the text’s embedding.
- Return type:
list[float]