Creates an embedding vector that represents the provided input. See this page for details.
create_embedding(
engine_id,
input,
user = NULL,
openai_api_key = Sys.getenv("OPENAI_API_KEY"),
openai_organization = NULL
)
Returns a list, an element of which contains embedding vector(s) for a given input.
required; a length one character vector.
required; an arbitrary length character vector.
optional; defaults to NULL
; a length one character vector.
required; defaults to Sys.getenv("OPENAI_API_KEY")
(i.e., the value is retrieved from the .Renviron
file); a length one
character vector. Specifies OpenAI API key.
optional; defaults to NULL
; a length one
character vector. Specifies OpenAI organization.
For arguments description please refer to the official documentation.
if (FALSE) {
create_embedding(
engine_id = "text-similarity-babbage-001",
input = c(
"Ah, it is so boring to write documentation",
"But examples are really crucial"
)
)
}
Run the code above in your browser using DataLab