Files are used to upload documents that can be used with features like Assistants, Fine-tuning, and Batch API.
oai_upload_file()
Upload a file to OpenAI.
oai_list_files()
List all files uploaded to OpenAI.
oai_retrieve_file()
Retrieve a specific file from OpenAI.
oai_retrieve_file_content()
Retrieve the content of a specific file from OpenAI.
Usage
oai_upload_file(
path,
purpose = c("assistants", "vision", "batch", "fine-tune"),
name = NULL,
.classify_response = TRUE,
.async = FALSE
)
oai_list_files(
purpose = NULL,
limit = NULL,
order = NULL,
after = NULL,
.classify_response = TRUE
)
oai_retrieve_file(file_id, .classify_response = TRUE, .async = FALSE)
oai_delete_file(file_id, .async = FALSE)
oai_retrieve_file_content(file_id, path, .async = FALSE)
Arguments
- path
Character. The path to the file to upload.
- purpose
Character. Optional. Only list files with the specified purpose.
- name
Character. Optional. The name of the file. If not provided, the file name will be used.
- .classify_response
Logical. Whether to classify the response as an R6 object.
- .async
Logical. If
TRUE
, the request is performed asynchronously.- limit
Integer. Optional. The maximum number of files to list. Defaults to 10,000.
- order
Character. Optional. The order to list files. Can be "asc" or "desc".
- after
Character. Optional. The ID of the file to start the list from.
- file_id
Character. The ID of the file to delete.