cancelUpload method
Cancel an Upload. No further parts may be added after cancellation.
Implementation
Future<Upload> cancelUpload(String uploadId) async {
final url = baseUrl.resolve('uploads/$uploadId/cancel');
final res = await httpClient.post(url, headers: getHeaders({}) ?? {});
if (res.statusCode == 200) {
return Upload.fromJson(jsonDecode(res.body));
}
throw OpenAIRequestException.fromHttpResponse(res);
}