TsgcHTTP_API_OpenAI › Methods › CompleteUpload
Completes a multipart upload by assembling the specified parts into the final file
function CompleteUpload(const aUploadId, aPartIds: string) : TsgcOpenAIClass_Response_Upload;
| Name | Type | Description |
|---|---|---|
aUploadId | const string | Identifier of the upload session to complete |
aPartIds | const string | Comma-separated list of part ids in the order they should be concatenated |
Upload descriptor with status "completed" and the created File object (TsgcOpenAIClass_Response_Upload)
Calls the POST /v1/uploads/{upload_id}/complete endpoint. Once completed, the session produces a regular File object whose id can be used with assistants, batch, fine-tuning and other endpoints. The list of part ids must cover the full file in the correct order; missing or out-of-order parts cause the server to reject completion.
vPartIds := 'part_aaa,part_bbb,part_ccc';
oResponse := oAPI.CompleteUpload(vUploadId, vPartIds);
ShowMessage('File id: ' + oResponse.FileId);