retrieve method

Future<ThreadMessageFileModel?> retrieve(
  1. dynamic threadID,
  2. dynamic messageID,
  3. dynamic fileID
)

RETRIEVE A MESSAGE BY ID

Implementation

Future<ThreadMessageFileModel?> retrieve(threadID, messageID, fileID)async{
  Internet net = Internet();
  try{
    var res = await net.openAIAssitantGET("threads/$threadID/messages/$messageID/files/$fileID", apiKey);

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