createFile method

CREATE ASSISTANT FILE

Implementation

Future<AssistantFileModel?> createFile(AttachAssistantFileModel fileObj)async{
  Internet net = Internet();
  try{
    var res = await net.openAIAssitant({'file_id' : fileObj.fileID}, "assistants/${fileObj.assistantID}/files", apiKey);

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