R6 class representing an Embedding in the OpenAI API
R6 class representing an Embedding in the OpenAI API
Public fields
embeddingThe embedding vector.
indexThe index of the embedding in the list of embeddings.
Methods
Method new()
Initialize an Embedding object
Usage
Embedding$new(input, model, ..., resp = NULL, .async = FALSE)Arguments
inputCharacter. Input text to embed.
modelCharacter. ID of the model used to generate the embedding.
...Additional arguments to be passed to the API functions.
respA list. The response object from the OpenAI API containing details of the embedding.
.asyncLogical. If TRUE, the function will return a promise.
