Uploads a file that will be used for various purposes. The size of the storage is limited to 1 Gb. See this page for details.
upload_file(
file,
purpose = c("search", "answers", "classifications", "fine-tune"),
openai_api_key = Sys.getenv("OPENAI_API_KEY"),
openai_organization = NULL
)required; a length one character vector.
required; defaults to "fine-tune"; a length one character
vector equals to"fine-tune".
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.
Returns a list, elements of which contains ID of the uploaded file and other supplementary information.
For arguments description please refer to the official documentation.
Other file functions:
delete_file(),
list_files(),
retrieve_file_content(),
retrieve_file()
if (FALSE) { # \dontrun{
file <- system.file("extdata", "classification-file.jsonl", package = "openai")
upload_file(file = file, purpose = "classification")
} # }