retrieveFile method
Returns information about the file with the unique id
.
Throws an InvalidRequestException if something goes wrong on the backend.
For more information, refer to the OpenAI documentation
Implementation
Future<UploadedFile> retrieveFile(String id) async {
var response = await http.get(
_getUri('files/$id'),
headers: {
'Authorization': 'Bearer $apiKey',
},
);
Map<String, dynamic> map = json.decode(response.body);
_catchExceptions(map);
return UploadedFile.fromJson(map);
}