deleteFile method

DELETE A FILE FROM AN ASSISTANT

Implementation

Future<DeleteAssistantResponse?> deleteFile(AttachAssistantFileModel fileObj)async{
  Internet net = Internet();
  try{
    var res = await net.openAIAssitantGET("assistants/${fileObj.assistantID}/files/${fileObj.fileID}", apiKey);

    if(res.statusCode == 200){
      var r = DeleteAssistantResponse.fromJson(jsonDecode(res.body));
      return r;
    }else{
      return null;
    }
  }catch(e){
    if (kDebugMode) {
      print(e.toString());
    }
    return null;
  }
}