completeUpload method
Complete an Upload by specifying the ordered list of part IDs. Optionally pass an MD5 checksum of the entire file to verify integrity.
Implementation
Future<Upload> completeUpload({
required String uploadId,
required List<String> partIds,
String? md5,
}) async {
final res = await postJson('/uploads/$uploadId/complete', {
'part_ids': partIds,
if (md5 != null) 'md5': md5,
});
if (res.statusCode == 200) {
return Upload.fromJson(jsonDecode(res.body));
}
throw OpenAIRequestException.fromHttpResponse(res);
}