Learn R Programming

openaiRtools (version 0.2.2)

complete_upload: Complete a Multipart Upload (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and finalizes a multipart upload. Assembles all uploaded parts into a single file.

Usage

complete_upload(upload_id, part_ids, ...)

Value

A standard File object with $id that can be used in fine-tuning, assistants, or batch API calls, just like a file from upload_file().

Arguments

upload_id

Character. Required. The upload session ID.

part_ids

List of character strings. Required. Part IDs collected from add_upload_part() calls, in the correct file order.

...

Additional parameters such as md5 (integrity checksum).

Examples

Run this code
if (FALSE) {
Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx")

# After uploading all parts, complete the upload:
file_obj <- complete_upload(
  upload_id = upload$id,
  part_ids  = list("part-001", "part-002", "part-003")
)
cat("File ID:", file_obj$id)
}

Run the code above in your browser using DataLab