R6 class representing an Embedding in the OpenAI API
R6 class representing an Embedding in the OpenAI API
Public fields
embedding
The embedding vector.
index
The 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
input
Character. Input text to embed.
model
Character. ID of the model used to generate the embedding.
...
Additional arguments to be passed to the API functions.
resp
A list. The response object from the OpenAI API containing details of the embedding.
.async
Logical. If TRUE, the function will return a promise.